summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-09-18 19:32:42 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-09-18 19:32:42 +0000
commit0b4d73772f38f9c1604a1045e8f2b6556a49601a (patch)
tree736fa918625c874a5763d680883f670fa9172cc0
parentceaa863ddf2c057c98ae7480008cb6d951e91a4d (diff)
Fix conversion of symbolic IPL level to hardware PSL value in the mutex code.
This is a noop on all arches but hp300, where this fixes (at least) IPL_BIO mutexes.
-rw-r--r--sys/arch/hp300/include/intr.h3
-rw-r--r--sys/arch/m68k/m68k/mutex.c6
-rw-r--r--sys/arch/mac68k/include/intr.h5
-rw-r--r--sys/arch/mvme68k/include/intr.h4
4 files changed, 11 insertions, 7 deletions
diff --git a/sys/arch/hp300/include/intr.h b/sys/arch/hp300/include/intr.h
index 25267bd661a..f96d5bd42dc 100644
--- a/sys/arch/hp300/include/intr.h
+++ b/sys/arch/hp300/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.25 2009/03/15 20:40:25 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.26 2009/09/18 19:32:39 miod Exp $ */
/* $NetBSD: intr.h,v 1.2 1997/07/24 05:43:08 scottr Exp $ */
/*-
@@ -72,6 +72,7 @@ struct isr {
* to raise interrupt priority to the requested level.
*/
extern unsigned short hp300_varpsl[NISR];
+#define MD_IPLTOPSL(ipl) hp300_varpsl[ipl]
/* These spl calls are used by machine-independent code. */
#define splsoft() _splraise(PSL_S | PSL_IPL1)
diff --git a/sys/arch/m68k/m68k/mutex.c b/sys/arch/m68k/m68k/mutex.c
index 60943202b0d..684ec0974ed 100644
--- a/sys/arch/m68k/m68k/mutex.c
+++ b/sys/arch/m68k/m68k/mutex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mutex.c,v 1.4 2009/08/13 13:24:55 weingart Exp $ */
+/* $OpenBSD: mutex.c,v 1.5 2009/09/18 19:32:41 miod Exp $ */
/*
* Copyright (c) 2004 Artur Grabowski <art@openbsd.org>
@@ -52,7 +52,7 @@ void
mtx_enter(struct mutex *mtx)
{
if (mtx->mtx_wantipl != IPL_NONE)
- mtx->mtx_oldipl = _splraise(IPLTOPSL(mtx->mtx_wantipl));
+ mtx->mtx_oldipl = _splraise(MD_IPLTOPSL(mtx->mtx_wantipl));
MUTEX_ASSERT_UNLOCKED(mtx);
mtx->mtx_lock = 1;
@@ -62,7 +62,7 @@ int
mtx_enter_try(struct mutex *mtx)
{
if (mtx->mtx_wantipl != IPL_NONE)
- mtx->mtx_oldipl = _splraise(IPLTOPSL(mtx->mtx_wantipl));
+ mtx->mtx_oldipl = _splraise(MD_IPLTOPSL(mtx->mtx_wantipl));
MUTEX_ASSERT_UNLOCKED(mtx);
mtx->mtx_lock = 1;
diff --git a/sys/arch/mac68k/include/intr.h b/sys/arch/mac68k/include/intr.h
index 42d1140ef30..7441ec32c99 100644
--- a/sys/arch/mac68k/include/intr.h
+++ b/sys/arch/mac68k/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.19 2009/03/15 20:40:25 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.20 2009/09/18 19:32:41 miod Exp $ */
/* $NetBSD: intr.h,v 1.9 1998/08/12 06:58:42 scottr Exp $ */
/*
@@ -65,6 +65,8 @@ extern u_short mac68k_statclockipl;
#define IPL_STATCLOCK PSLTOIPL(mac68k_statclockipl)
#define IPL_HIGH 7
+#define MD_IPLTOPSL(ipl) IPLTOPSL(ipl)
+
/*
* These should be used for:
* 1) ensuring mutual exclusion (why use processor level?)
@@ -89,7 +91,6 @@ extern u_short mac68k_statclockipl;
#define splsched() splhigh()
/* These spl calls are _not_ to be used by machine-independent code. */
-#define spladb() splhigh()
#define splzs() splserial()
/* watch out for side effects */
diff --git a/sys/arch/mvme68k/include/intr.h b/sys/arch/mvme68k/include/intr.h
index bd16c4471f3..c16e2386226 100644
--- a/sys/arch/mvme68k/include/intr.h
+++ b/sys/arch/mvme68k/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.18 2009/03/15 20:40:25 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.19 2009/09/18 19:32:41 miod Exp $ */
/*
* Copyright (C) 2000 Steve Murphree, Jr.
* All rights reserved.
@@ -51,6 +51,8 @@
#define IPL_STATCLOCK 5
#define IPL_HIGH 7
+#define MD_IPLTOPSL(ipl) IPLTOPSL(ipl)
+
#define splsoft() _splraise(PSL_S | PSL_IPL1)
#define splsoftclock() splsoft()
#define splsoftnet() splsoft()