summaryrefslogtreecommitdiff
path: root/arch/arm/net
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@codethink.co.uk>2013-07-24 18:44:56 +0400
committerBen Dooks <ben.dooks@codethink.co.uk>2013-10-19 23:46:35 +0400
commit3460743e025addc1ecbd496db2231181a2431774 (patch)
tree18ec651f6425d4eae9e952f5cec6df8ab15effa6 /arch/arm/net
parentbfdef3b32d2f36bf137c039de9a545cdfcfbafe2 (diff)
downloadlinux-3460743e025addc1ecbd496db2231181a2431774.tar.xz
ARM: net: fix arm instruction endian-ness in bpf_jit_32.c
Use <asm/opcodes.h> to correctly transform instruction byte ordering into in-memory ordering. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Diffstat (limited to 'arch/arm/net')
-rw-r--r--arch/arm/net/bpf_jit_32.c6
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 f50d223a0bd3..510d923ef6fd 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++;
}