summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r--sys/arch/hppa64/hppa64/mutex.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/hppa64/hppa64/mutex.c b/sys/arch/hppa64/hppa64/mutex.c
index 7a1efbe5060..c51aa9a31c7 100644
--- a/sys/arch/hppa64/hppa64/mutex.c
+++ b/sys/arch/hppa64/hppa64/mutex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mutex.c,v 1.6 2011/04/03 18:46:40 miod Exp $ */
+/* $OpenBSD: mutex.c,v 1.7 2011/04/21 04:34:12 miod Exp $ */
/*
* Copyright (c) 2004 Artur Grabowski <art@openbsd.org>
@@ -48,7 +48,8 @@ mtx_init(struct mutex *mtx, int wantipl)
void
mtx_enter(struct mutex *mtx)
{
- mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
+ if (mtx->mtx_wantipl != IPL_NONE)
+ mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
MUTEX_ASSERT_UNLOCKED(mtx);
mtx->mtx_lock = 1;
#ifdef DIAGNOSTIC
@@ -59,7 +60,8 @@ mtx_enter(struct mutex *mtx)
int
mtx_enter_try(struct mutex *mtx)
{
- mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
+ if (mtx->mtx_wantipl != IPL_NONE)
+ mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
MUTEX_ASSERT_UNLOCKED(mtx);
mtx->mtx_lock = 1;
#ifdef DIAGNOSTIC
@@ -77,5 +79,6 @@ mtx_leave(struct mutex *mtx)
curcpu()->ci_mutex_level--;
#endif
mtx->mtx_lock = 0;
- splx(mtx->mtx_oldipl);
+ if (mtx->mtx_wantipl != IPL_NONE)
+ splx(mtx->mtx_oldipl);
}