diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-26 22:03:14 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-27 10:36:55 -0400 |
commit | cc9c19b0302a83be6520c38a0a9944314ccc6962 (patch) | |
tree | 6f283425229fde7069581b1db2ea26e0dc0bb0e8 /sim/bpf/mloop.in | |
parent | 5d0b3088f75d2620eb87d5615a2637918d135491 (diff) | |
download | gdb-cc9c19b0302a83be6520c38a0a9944314ccc6962.zip gdb-cc9c19b0302a83be6520c38a0a9944314ccc6962.tar.gz gdb-cc9c19b0302a83be6520c38a0a9944314ccc6962.tar.bz2 |
sim: bpf: fix mixed decls & code warnings (and style)
Diffstat (limited to 'sim/bpf/mloop.in')
-rw-r--r-- | sim/bpf/mloop.in | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sim/bpf/mloop.in b/sim/bpf/mloop.in index 91f0c44..75a869b 100644 --- a/sim/bpf/mloop.in +++ b/sim/bpf/mloop.in @@ -123,14 +123,17 @@ cat <<EOF if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { + UHI off16; + USI imm32; + /* eBPF instructions are little-endian, but GETIMEMUDI reads according to target byte order. Swap to little-endian. */ insn = SWAP_8 (insn); /* But, the imm32 and offset16 fields within instructions follow target byte order. Swap those fields back. */ - UHI off16 = (UHI) ((insn & 0x00000000ffff0000) >> 16); - USI imm32 = (USI) ((insn & 0xffffffff00000000) >> 32); + off16 = (UHI) ((insn & 0x00000000ffff0000) >> 16); + imm32 = (USI) ((insn & 0xffffffff00000000) >> 32); off16 = SWAP_2 (off16); imm32 = SWAP_4 (imm32); |