From 893a8cf4e8af22cc3c54f4007efbe2ce3f3e26e7 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 27 Apr 2010 21:15:02 +0000 Subject: Fix inline assembler to make it acceptable to gcc4. Based on a diff from guenther@ for sparc, pointed out to me by miod@. --- sys/arch/sparc64/include/lock.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/arch/sparc64') 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); -- cgit v1.2.3