summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-04-27 21:15:02 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-04-27 21:15:02 +0000
commit893a8cf4e8af22cc3c54f4007efbe2ce3f3e26e7 (patch)
treef72683c1552c52c1160b869f353a976008d08315 /sys/arch/sparc64
parent7932a40e55d1ae730ec807e0e56a1fc201992f16 (diff)
Fix inline assembler to make it acceptable to gcc4. Based on a diff from
guenther@ for sparc, pointed out to me by miod@.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/include/lock.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sparc64/include/lock.h b/sys/arch/sparc64/include/lock.h
index a648575a888..0e873b3955b 100644
--- a/sys/arch/sparc64/include/lock.h
+++ b/sys/arch/sparc64/include/lock.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock.h,v 1.4 2008/05/02 19:52:27 miod Exp $ */
+/* $OpenBSD: lock.h,v 1.5 2010/04/27 21:15:01 kettenis Exp $ */
/* public domain */
@@ -27,7 +27,7 @@ __cpu_simple_lock(__cpu_simple_lock_t *l)
do {
old = __SIMPLELOCK_LOCKED;
__asm__ __volatile__
- ("ldstub %0, %1" : "=m" (*l), "=r" (old) : "0" (*l));
+ ("ldstub [%0], %1" : "=r" (l), "=r" (old) : "0" (l));
membar(LoadLoad | LoadStore);
} while (old != __SIMPLELOCK_UNLOCKED);
}
@@ -38,7 +38,7 @@ __cpu_simple_lock_try(__cpu_simple_lock_t *l)
__cpu_simple_lock_t old = __SIMPLELOCK_LOCKED;
__asm__ __volatile__
- ("ldstub %0, %1" : "=m" (*l), "=r" (old) : "0" (*l));
+ ("ldstub [%0], %1" : "=r" (l), "=r" (old) : "0" (l));
membar(LoadLoad | LoadStore);
return (old == __SIMPLELOCK_UNLOCKED);