diff options
author | 2012-09-01 00:32:23 +0000 | |
---|---|---|
committer | 2012-09-01 00:32:23 +0000 | |
commit | cde6fc201d55f174c423caf7560c454b29da406e (patch) | |
tree | 3c8a6d2fd05c6c6d8d34297c0d9d94bea91bbc5b /lib/libpthread/arch/vax/_atomic_lock.c | |
parent | modload needs to invoke ld with -nopie now on ELF platforms (diff) | |
download | wireguard-openbsd-cde6fc201d55f174c423caf7560c454b29da406e.tar.xz wireguard-openbsd-cde6fc201d55f174c423caf7560c454b29da406e.zip |
So passes uthreads
Like autumn leaves on water
don't fear the tedu@
Diffstat (limited to 'lib/libpthread/arch/vax/_atomic_lock.c')
-rw-r--r-- | lib/libpthread/arch/vax/_atomic_lock.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/libpthread/arch/vax/_atomic_lock.c b/lib/libpthread/arch/vax/_atomic_lock.c deleted file mode 100644 index 5a9736995fe..00000000000 --- a/lib/libpthread/arch/vax/_atomic_lock.c +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: _atomic_lock.c,v 1.4 2003/05/19 18:31:49 miod Exp $ */ - -/* - * Atomic lock for vax - * Written by Miodrag Vallat <miod@openbsd.org> - placed in the public domain. - */ - -#include "spinlock.h" - -int -_atomic_lock(volatile _spinlock_lock_t *lock) -{ - _spinlock_lock_t old; - - /* - * The Branch on Bit Set and Set Interlocked instruction - * sets a given bit in a register or a memory location, as an - * atomic, interlocked operation. - * If the bit was set, execution continues at the branch - * location. - * - * For more details, please refer to the Vax Architecture - * Reference Manual, chapter 3 (Instructions), section - * ``Control instructions''. - */ - __asm__ ( - "movl $1, %1\n" /* _SPINLOCK_LOCKED */ - "bbssi $0, %0, 1f\n" - "movl $0, %1\n" /* _SPINLOCK_UNLOCKED */ - "1: \n" - : "=m" (*lock), "=r" (old) : "0" (*lock) - ); - - return (old != _SPINLOCK_UNLOCKED); -} - -int -_atomic_is_locked(volatile _spinlock_lock_t *lock) -{ - - return (*lock != _SPINLOCK_UNLOCKED); -} |