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
41 ands r0
, r2
, r3 @ save old value of bit
42 \instr r2
, r2
, r3 @ toggle bit
54 .macro bitop
, name
, instr
58 strneb r1
, [ip
] @
assert word
-aligned
63 save_and_disable_irqs ip
64 ldr r2
, [r1
, r0
, lsl
#2]
66 str r2
, [r1
, r0
, lsl
#2]
74 * testop - implement a test_and_xxx_bit operation.
75 * @instr: operational instruction
76 * @store: store instruction
78 * Note: we can trivially conditionalise the store instruction
79 * to avoid dirtying the data cache.
81 .macro testop
, name
, instr
, store
85 strneb r1
, [ip
] @
assert word
-aligned
88 save_and_disable_irqs ip
89 ldr r2
, [r1
, r0
, lsl
#2]!
92 \instr r2
, r2
, r0
, lsl r3