forked from rlane/ubpf
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from qmonnet/master
Add BPF_J{LT,LE,SLT,SLE} instructions
- Loading branch information
Showing
14 changed files
with
198 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- asm | ||
mov32 r0, 0 | ||
mov32 r1, 5 | ||
jle r1, 4, +1 # Not taken | ||
jle r1, 6, +1 # Taken | ||
exit | ||
jle r1, 5, +1 # Taken | ||
exit | ||
mov32 r0, 1 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- asm | ||
mov r0, 0 | ||
mov r1, 5 | ||
mov r2, 4 | ||
mov r3, 6 | ||
jle r1, r2, +2 # Not taken | ||
jle r1, r1, +1 # Taken | ||
exit | ||
jle r1, r3, +1 # Taken | ||
exit | ||
mov r0, 1 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- asm | ||
mov32 r0, 0 | ||
mov32 r1, 5 | ||
jlt r1, 4, +2 # Not taken | ||
jlt r1, 5, +1 # Not taken | ||
jlt r1, 6, +1 # Taken | ||
exit | ||
mov32 r0, 1 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- asm | ||
mov r0, 0 | ||
mov r1, 5 | ||
mov r2, 4 | ||
mov r3, 6 | ||
jlt r1, r2, +2 # Not taken | ||
jlt r1, r1, +1 # Not taken | ||
jlt r1, r3, +1 # Taken | ||
exit | ||
mov r0, 1 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- asm | ||
mov32 r0, 0 | ||
mov r1, 0xfffffffe | ||
jsle r1, 0xfffffffd, +1 # Not taken | ||
jsle r1, 0xffffffff, +1 # Taken | ||
exit | ||
mov32 r0, 1 | ||
jsle r1, 0xfffffffe, +1 # Taken | ||
mov32 r0, 2 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- asm | ||
mov32 r0, 0 | ||
mov r1, 0xffffffff | ||
mov r2, 0xfffffffe | ||
mov32 r3, 0 | ||
jsle r1, r2, +1 # Not taken | ||
jsle r1, r3, +1 # Taken | ||
exit | ||
mov32 r0, 1 | ||
mov r1, r2 | ||
jsle r1, r2, +1 # Taken | ||
mov32 r0, 2 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- asm | ||
mov32 r0, 0 | ||
mov r1, 0xfffffffe | ||
jslt r1, 0xfffffffd, +2 # Not taken | ||
jslt r1, 0xfffffffe, +1 # Not taken | ||
jslt r1, 0xffffffff, +1 # Taken | ||
exit | ||
mov32 r0, 1 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- asm | ||
mov32 r0, 0 | ||
mov r1, 0xfffffffe | ||
mov r2, 0xfffffffd | ||
mov r3, 0xffffffff | ||
jslt r1, r1, +2 # Not taken | ||
jslt r1, r2, +1 # Not taken | ||
jslt r1, r3, +1 # Taken | ||
exit | ||
mov32 r0, 1 | ||
exit | ||
-- result | ||
0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,10 @@ | |
'jne': 5, | ||
'jsgt': 6, | ||
'jsge': 7, | ||
'jlt': 10, | ||
'jle': 11, | ||
'jslt': 12, | ||
'jsle': 13, | ||
} | ||
|
||
JMP_MISC_OPS = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,10 @@ | |
7: 'jsge', | ||
8: 'call', | ||
9: 'exit', | ||
10: 'jlt', | ||
11: 'jle', | ||
12: 'jslt', | ||
13: 'jsle', | ||
} | ||
|
||
MODES = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters