Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352761
b: refs/heads/master
c: 462738f
h: refs/heads/master
i:
  352759: 9b8960f
v: v3
  • Loading branch information
Nicolas Schichan authored and David S. Miller committed Feb 14, 2013
1 parent a5d381d commit 265eb91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e55f8b306cf305832a4ac78aa82e1b40e818ece
refs/heads/master: 462738f4f04febe16bf366925559c267130c88f0
15 changes: 11 additions & 4 deletions trunk/arch/arm/net/bpf_jit_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,17 @@ static void emit_load_be16(u8 cond, u8 r_res, u8 r_addr, struct jit_ctx *ctx)

static inline void emit_swap16(u8 r_dst, u8 r_src, struct jit_ctx *ctx)
{
emit(ARM_LSL_R(ARM_R1, r_src, 8), ctx);
emit(ARM_ORR_S(r_dst, ARM_R1, r_src, SRTYPE_LSL, 8), ctx);
emit(ARM_LSL_I(r_dst, r_dst, 8), ctx);
emit(ARM_LSL_R(r_dst, r_dst, 8), ctx);
/* r_dst = (r_src << 8) | (r_src >> 8) */
emit(ARM_LSL_I(ARM_R1, r_src, 8), ctx);
emit(ARM_ORR_S(r_dst, ARM_R1, r_src, SRTYPE_LSR, 8), ctx);

/*
* we need to mask out the bits set in r_dst[23:16] due to
* the first shift instruction.
*
* note that 0x8ff is the encoded immediate 0x00ff0000.
*/
emit(ARM_BIC_I(r_dst, r_dst, 0x8ff), ctx);
}

#else /* ARMv6+ */
Expand Down

0 comments on commit 265eb91

Please sign in to comment.