diff options
author | 2009-06-01 22:52:38 +0000 | |
---|---|---|
committer | 2009-06-01 22:52:38 +0000 | |
commit | 2c6f8ba85a5831ac0bad488746b9129b5ef25bdf (patch) | |
tree | 922979113f03673710f7175a267a2fa301df41f7 /lib/libpthread | |
parent | add new file ruleset.c with code related to the ruleset matching, and kill (diff) | |
download | wireguard-openbsd-2c6f8ba85a5831ac0bad488746b9129b5ef25bdf.tar.xz wireguard-openbsd-2c6f8ba85a5831ac0bad488746b9129b5ef25bdf.zip |
Correct the _atomic_lock() asm so that gcc accepts the constraints
when compiling without optimization; fix copied from the kernel's atomic.h
ok miod@
Diffstat (limited to 'lib/libpthread')
-rw-r--r-- | lib/libpthread/arch/amd64/_atomic_lock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libpthread/arch/amd64/_atomic_lock.c b/lib/libpthread/arch/amd64/_atomic_lock.c index 0d187dee87d..e2cadd6f26a 100644 --- a/lib/libpthread/arch/amd64/_atomic_lock.c +++ b/lib/libpthread/arch/amd64/_atomic_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: _atomic_lock.c,v 1.3 2004/02/25 04:10:53 deraadt Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.4 2009/06/01 22:52:38 guenther Exp $ */ /* David Leonard, <d@csee.uq.edu.au>. Public domain. */ @@ -18,9 +18,9 @@ _atomic_lock(volatile _spinlock_lock_t *lock) * a local variable containing the locked state. */ old = _SPINLOCK_LOCKED; - __asm__("xchg %0,%1" - : "=r" (old), "=m" (*lock) - : "0" (old), "1" (*lock)); + __asm__("xchg %0,(%2)" + : "=r" (old) + : "0" (old), "r" (lock)); return (old != _SPINLOCK_UNLOCKED); } |