summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-07-29 21:24:06 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-07-29 21:24:06 +0000
commit5a840d9082f622411b7281cb37bc49d805866f6e (patch)
tree924fb2a7c8df761b5e2ac98ce89d2a5948ef1230 /sys
parent5d545b43061fb161a6a31227d72c8463218c198c (diff)
It turns out that VIA2 always interrupts at level 2, and IPL_BIO is always 2
too, so we can make these constants.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mac68k/dev/esp.c4
-rw-r--r--sys/arch/mac68k/include/cpu.h3
-rw-r--r--sys/arch/mac68k/include/intr.h7
-rw-r--r--sys/arch/mac68k/mac68k/intr.c29
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c4
-rw-r--r--sys/arch/mac68k/mac68k/via.c11
6 files changed, 21 insertions, 37 deletions
diff --git a/sys/arch/mac68k/dev/esp.c b/sys/arch/mac68k/dev/esp.c
index 77819d5c999..9c3c934ba05 100644
--- a/sys/arch/mac68k/dev/esp.c
+++ b/sys/arch/mac68k/dev/esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esp.c,v 1.26 2006/03/13 19:39:52 brad Exp $ */
+/* $OpenBSD: esp.c,v 1.27 2007/07/29 21:24:02 miod Exp $ */
/* $NetBSD: esp.c,v 1.17 1998/09/05 15:15:35 pk Exp $ */
/*
@@ -603,7 +603,7 @@ esp_iosb_have_dreq(esc)
/* Faster spl constructs, without saving old values */
#define __splx(s) __asm __volatile ("movew %0,sr" : : "di" (s));
#define __splvm() __splx(mac68k_vmipl)
-#define __splbio() __splx(mac68k_bioipl)
+#define __splbio() __splx(PSL_S | PSL_IPL2)
void
esp_quick_dma_go(sc)
diff --git a/sys/arch/mac68k/include/cpu.h b/sys/arch/mac68k/include/cpu.h
index f44002158bc..8c49d8ec0a1 100644
--- a/sys/arch/mac68k/include/cpu.h
+++ b/sys/arch/mac68k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.44 2007/05/30 17:10:44 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.45 2007/07/29 21:24:05 miod Exp $ */
/* $NetBSD: cpu.h,v 1.45 1997/02/10 22:13:40 scottr Exp $ */
/*
@@ -240,7 +240,6 @@ struct mac68k_machine_S {
int sonic; /* Has SONIC e-net */
int via1_ipl;
- int via2_ipl;
int aux_interrupts;
};
diff --git a/sys/arch/mac68k/include/intr.h b/sys/arch/mac68k/include/intr.h
index 6e3d60745b4..558610bec3c 100644
--- a/sys/arch/mac68k/include/intr.h
+++ b/sys/arch/mac68k/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.16 2007/05/15 13:46:22 martin Exp $ */
+/* $OpenBSD: intr.h,v 1.17 2007/07/29 21:24:05 miod Exp $ */
/* $NetBSD: intr.h,v 1.9 1998/08/12 06:58:42 scottr Exp $ */
/*
@@ -40,7 +40,6 @@
* splvm must be > spltty
*/
extern u_short mac68k_ttyipl;
-extern u_short mac68k_bioipl;
extern u_short mac68k_netipl;
extern u_short mac68k_vmipl;
extern u_short mac68k_audioipl;
@@ -58,7 +57,7 @@ extern u_short mac68k_statclockipl;
#define IPL_NONE 0
#define IPL_SOFTNET 1
#define IPL_SOFTCLOCK 1
-#define IPL_BIO PSLTOIPL(mac68k_bioipl)
+#define IPL_BIO 2
#define IPL_NET PSLTOIPL(mac68k_netipl)
#define IPL_TTY PSLTOIPL(mac68k_ttyipl)
#define IPL_CLOCK PSLTOIPL(mac68k_clockipl)
@@ -78,7 +77,7 @@ extern u_short mac68k_statclockipl;
#define splsoftclock() splsoft()
#define splsoftnet() splsoft()
#define spltty() _splraise(mac68k_ttyipl)
-#define splbio() _splraise(mac68k_bioipl)
+#define splbio() _splraise(PSL_S | PSL_IPL2)
#define splnet() _splraise(mac68k_netipl)
#define splvm() _splraise(mac68k_vmipl)
#define splaudio() _splraise(mac68k_audioipl)
diff --git a/sys/arch/mac68k/mac68k/intr.c b/sys/arch/mac68k/mac68k/intr.c
index de36a10e4e6..bcc0140cae9 100644
--- a/sys/arch/mac68k/mac68k/intr.c
+++ b/sys/arch/mac68k/mac68k/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.9 2007/05/29 18:10:42 miod Exp $ */
+/* $OpenBSD: intr.c,v 1.10 2007/07/29 21:24:05 miod Exp $ */
/* $NetBSD: intr.c,v 1.2 1998/08/25 04:03:56 scottr Exp $ */
/*-
@@ -71,7 +71,6 @@ int intr_debug = 0;
* interrupt on different levels as listed in locore.s
*/
u_short mac68k_ttyipl;
-u_short mac68k_bioipl;
u_short mac68k_netipl;
u_short mac68k_vmipl;
u_short mac68k_clockipl;
@@ -86,23 +85,22 @@ intr_init()
{
/* Standard spl(9) interrupt priorities */
mac68k_ttyipl = (PSL_S | PSL_IPL1);
- mac68k_bioipl = (PSL_S | PSL_IPL2);
if (mac68k_machine.aux_interrupts) {
mac68k_netipl = (PSL_S | PSL_IPL3);
mac68k_vmipl = (PSL_S | PSL_IPL6);
- mac68k_clockipl = (PSL_S | PSL_IPL6);
- mac68k_statclockipl = (PSL_S | PSL_IPL6);
} else {
- mac68k_netipl = (PSL_S | PSL_IPL2);
- mac68k_vmipl = (PSL_S | PSL_IPL2);
- mac68k_clockipl = (PSL_S | PSL_IPL2);
- mac68k_statclockipl = (PSL_S | PSL_IPL2);
-
if (current_mac_model->class == MACH_CLASSAV)
mac68k_netipl = (PSL_S | PSL_IPL4);
+ else if (mac68k_machine.sonic)
+ mac68k_netipl = (PSL_S | PSL_IPL3);
+ else
+ mac68k_netipl = (PSL_S | PSL_IPL2);
+
+ mac68k_vmipl = (PSL_S | PSL_IPL2);
}
+ mac68k_clockipl = mac68k_statclockipl = mac68k_vmipl;
intr_computeipl();
}
@@ -117,8 +115,8 @@ intr_computeipl()
* Enforce `bio <= net <= tty <= imp <= statclock <= clock'
* as defined in spl(9)
*/
- if (mac68k_bioipl > mac68k_netipl)
- mac68k_netipl = mac68k_bioipl;
+ if ((PSL_S | PSL_IPL2) > mac68k_netipl)
+ mac68k_netipl = (PSL_S | PSL_IPL2);
if (mac68k_netipl > mac68k_ttyipl)
mac68k_ttyipl = mac68k_netipl;
@@ -136,11 +134,6 @@ intr_computeipl()
/*
* Establish an autovectored interrupt handler.
* Called by driver attach functions.
- *
- * XXX Warning! DO NOT use Macintosh ROM traps from an interrupt handler
- * established by this routine, either directly or indirectly, without
- * properly saving and restoring all registers. If not, chaos _will_
- * ensue! (sar 19980806)
*/
void
intr_establish(int (*func)(void *), void *arg, int ipl, const char *name)
@@ -192,8 +185,6 @@ intr_disestablish(int ipl)
/*
* This is the dispatcher called by the low-level
* assembly language interrupt routine.
- *
- * XXX Note: see the warning in intr_establish()
*/
void
intr_dispatch(int evec) /* format | vector offset */
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index a05ea981947..8a57e65711a 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.141 2007/06/06 17:15:12 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.142 2007/07/29 21:24:05 miod Exp $ */
/* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */
/*
@@ -1472,7 +1472,6 @@ setmachdep()
current_mac_model = cpui;
mac68k_machine.via1_ipl = 1;
- mac68k_machine.via2_ipl = 2;
mac68k_machine.aux_interrupts = 0;
/*
@@ -1530,7 +1529,6 @@ setmachdep()
via_reg(VIA1, vBufB) &= (0xff ^ DB1O_AuxIntEnb);
via_reg(VIA1, vDirB) |= DB1O_AuxIntEnb;
mac68k_machine.via1_ipl = 6;
- mac68k_machine.via2_ipl = 2;
break;
case MACH_CLASSAV:
diff --git a/sys/arch/mac68k/mac68k/via.c b/sys/arch/mac68k/mac68k/via.c
index caf511458ae..5fc0c7b9c10 100644
--- a/sys/arch/mac68k/mac68k/via.c
+++ b/sys/arch/mac68k/mac68k/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.28 2006/06/30 15:12:47 miod Exp $ */
+/* $OpenBSD: via.c,v 1.29 2007/07/29 21:24:05 miod Exp $ */
/* $NetBSD: via.c,v 1.62 1997/09/10 04:38:48 scottr Exp $ */
/*-
@@ -148,14 +148,12 @@ via_init()
break;
}
- intr_establish(via2_intr, NULL, mac68k_machine.via2_ipl,
- "via2");
+ intr_establish(via2_intr, NULL, 2, "via2");
} else if (current_mac_model->class == MACH_CLASSIIfx) { /* OSS */
volatile u_char *ossintr;
ossintr = (volatile u_char *)Via2Base + 6;
*ossintr = 0;
- intr_establish(oss_intr, NULL, mac68k_machine.via2_ipl,
- "via2");
+ intr_establish(oss_intr, NULL, 2, "via2");
} else { /* RBV */
if (current_mac_model->class == MACH_CLASSIIci) {
/*
@@ -163,8 +161,7 @@ via_init()
*/
via2_reg(rBufB) |= DB2O_CEnable;
}
- intr_establish(rbv_intr, NULL, mac68k_machine.via2_ipl,
- "via2");
+ intr_establish(rbv_intr, NULL, 2, "via2");
nubus_intr.vh_ipl = 1;
nubus_intr.vh_fn = rbv_nubus_intr;