summaryrefslogtreecommitdiff
path: root/lib/libpthread/arch/alpha/uthread_machdep_asm.S
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2002-12-12 18:26:19 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2002-12-12 18:26:19 +0000
commit3b0d5401341541673f8a6d3ff6299a86e9847499 (patch)
tree907b36b9913609eec68aefa27b16a929554fa8c5 /lib/libpthread/arch/alpha/uthread_machdep_asm.S
parenta514e57b4799b40b2b6df5a395a13a47ac0044d4 (diff)
use ldl_l/stl_c instead of ldq_l and ldq_c as _spinlock_lock_t
is defined as an int. This solves several alpha/pthread problems as repoted by various ports people.
Diffstat (limited to 'lib/libpthread/arch/alpha/uthread_machdep_asm.S')
-rw-r--r--lib/libpthread/arch/alpha/uthread_machdep_asm.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libpthread/arch/alpha/uthread_machdep_asm.S b/lib/libpthread/arch/alpha/uthread_machdep_asm.S
index 0069eda0041..054d8a52d22 100644
--- a/lib/libpthread/arch/alpha/uthread_machdep_asm.S
+++ b/lib/libpthread/arch/alpha/uthread_machdep_asm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_machdep_asm.S,v 1.3 2002/11/29 09:27:34 deraadt Exp $ */
+/* $OpenBSD: uthread_machdep_asm.S,v 1.4 2002/12/12 18:26:18 marc Exp $ */
/* David Leonard, <d@csee.uq.edu.au>. Public domain. */
#include <machine/asm.h>
@@ -66,9 +66,12 @@ _thread_machdep_switch:
LEAF(_atomic_lock,1)
LDGP(pv)
-0: ldq_l v0, 0(a0) /* read existing lock value */
+ /* NOTE: using ldl_l/stl_c instead of
+ ldq_l and ldq_c as machine/spinlock.h
+ defines _spinlock_lock_t as int */
+0: ldl_l v0, 0(a0) /* read existing lock value */
mov 1, t0 /* locked value to store */
- stq_c t0, 0(a0) /* attempt to store, status in t0 */
+ stl_c t0, 0(a0) /* attempt to store, status in t0 */
beq t0, 1f /* branch forward to optimise prediction */
mb /* sync with other processors */
RET /* return with v0==0 if lock obtained */