summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-10-19 21:57:36 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-10-19 21:57:36 +0000
commit281d16fc4a4e62d31be19211b0369e4ce6b1013a (patch)
tree939d8d4eb192f2a5ac032f80db7e5accb3e5b887
parent9fdd2189b9827505e93011bf948882a90cfe2a82 (diff)
Use defines instead of magic constants for more IPL_ stuff, also sort
the IPL_ values by priority, not somewhat random values. No unmodified code relied on the order of these defines.
-rw-r--r--sys/arch/macppc/dev/macintr.c4
-rw-r--r--sys/arch/macppc/dev/openpic.c4
-rw-r--r--sys/arch/powerpc/include/intr.h17
3 files changed, 13 insertions, 12 deletions
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c
index aaf830e9240..83561ea55b4 100644
--- a/sys/arch/macppc/dev/macintr.c
+++ b/sys/arch/macppc/dev/macintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macintr.c,v 1.20 2003/10/16 03:54:48 deraadt Exp $ */
+/* $OpenBSD: macintr.c,v 1.21 2003/10/19 21:57:35 drahn Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -368,7 +368,7 @@ intr_calculatemasks()
}
/* Then figure out which IRQs use each level. */
- for (level = 0; level < 5; level++) {
+ for (level = IPL_NONE; level < IPL_NUM; level++) {
register int irqs = 0;
for (irq = 0; irq < ICU_LEN; irq++)
if (m_intrlevel[irq] & (1 << level))
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index 68a3ca20c58..bb41a161498 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.24 2003/10/16 03:54:48 deraadt Exp $ */
+/* $OpenBSD: openpic.c,v 1.25 2003/10/19 21:57:35 drahn Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -346,7 +346,7 @@ intr_calculatemasks()
}
/* Then figure out which IRQs use each level. */
- for (level = 0; level < 5; level++) {
+ for (level = IPL_NONE; level < IPL_NUM; level++) {
register int irqs = 0;
for (irq = 0; irq < ICU_LEN; irq++)
if (o_intrlevel[irq] & (1 << level))
diff --git a/sys/arch/powerpc/include/intr.h b/sys/arch/powerpc/include/intr.h
index a10977bceb3..b1e60ba000f 100644
--- a/sys/arch/powerpc/include/intr.h
+++ b/sys/arch/powerpc/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.23 2003/07/14 19:23:52 drahn Exp $ */
+/* $OpenBSD: intr.h,v 1.24 2003/10/19 21:57:35 drahn Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA.
@@ -35,14 +35,15 @@
#ifndef _POWERPC_INTR_H_
#define _POWERPC_INTR_H_
-#define IPL_BIO 0
+#define IPL_NONE 0
+#define IPL_BIO 1
#define IPL_AUDIO IPL_BIO /* XXX - was defined this val in audio_if.h */
-#define IPL_NET 1
-#define IPL_TTY 2
-#define IPL_IMP 3
-#define IPL_CLOCK 4
-#define IPL_NONE 5
+#define IPL_NET 2
+#define IPL_TTY 3
+#define IPL_IMP 4
+#define IPL_CLOCK 5
#define IPL_HIGH 6
+#define IPL_NUM 7
#define IST_NONE 0
#define IST_PULSE 1
@@ -67,7 +68,7 @@ void do_pending_int(void);
volatile extern int cpl, ipending, astpending;
-extern int imask[7];
+extern int imask[IPL_NUM];
/* SPL asserts */
#define splassert(wantipl) /* nothing */