From 771cd4d45afd115c066de4b2682205453eac6929 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Fri, 18 Dec 1998 05:59:19 +0000 Subject: add md _atomic_is_locked; clean --- lib/libpthread/arch/alpha/_atomic_lock.c | 13 +++++++++++-- lib/libpthread/arch/i386/_atomic_lock.c | 11 +++++++++-- lib/libpthread/arch/m68k/_atomic_lock.c | 10 +++++++++- lib/libpthread/arch/mips/_atomic_lock.c | 10 +++++++++- lib/libpthread/arch/sparc/_atomic_lock.c | 13 +++++++++++-- 5 files changed, 49 insertions(+), 8 deletions(-) (limited to 'lib/libpthread') diff --git a/lib/libpthread/arch/alpha/_atomic_lock.c b/lib/libpthread/arch/alpha/_atomic_lock.c index 74575fc11d7..b12bc32d94a 100644 --- a/lib/libpthread/arch/alpha/_atomic_lock.c +++ b/lib/libpthread/arch/alpha/_atomic_lock.c @@ -1,5 +1,7 @@ -/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:35 d Exp $ */ -/* Atomic lock for alpha */ +/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:17 d Exp $ */ +/* + * Atomic lock for alpha + */ #include "spinlock.h" @@ -31,3 +33,10 @@ _atomic_lock(volatile register_t * lock) return old; } + +int +_atomic_is_locked(volatile register_t * lock) +{ + + return *lock; +} diff --git a/lib/libpthread/arch/i386/_atomic_lock.c b/lib/libpthread/arch/i386/_atomic_lock.c index 609dc42fb01..8ddcb33068e 100644 --- a/lib/libpthread/arch/i386/_atomic_lock.c +++ b/lib/libpthread/arch/i386/_atomic_lock.c @@ -1,6 +1,6 @@ -/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:36 d Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:17 d Exp $ */ /* - * Atomic lock aquire for i386. + * Atomic lock for i386 */ #include "spinlock.h" @@ -24,3 +24,10 @@ _atomic_lock(volatile register_t *lock) */ return old; } + +int +_atomic_is_locked(volatile register_t *lock) +{ + + return *lock; +} diff --git a/lib/libpthread/arch/m68k/_atomic_lock.c b/lib/libpthread/arch/m68k/_atomic_lock.c index be874ad2892..d0e2ddbe2d6 100644 --- a/lib/libpthread/arch/m68k/_atomic_lock.c +++ b/lib/libpthread/arch/m68k/_atomic_lock.c @@ -1,7 +1,8 @@ -/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:36 d Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:17 d Exp $ */ /* * Atomic lock for m68k */ + #include "spinlock.h" register_t @@ -25,3 +26,10 @@ _atomic_lock(volatile register_t *lock) : "d"(1), "0"(old)); return old; } + +int +_atomic_lock(volatile register_t *lock) +{ + + return *lock; +} diff --git a/lib/libpthread/arch/mips/_atomic_lock.c b/lib/libpthread/arch/mips/_atomic_lock.c index 088d4a7a643..4df2a99ad85 100644 --- a/lib/libpthread/arch/mips/_atomic_lock.c +++ b/lib/libpthread/arch/mips/_atomic_lock.c @@ -1,7 +1,8 @@ -/* $OpenBSD: _atomic_lock.c,v 1.1 1998/11/20 11:15:37 d Exp $ */ +/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:18 d Exp $ */ /* * Atomic lock for mips */ + #include "pthread_private.h" #include "spinlock.h" #include @@ -49,3 +50,10 @@ _atomic_lock(volatile register_t *lock) #endif return old; } + +int +_atomic_is_locked(volatile register_t * lock) +{ + + return *lock; +} diff --git a/lib/libpthread/arch/sparc/_atomic_lock.c b/lib/libpthread/arch/sparc/_atomic_lock.c index 35b50e3ada5..530c86b4805 100644 --- a/lib/libpthread/arch/sparc/_atomic_lock.c +++ b/lib/libpthread/arch/sparc/_atomic_lock.c @@ -1,5 +1,7 @@ -/* $OpenBSD */ -/* atomic lock for sparc */ +/* $OpenBSD: _atomic_lock.c,v 1.2 1998/12/18 05:59:18 d Exp $ */ +/* + * Atomic lock for sparc + */ #include "spinlock.h" @@ -8,3 +10,10 @@ _atomic_lock(volatile register_t * lock) { return _thread_slow_atomic_lock(lock); } + +int +_atomic_is_locked(volatile register_t * lock) +{ + + return *lock; +} -- cgit v1.2.3