Commit 2bea29b7 authored by Mircea Gherzan's avatar Mircea Gherzan Committed by Russell King
Browse files

ARM: 7421/1: bpf_jit: BPF_S_ANC_ALU_XOR_X support

JIT support for the XOR operation introduced by the commit
ffe06c17

.

Signed-off-by: default avatarMircea Gherzan <mgherzan@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 2307574a
...@@ -762,6 +762,11 @@ static int build_body(struct jit_ctx *ctx) ...@@ -762,6 +762,11 @@ static int build_body(struct jit_ctx *ctx)
update_on_xread(ctx); update_on_xread(ctx);
emit(ARM_MOV_R(r_A, r_X), ctx); emit(ARM_MOV_R(r_A, r_X), ctx);
break; break;
case BPF_S_ANC_ALU_XOR_X:
/* A ^= X */
update_on_xread(ctx);
emit(ARM_EOR_R(r_A, r_A, r_X), ctx);
break;
case BPF_S_ANC_PROTOCOL: case BPF_S_ANC_PROTOCOL:
/* A = ntohs(skb->protocol) */ /* A = ntohs(skb->protocol) */
ctx->seen |= SEEN_SKB; ctx->seen |= SEEN_SKB;
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
#define ARM_INST_CMP_R 0x01500000 #define ARM_INST_CMP_R 0x01500000
#define ARM_INST_CMP_I 0x03500000 #define ARM_INST_CMP_I 0x03500000
#define ARM_INST_EOR_R 0x00200000
#define ARM_INST_LDRB_I 0x05d00000 #define ARM_INST_LDRB_I 0x05d00000
#define ARM_INST_LDRB_R 0x07d00000 #define ARM_INST_LDRB_R 0x07d00000
#define ARM_INST_LDRH_I 0x01d000b0 #define ARM_INST_LDRH_I 0x01d000b0
...@@ -132,6 +134,8 @@ ...@@ -132,6 +134,8 @@
#define ARM_CMP_R(rn, rm) _AL3_R(ARM_INST_CMP, 0, rn, rm) #define ARM_CMP_R(rn, rm) _AL3_R(ARM_INST_CMP, 0, rn, rm)
#define ARM_CMP_I(rn, imm) _AL3_I(ARM_INST_CMP, 0, rn, imm) #define ARM_CMP_I(rn, imm) _AL3_I(ARM_INST_CMP, 0, rn, imm)
#define ARM_EOR_R(rd, rn, rm) _AL3_R(ARM_INST_EOR, rd, rn, rm)
#define ARM_LDR_I(rt, rn, off) (ARM_INST_LDR_I | (rt) << 12 | (rn) << 16 \ #define ARM_LDR_I(rt, rn, off) (ARM_INST_LDR_I | (rt) << 12 | (rn) << 16 \
| (off)) | (off))
#define ARM_LDRB_I(rt, rn, off) (ARM_INST_LDRB_I | (rt) << 12 | (rn) << 16 \ #define ARM_LDRB_I(rt, rn, off) (ARM_INST_LDRB_I | (rt) << 12 | (rn) << 16 \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment