diff options
Diffstat (limited to 'arch/sparc/net')
-rw-r--r-- | arch/sparc/net/bpf_jit_asm.S | 3 | ||||
-rw-r--r-- | arch/sparc/net/bpf_jit_comp.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/arch/sparc/net/bpf_jit_asm.S b/arch/sparc/net/bpf_jit_asm.S index 9d016c7017f7..8c83f4b8eb15 100644 --- a/arch/sparc/net/bpf_jit_asm.S +++ b/arch/sparc/net/bpf_jit_asm.S | |||
@@ -6,10 +6,12 @@ | |||
6 | #define SAVE_SZ 176 | 6 | #define SAVE_SZ 176 |
7 | #define SCRATCH_OFF STACK_BIAS + 128 | 7 | #define SCRATCH_OFF STACK_BIAS + 128 |
8 | #define BE_PTR(label) be,pn %xcc, label | 8 | #define BE_PTR(label) be,pn %xcc, label |
9 | #define SIGN_EXTEND(reg) sra reg, 0, reg | ||
9 | #else | 10 | #else |
10 | #define SAVE_SZ 96 | 11 | #define SAVE_SZ 96 |
11 | #define SCRATCH_OFF 72 | 12 | #define SCRATCH_OFF 72 |
12 | #define BE_PTR(label) be label | 13 | #define BE_PTR(label) be label |
14 | #define SIGN_EXTEND(reg) | ||
13 | #endif | 15 | #endif |
14 | 16 | ||
15 | #define SKF_MAX_NEG_OFF (-0x200000) /* SKF_LL_OFF from filter.h */ | 17 | #define SKF_MAX_NEG_OFF (-0x200000) /* SKF_LL_OFF from filter.h */ |
@@ -135,6 +137,7 @@ bpf_slow_path_byte_msh: | |||
135 | save %sp, -SAVE_SZ, %sp; \ | 137 | save %sp, -SAVE_SZ, %sp; \ |
136 | mov %i0, %o0; \ | 138 | mov %i0, %o0; \ |
137 | mov r_OFF, %o1; \ | 139 | mov r_OFF, %o1; \ |
140 | SIGN_EXTEND(%o1); \ | ||
138 | call bpf_internal_load_pointer_neg_helper; \ | 141 | call bpf_internal_load_pointer_neg_helper; \ |
139 | mov (LEN), %o2; \ | 142 | mov (LEN), %o2; \ |
140 | mov %o0, r_TMP; \ | 143 | mov %o0, r_TMP; \ |
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index 51ae87b483e0..ece4af0575e9 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c | |||
@@ -184,7 +184,7 @@ do { \ | |||
184 | */ | 184 | */ |
185 | #define emit_alu_K(OPCODE, K) \ | 185 | #define emit_alu_K(OPCODE, K) \ |
186 | do { \ | 186 | do { \ |
187 | if (K) { \ | 187 | if (K || OPCODE == AND || OPCODE == MUL) { \ |
188 | unsigned int _insn = OPCODE; \ | 188 | unsigned int _insn = OPCODE; \ |
189 | _insn |= RS1(r_A) | RD(r_A); \ | 189 | _insn |= RS1(r_A) | RD(r_A); \ |
190 | if (is_simm13(K)) { \ | 190 | if (is_simm13(K)) { \ |