diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2013-07-24 15:44:56 +0100 |
---|---|---|
committer | Ben Dooks <ben.dooks@codethink.co.uk> | 2013-07-24 16:55:05 +0100 |
commit | 0f4fda17f90d41d27c80e7fa66af71a3c03d0c80 (patch) | |
tree | 35707f8073f31f7626cd19eca1b8dd0c528bb44a | |
parent | 3b902762397494d4c495c830457fb23cfb6aa263 (diff) | |
download | linux-baserock/311/be/core-v4.tar.gz |
ARM: net: fix arm instruction endian-ness in bpf_jit_32.cbaserock/311/be/core-v4
Use <asm/opcodes.h> to correctly transform instruction byte ordering
into in-memory ordering.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
-rw-r--r-- | arch/arm/net/bpf_jit_32.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 1a643ee8e082..95b43b6d2098 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -19,6 +19,7 @@ #include <linux/if_vlan.h> #include <asm/cacheflush.h> #include <asm/hwcap.h> +#include <asm/opcodes.h> #include "bpf_jit_32.h" @@ -113,8 +114,11 @@ static u32 jit_udiv(u32 dividend, u32 divisor) static inline void _emit(int cond, u32 inst, struct jit_ctx *ctx) { + inst |= (cond << 28); + inst = __opcode_to_mem_arm(inst); + if (ctx->target != NULL) - ctx->target[ctx->idx] = inst | (cond << 28); + ctx->target[ctx->idx] = inst; ctx->idx++; } |