diff options
author | David Leonard <d@cvs.openbsd.org> | 1999-03-10 09:45:41 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1999-03-10 09:45:41 +0000 |
commit | 8c9876eefd4582670984b365e1dcb56f6bea47a1 (patch) | |
tree | 3e1ee57df02183c6fd526ce9e6c47f39430725db /lib/libc_r/arch/i386 | |
parent | b2de0ed4413b58fb2ae1a796eaf0e668083f53a5 (diff) |
tidy
Diffstat (limited to 'lib/libc_r/arch/i386')
-rw-r--r-- | lib/libc_r/arch/i386/_atomic_lock.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/libc_r/arch/i386/_atomic_lock.c b/lib/libc_r/arch/i386/_atomic_lock.c index 4794226ad3e..bfb7db7e9c8 100644 --- a/lib/libc_r/arch/i386/_atomic_lock.c +++ b/lib/libc_r/arch/i386/_atomic_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: _atomic_lock.c,v 1.3 1998/12/21 07:58:45 d Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.4 1999/03/10 09:45:40 d Exp $ */ /* * Atomic lock for i386 */ @@ -15,13 +15,10 @@ _atomic_lock(volatile _spinlock_lock_t *lock) * a local variable containg the locked state. */ old = _SPINLOCK_LOCKED; - __asm__("xchg %0, %1" - : "=r" (old), "=m" (*lock) : "0"(old), "1" (*lock) ); - /* - * So now LOCKED is in *lock and 'old' contains what - * used to be in *lock. We return 0 if the lock was acquired, - * (ie its old value was UNLOCKED) or 1 otherwise. - */ + __asm__("xchg %0,%1" + : "=r" (old), "=m" (*lock) + : "0" (old), "1" (*lock)); + return (old != _SPINLOCK_UNLOCKED); } |