diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2009-06-01 22:52:39 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2009-06-01 22:52:39 +0000 |
commit | d4385126884398d3be675e2a7bcefadc8abc2959 (patch) | |
tree | 322631fdf5ff107a623c23b27af44d91aaeae4b8 /lib/libpthread | |
parent | ed0f1bbb4bce13439e483538231f2a157ee188f5 (diff) |
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); } |