aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-11-12 18:53:45 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-11-12 18:53:45 +0000
commitd9009094398fbdf0e79e8fa16ce715f9f2ab25f7 (patch)
tree81c46c09b89483d51c0def1030ae042d50d51893 /sys/i386
parentdd05edcb0fec5c4a1385c2c02155e65d6eb354bc (diff)
downloadsrc-d9009094398fbdf0e79e8fa16ce715f9f2ab25f7.tar.gz
src-d9009094398fbdf0e79e8fa16ce715f9f2ab25f7.zip
Use newer constraints for atomic_cmpset().
Requested by: bde
Notes
Notes: svn path=/head/; revision=86303
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/include/atomic.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h
index c3ad67a586c1..0da813316238 100644
--- a/sys/i386/include/atomic.h
+++ b/sys/i386/include/atomic.h
@@ -120,18 +120,17 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
__asm __volatile(
" pushfl ; "
" cli ; "
- " cmpl %1,%3 ; "
+ " cmpl %0,%2 ; "
" jne 1f ; "
- " movl %2,%3 ; "
+ " movl %1,%2 ; "
"1: "
" sete %%al; "
" movzbl %%al,%0 ; "
" popfl ; "
"# atomic_cmpset_int"
- : "=a" (res) /* 0 (result) */
- : "0" (exp), /* 1 */
- "r" (src), /* 2 */
- "m" (*(dst)) /* 3 */
+ : "+a" (res) /* 0 (result) */
+ : "r" (src), /* 1 */
+ "m" (*(dst)) /* 2 */
: "memory");
return (res);
@@ -144,15 +143,14 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
__asm __volatile (
" " MPLOCKED " "
- " cmpxchgl %2,%3 ; "
+ " cmpxchgl %1,%2 ; "
" setz %%al ; "
" movzbl %%al,%0 ; "
"1: "
"# atomic_cmpset_int"
- : "=a" (res) /* 0 (result) */
- : "0" (exp), /* 1 */
- "r" (src), /* 2 */
- "m" (*(dst)) /* 3 */
+ : "+a" (res) /* 0 (result) */
+ : "r" (src), /* 1 */
+ "m" (*(dst)) /* 2 */
: "memory");
return (res);