diff options
author | 2010-12-03 19:44:22 +0000 | |
---|---|---|
committer | 2010-12-03 19:44:22 +0000 | |
commit | 5770a33a723e3b55ac9ab48d343daddc2c55948e (patch) | |
tree | d8a6487f196a6d9b9c7fb99d03ed3375bf0a2079 /lib/libpthread/arch | |
parent | removed slot argument of function pckbd_cnattach (diff) | |
download | wireguard-openbsd-5770a33a723e3b55ac9ab48d343daddc2c55948e.tar.xz wireguard-openbsd-5770a33a723e3b55ac9ab48d343daddc2c55948e.zip |
Sync with amd64, to allow this to compile without warnings with gcc4:
``Correct the _atomic_lock() asm so that gcc accepts the constraints
when compiling without optimization; fix copied from the kernel's atomic.h''
spotted by jim@
Diffstat (limited to 'lib/libpthread/arch')
-rw-r--r-- | lib/libpthread/arch/i386/_atomic_lock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libpthread/arch/i386/_atomic_lock.c b/lib/libpthread/arch/i386/_atomic_lock.c index 8e97ec7c3e9..9bf4d82b994 100644 --- a/lib/libpthread/arch/i386/_atomic_lock.c +++ b/lib/libpthread/arch/i386/_atomic_lock.c @@ -1,11 +1,11 @@ -/* $OpenBSD: _atomic_lock.c,v 1.7 2002/10/11 19:08:41 marc Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.8 2010/12/03 19:44:22 miod Exp $ */ /* David Leonard, <d@csee.uq.edu.au>. Public domain. */ /* * Atomic lock for i386 */ -#include "spinlock.h" +#include <spinlock.h> int _atomic_lock(volatile _spinlock_lock_t *lock) @@ -17,9 +17,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); } |