aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-07-27 18:00:05 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-07-27 18:00:05 -0400
commit614d73edae68836f7659ee8efec90878e6215fb1 (patch)
tree6a9cde929df6175e797a157ca36df4c5cd99f3ae /arch/arm
parent9e566d8bd61f939b7f5d7d969f5b178571471cf9 (diff)
[ARM SMP] Fix data corruption in test_* bitops
If we found that the bit was already in the desired state, we would skip performing the operation, and write random data back. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/lib/bitops.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 6976e60e47cb..5382a3023602 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -19,9 +19,9 @@
19 mov r3, r2, lsl r3 @ create mask 19 mov r3, r2, lsl r3 @ create mask
201: ldrexb r2, [r1] 201: ldrexb r2, [r1]
21 ands r0, r2, r3 @ save old value of bit 21 ands r0, r2, r3 @ save old value of bit
22 \instr ip, r2, r3 @ toggle bit 22 \instr r2, r2, r3 @ toggle bit
23 strexb r2, ip, [r1] 23 strexb ip, r2, [r1]
24 cmp r2, #0 24 cmp ip, #0
25 bne 1b 25 bne 1b
26 cmp r0, #0 26 cmp r0, #0
27 movne r0, #1 27 movne r0, #1