diff options
Diffstat (limited to 'arch/arm/lib/bitops.h')
-rw-r--r-- | arch/arm/lib/bitops.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h index 6976e60e47cb..64a988c1ad44 100644 --- a/arch/arm/lib/bitops.h +++ b/arch/arm/lib/bitops.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #if __LINUX_ARM_ARCH__ >= 6 | 1 | #include <linux/config.h> |
2 | |||
3 | #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_MPCORE) | ||
2 | .macro bitop, instr | 4 | .macro bitop, instr |
3 | mov r2, #1 | 5 | mov r2, #1 |
4 | and r3, r0, #7 @ Get bit offset | 6 | and r3, r0, #7 @ Get bit offset |
@@ -7,7 +9,7 @@ | |||
7 | 1: ldrexb r2, [r1] | 9 | 1: ldrexb r2, [r1] |
8 | \instr r2, r2, r3 | 10 | \instr r2, r2, r3 |
9 | strexb r0, r2, [r1] | 11 | strexb r0, r2, [r1] |
10 | cmpne r0, #0 | 12 | cmp r0, #0 |
11 | bne 1b | 13 | bne 1b |
12 | mov pc, lr | 14 | mov pc, lr |
13 | .endm | 15 | .endm |
@@ -19,9 +21,9 @@ | |||
19 | mov r3, r2, lsl r3 @ create mask | 21 | mov r3, r2, lsl r3 @ create mask |
20 | 1: ldrexb r2, [r1] | 22 | 1: ldrexb r2, [r1] |
21 | ands r0, r2, r3 @ save old value of bit | 23 | ands r0, r2, r3 @ save old value of bit |
22 | \instr ip, r2, r3 @ toggle bit | 24 | \instr r2, r2, r3 @ toggle bit |
23 | strexb r2, ip, [r1] | 25 | strexb ip, r2, [r1] |
24 | cmp r2, #0 | 26 | cmp ip, #0 |
25 | bne 1b | 27 | bne 1b |
26 | cmp r0, #0 | 28 | cmp r0, #0 |
27 | movne r0, #1 | 29 | movne r0, #1 |