summaryrefslogtreecommitdiff
path: root/sys/arch/m88k
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-04-27 21:48:57 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-04-27 21:48:57 +0000
commita7d060714187a42cfe95654af1263949edfa7786 (patch)
tree8edfad0afb24ee7c5df9119e7494ddfd61cfce1f /sys/arch/m88k
parent4bbb1bd85632378599d7d7af0ca2dc91b6728207 (diff)
Revert mtx_enter_try. It didn't compile on hppa, it doesn't compile on
landisk, and the sparc implementation is obviously wrong. That's where I stopped looking, so who knows what else was broken. A simple comparison of the existing mtx_enter with the new mtx_enter_try would have told anybody.
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r--sys/arch/m88k/m88k/mutex.S86
1 files changed, 1 insertions, 85 deletions
diff --git a/sys/arch/m88k/m88k/mutex.S b/sys/arch/m88k/m88k/mutex.S
index 5364d35bc5c..630805ca1be 100644
--- a/sys/arch/m88k/m88k/mutex.S
+++ b/sys/arch/m88k/m88k/mutex.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: mutex.S,v 1.6 2009/04/25 20:14:43 weingart Exp $ */
+/* $OpenBSD: mutex.S,v 1.7 2009/04/27 21:48:56 kettenis Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat.
@@ -126,90 +126,6 @@ enter_panic:
#endif /* MULTIPROCESSOR */
/*
- * int mtx_enter_try(struct mutex *mtx)
- */
-ENTRY(mtx_enter_try)
- subu r31, r31, 8
- st r1, r31, 4 /* save return address */
-
-#ifdef MULTIPROCESSOR
-
- st r2, r31, 0 /* save mtx */
-enter_try_again:
- ld r2, r2, MTX_WANTIPL
- bcnd eq0, r2, 1f
- bsr _C_LABEL(raiseipl) /* raiseipl(mtx->mtx_wantipl) */
-1:
- ld r4, r31, 0
- or r3, r0, 1
- xmem r3, r4, r0 /* attempt to claim the lock, old */
- bcnd ne0, r3, enter_try_failed /* mtx->mtx_lock is 0 if successful*/
-
- ldcr r3, CPU
- st r2, r4, MTX_OLDIPL /* save into mtx_oldipl */
- st r3, r4, MTX_CPU /* mtx->mtx_cpu = curcpu() */
-
- ld r1, r31, 4
- or r2, r0, 1 /* return nonzero */
- jmp.n r1
- addu r31, r31, 8
-
-enter_try_failed: /* the lock is not ours... */
- ld r3, r4, MTX_WANTIPL
- bcnd eq0, r3, 2f
- bcnd ne0, r2, 1f /* splx(oldipl) */
- bsr.n _C_LABEL(spl0)
- addu r1, r1, 2f - . - 4
-1:
- bsr _C_LABEL(setipl)
-2:
-#ifdef DIAGNOSTIC
- ld r2, r31, 0 /* restore mtx */
- ldcr r3, CPU
- ld r4, r2, MTX_CPU
- cmp r5, r3, r4
- bcnd eq0, r5, enter_try_panic
-#endif
- or r2, r0, r0 /* return zero */
- jmp.n r1
- addu r31, r31, 8
-
-#ifdef DIAGNOSTIC
-enter_try_panic:
- or.u r2, r0, hi16(9f)
- bsr.n _C_LABEL(panic)
- or r2, r2, lo16(9f)
-
- data
-9:
- string "mtx_enter_try: humpaan itsekseni"
-#endif
-
-#else /* MULTIPROCESSOR */
-
- st r2, r31, 0 /* save mtx */
- ld r2, r2, MTX_WANTIPL
- bcnd eq0, r2, 1f
- bsr _C_LABEL(raiseipl) /* raiseipl(mtx->mtx_wantipl) */
-1:
- ld r4, r31, 0
- ldcr r3, CPU
- st r3, r4, MTX_LOCK /* locked! */
-
- st r2, r4, MTX_OLDIPL /* save into mtx_oldipl */
-
-#ifdef DIAGNOSTIC /* necessary for MUTEX_ASSERT_LOCKED */
- st r3, r4, MTX_CPU /* mtx->mtx_cpu = curcpu() */
-#endif
-
- ld r1, r31, 4
- or r2, r0, 1 /* return nonzero */
- jmp.n r1
- addu r31, r31, 8
-
-#endif /* MULTIPROCESSOR */
-
-/*
* void mtx_leave(struct mutex *mtx)
*/
ENTRY(mtx_leave)