summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-01-17 16:17:24 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-01-17 16:17:24 +0000
commit09c204af73ffb4de06f1495c0db372d924377e34 (patch)
tree23f1443f37187271da60d6089adb116c0cb0e8d6 /sys/arch/macppc
parent9df2250b25f8b69b8836a82dcddcf59031f8fb6e (diff)
Allow nested interrupts on the mac interrupt controllers, previously
the external interrupt was never enabled during interrupt handling.
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r--sys/arch/macppc/dev/macintr.c22
-rw-r--r--sys/arch/macppc/dev/openpic.c14
2 files changed, 25 insertions, 11 deletions
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c
index f923b274944..b1da881d7c8 100644
--- a/sys/arch/macppc/dev/macintr.c
+++ b/sys/arch/macppc/dev/macintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macintr.c,v 1.6 2001/11/06 19:53:15 miod Exp $ */
+/* $OpenBSD: macintr.c,v 1.7 2002/01/17 16:17:23 drahn Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -510,11 +510,8 @@ mac_ext_intr()
struct intrhand *ih;
volatile unsigned long int_state;
- pcpl = splhigh(); /* Turn off all */
+ pcpl = cpl; /* Turn off all */
-#if 0
-printf("mac_intr \n");
-#endif
int_state = read_irq();
if (int_state == 0)
goto out;
@@ -526,19 +523,24 @@ start:
o_imen = imen;
r_imen = 1 << irq;
- if ((pcpl & r_imen) != 0) {
+ if ((cpl & r_imen) != 0) {
ipending |= r_imen; /* Masked! Mark this as pending */
imen |= r_imen;
enable_irq(~imen);
} else {
+ splraise(intrmask[irq]);
+
+ /*
+ * enable interrupts for the duration of the
+ * interrupt handler
+ */
+ ppc_intr_enable(1);
ih = intrhand[irq];
while (ih) {
-#if 0
-printf("calling handler %x\n", ih->ih_fun);
-#endif
(*ih->ih_fun)(ih->ih_arg);
ih = ih->ih_next;
}
+ ppc_intr_disable();
uvmexp.intrs++;
evirq[hwirq[irq]].ev_count++;
@@ -548,7 +550,9 @@ printf("calling handler %x\n", ih->ih_fun);
goto start;
out:
+ ppc_intr_enable(1);
splx(pcpl); /* Process pendings. */
+ ppc_intr_disable();
}
void
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index ea6cf258f2d..ae86ac25962 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.7 2001/11/06 19:53:15 miod Exp $ */
+/* $OpenBSD: openpic.c,v 1.8 2002/01/17 16:17:23 drahn Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -609,7 +609,7 @@ ext_intr_openpic()
int pcpl;
struct intrhand *ih;
- pcpl = splhigh(); /* Turn off all */
+ pcpl = cpl;
realirq = openpic_read_irq(0);
@@ -625,11 +625,19 @@ ext_intr_openpic()
ipending |= r_imen; /* Masked! Mark this as pending */
openpic_disable_irq(realirq);
} else {
+ splraise(intrmask[irq]);
+
+ /*
+ * enable interrupts for the duration of the
+ * interrupt handler
+ */
+ ppc_intr_enable(1);
ih = intrhand[irq];
while (ih) {
(*ih->ih_fun)(ih->ih_arg);
ih = ih->ih_next;
}
+ ppc_intr_disable();
uvmexp.intrs++;
evirq[realirq].ev_count++;
@@ -640,7 +648,9 @@ ext_intr_openpic()
realirq = openpic_read_irq(0);
}
+ ppc_intr_enable(1);
splx(pcpl); /* Process pendings. */
+ ppc_intr_disable();
}
void
openpic_init()