Module Name: src
Committed By: matt
Date: Sat Aug 10 19:02:22 UTC 2013
Modified Files:
src/common/lib/libc/arch/arm/atomic: atomic_add_64.S atomic_and_64.S
atomic_or_64.S
Log Message:
Never modify NLO/NHI (r2,r3) only LO/HI (r0,r1) so subsequent loops will work.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/arm/atomic/atomic_add_64.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/arm/atomic/atomic_and_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_or_64.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/common/lib/libc/arch/arm/atomic/atomic_add_64.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_add_64.S:1.4 src/common/lib/libc/arch/arm/atomic/atomic_add_64.S:1.5
--- src/common/lib/libc/arch/arm/atomic/atomic_add_64.S:1.4 Sat Aug 10 18:39:48 2013
+++ src/common/lib/libc/arch/arm/atomic/atomic_add_64.S Sat Aug 10 19:02:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_add_64.S,v 1.4 2013/08/10 18:39:48 matt Exp $ */
+/* $NetBSD: atomic_add_64.S,v 1.5 2013/08/10 19:02:22 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -40,9 +40,9 @@ ENTRY_NP(_atomic_add_64)
mov r2, r1
#endif
1: ldrexd r0, [r4] /* load old value (to be returned) */
- adds NLO, NLO, LO /* calculate new value */
- adc NHI, NHI, HI /* calculate new value */
- strexd ip, r2, [r4] /* try to store */
+ adds LO, LO, NLO /* calculate new value */
+ adc HI, HI, NHI /* calculate new value */
+ strexd ip, r0, [r4] /* try to store */
cmp ip, #0 /* succeed? */
bne 1b /* no, try again */
#ifdef _ARM_ARCH_7
@@ -51,7 +51,7 @@ ENTRY_NP(_atomic_add_64)
mcr p15, 0, ip, c7, c10, 5 /* data memory barrier */
#endif
pop {r4} /* restore temporary */
- RET /* return old value */
+ RET
END(_atomic_add_64)
ATOMIC_OP_ALIAS(atomic_add_64,_atomic_add_64)
Index: src/common/lib/libc/arch/arm/atomic/atomic_and_64.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_and_64.S:1.3 src/common/lib/libc/arch/arm/atomic/atomic_and_64.S:1.4
--- src/common/lib/libc/arch/arm/atomic/atomic_and_64.S:1.3 Sat Aug 10 18:39:25 2013
+++ src/common/lib/libc/arch/arm/atomic/atomic_and_64.S Sat Aug 10 19:02:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_and_64.S,v 1.3 2013/08/10 18:39:25 matt Exp $ */
+/* $NetBSD: atomic_and_64.S,v 1.4 2013/08/10 19:02:22 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -40,9 +40,9 @@ ENTRY_NP(_atomic_and_64)
#endif
mov r4, r0 /* need r0 for return value */
1: ldrexd r0, [r4] /* load old value (to be returned) */
- and r2, r2, r0 /* calculate new value */
- and r3, r3, r1 /* calculate new value */
- strexd ip, r2, [r4] /* try to store */
+ and r0, r0, r2 /* calculate new value */
+ and r1, r1, r3 /* calculate new value */
+ strexd ip, r0, [r4] /* try to store */
cmp ip, #0 /* succeed? */
bne 1b /* no, try again */
#ifdef _ARM_ARCH_7
@@ -51,7 +51,7 @@ ENTRY_NP(_atomic_and_64)
mcr p15, 0, ip, c7, c10, 5 /* data memory barrier */
#endif
pop {r4} /* restore temporary */
- RET /* return old value */
+ RET
END(_atomic_and_64)
ATOMIC_OP_ALIAS(atomic_and_64,_atomic_and_64)
Index: src/common/lib/libc/arch/arm/atomic/atomic_or_64.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_or_64.S:1.3 src/common/lib/libc/arch/arm/atomic/atomic_or_64.S:1.4
--- src/common/lib/libc/arch/arm/atomic/atomic_or_64.S:1.3 Sat Aug 10 18:39:07 2013
+++ src/common/lib/libc/arch/arm/atomic/atomic_or_64.S Sat Aug 10 19:02:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_or_64.S,v 1.3 2013/08/10 18:39:07 matt Exp $ */
+/* $NetBSD: atomic_or_64.S,v 1.4 2013/08/10 19:02:22 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -40,9 +40,9 @@ ENTRY_NP(_atomic_or_64)
#endif
mov r4, r0 /* need r0 for return value */
1: ldrexd r0, [r4] /* load old value (to be returned) */
- orr r2, r2, r0 /* calculate new value */
- orr r3, r3, r1 /* calculate new value */
- strexd ip, r2, [r4] /* try to store */
+ orr r0, r0, r2 /* calculate new value */
+ orr r1, r1, r3 /* calculate new value */
+ strexd ip, r0, [r4] /* try to store */
cmp ip, #0 /* succeed? */
bne 1b /* no, try again */
#ifdef _ARM_ARCH_7
@@ -51,7 +51,7 @@ ENTRY_NP(_atomic_or_64)
mcr p15, 0, ip, c7, c10, 5 /* data memory barrier */
#endif
pop {r4} /* restore temporary */
- RET /* return old value */
+ RET
END(_atomic_or_64)
ATOMIC_OP_ALIAS(atomic_or_64,_atomic_or_64)