diff options
Diffstat (limited to 'arch/arm/lib/bitops.h')
| -rw-r--r-- | arch/arm/lib/bitops.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h index 2e787d40d599..c7f2627385e7 100644 --- a/arch/arm/lib/bitops.h +++ b/arch/arm/lib/bitops.h | |||
| @@ -18,12 +18,14 @@ | |||
| 18 | mov r2, #1 | 18 | mov r2, #1 |
| 19 | add r1, r1, r0, lsr #3 @ Get byte offset | 19 | add r1, r1, r0, lsr #3 @ Get byte offset |
| 20 | mov r3, r2, lsl r3 @ create mask | 20 | mov r3, r2, lsl r3 @ create mask |
| 21 | smp_dmb | ||
| 21 | 1: ldrexb r2, [r1] | 22 | 1: ldrexb r2, [r1] |
| 22 | ands r0, r2, r3 @ save old value of bit | 23 | ands r0, r2, r3 @ save old value of bit |
| 23 | \instr r2, r2, r3 @ toggle bit | 24 | \instr r2, r2, r3 @ toggle bit |
| 24 | strexb ip, r2, [r1] | 25 | strexb ip, r2, [r1] |
| 25 | cmp ip, #0 | 26 | cmp ip, #0 |
| 26 | bne 1b | 27 | bne 1b |
| 28 | smp_dmb | ||
| 27 | cmp r0, #0 | 29 | cmp r0, #0 |
| 28 | movne r0, #1 | 30 | movne r0, #1 |
| 29 | 2: mov pc, lr | 31 | 2: mov pc, lr |
