1 #include <asm/assembler.h>
2 #include <asm/unwind.h>
3 #include <asm/export.h>
5 #if __LINUX_ARM_ARCH__ >= 6
6 .macro bitop, name, instr
10 strneb r1, [ip] @ assert word-aligned
12 and r3, r0, #31 @ Get bit offset
14 add r1, r1, r0, lsl #2 @ Get word offset
15 #if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
32 .macro testop, name, instr, store
36 strneb r1, [ip] @ assert word-aligned
38 and r3, r0, #31 @ Get bit offset
40 add r1, r1, r0, lsl #2 @ Get word offset
41 mov r3, r2, lsl r3 @ create mask
43 #if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
49 ands r0, r2, r3 @ save old value of bit
50 \instr r2, r2, r3 @ toggle bit
63 .macro bitop, name, instr
67 strneb r1, [ip] @ assert word-aligned
72 save_and_disable_irqs ip
73 ldr r2, [r1, r0, lsl #2]
75 str r2, [r1, r0, lsl #2]
84 * testop - implement a test_and_xxx_bit operation.
85 * @instr: operational instruction
86 * @store: store instruction
88 * Note: we can trivially conditionalise the store instruction
89 * to avoid dirtying the data cache.
91 .macro testop, name, instr, store
95 strneb r1, [ip] @ assert word-aligned
98 save_and_disable_irqs ip
99 ldr r2, [r1, r0, lsl #2]!
102 \instr r2, r2, r0, lsl r3
109 EXPORT_SYMBOL(\name )