diff options
author | 2012-03-03 14:42:33 +0000 | |
---|---|---|
committer | 2012-03-03 14:42:33 +0000 | |
commit | a3c5270532a0bbecce73ce7eba1e595ae7ecb24f (patch) | |
tree | ac9dd9efead87912ba3fd8f6b55fef813578d191 /lib/librthread/arch | |
parent | sync (diff) | |
download | wireguard-openbsd-a3c5270532a0bbecce73ce7eba1e595ae7ecb24f.tar.xz wireguard-openbsd-a3c5270532a0bbecce73ce7eba1e595ae7ecb24f.zip |
Sync the assembly statements with <machine/lock.h> for consistency.
Diffstat (limited to 'lib/librthread/arch')
-rw-r--r-- | lib/librthread/arch/hppa/_atomic_lock.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/librthread/arch/hppa/_atomic_lock.c b/lib/librthread/arch/hppa/_atomic_lock.c index a63985e10ad..c01fa9f78f7 100644 --- a/lib/librthread/arch/hppa/_atomic_lock.c +++ b/lib/librthread/arch/hppa/_atomic_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: _atomic_lock.c,v 1.5 2006/01/05 22:33:23 marc Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.6 2012/03/03 14:42:33 miod Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -16,11 +16,15 @@ */ #include <spinlock.h> +#ifdef DIAGNOSTIC +#include <stdio.h> +#include <stdlib.h> +#endif int _atomic_lock(volatile _spinlock_lock_t *lock) { - _spinlock_lock_t old; + volatile _spinlock_lock_t old; #ifdef DIAGNOSTIC if ((unsigned long)lock & 0xf) { @@ -29,9 +33,9 @@ _atomic_lock(volatile _spinlock_lock_t *lock) } #endif - asm volatile ("ldcw %1,%0" - : "=r" (old), "=m" (*lock) - : "m" (*lock)); + asm volatile ("ldcws 0(%2),%0" + : "=&r" (old), "+m" (lock) + : "r" (lock)); return (old == _SPINLOCK_LOCKED); } |