1 #include <asm/unwind.h>
3 #if __LINUX_ARM_ARCH__ >= 6
4 .macro bitop
, name
, instr
8 strneb r1
, [ip
] @
assert word
-aligned
10 and r3
, r0
, #31 @ Get bit offset
12 add r1
, r1
, r0
, lsl
#2 @ Get word offset
13 #if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
29 .macro testop
, name
, instr
, store
33 strneb r1
, [ip
] @
assert word
-aligned
35 and r3
, r0
, #31 @ Get bit offset
37 add r1
, r1
, r0
, lsl
#2 @ Get word offset
38 mov r3
, r2
, lsl r3 @ create mask
40 #if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
46 ands r0
, r2
, r3 @ save old value of bit
47 \instr r2
, r2
, r3 @ toggle bit
59 .macro bitop
, name
, instr
63 strneb r1
, [ip
] @
assert word
-aligned
68 save_and_disable_irqs ip
69 ldr r2
, [r1
, r0
, lsl
#2]
71 str r2
, [r1
, r0
, lsl
#2]
79 * testop - implement a test_and_xxx_bit operation.
80 * @instr: operational instruction
81 * @store: store instruction
83 * Note: we can trivially conditionalise the store instruction
84 * to avoid dirtying the data cache.
86 .macro testop
, name
, instr
, store
90 strneb r1
, [ip
] @
assert word
-aligned
93 save_and_disable_irqs ip
94 ldr r2
, [r1
, r0
, lsl
#2]!
97 \instr r2
, r2
, r0
, lsl r3