projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2fd03a
)
x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction
author
Eric Dumazet
<
[email protected]
>
Mon, 4 Jun 2012 21:26:30 +0000
(21:26 +0000)
committer
David S. Miller
<
[email protected]
>
Wed, 6 Jun 2012 16:42:44 +0000
(09:42 -0700)
commit
ffe06c17afbb
(filter: add XOR operation) added generic support
for XOR operation.
This patch implements the XOR instruction in x86 jit.
Signed-off-by: Eric Dumazet <
[email protected]
>
Cc: Jiri Pirko <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
arch/x86/net/bpf_jit_comp.c
patch
|
blob
|
history
diff --git
a/arch/x86/net/bpf_jit_comp.c
b/arch/x86/net/bpf_jit_comp.c
index 0597f95b6da663af5a43d5f5effd0bdf0447fe4f..33643a8bcbbb0f1887dc2f815fe469aaf0e0507a 100644
(file)
--- a/
arch/x86/net/bpf_jit_comp.c
+++ b/
arch/x86/net/bpf_jit_comp.c
@@
-309,6
+309,10
@@
void bpf_jit_compile(struct sk_filter *fp)
else
EMIT1_off32(0x0d, K); /* or imm32,%eax */
break;
+ case BPF_S_ANC_ALU_XOR_X: /* A ^= X; */
+ seen |= SEEN_XREG;
+ EMIT2(0x31, 0xd8); /* xor %ebx,%eax */
+ break;
case BPF_S_ALU_LSH_X: /* A <<= X; */
seen |= SEEN_XREG;
EMIT4(0x89, 0xd9, 0xd3, 0xe0); /* mov %ebx,%ecx; shl %cl,%eax */