summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc/mac
diff options
context:
space:
mode:
authorDale S. Rahn <rahnds@cvs.openbsd.org>2000-07-07 13:22:44 +0000
committerDale S. Rahn <rahnds@cvs.openbsd.org>2000-07-07 13:22:44 +0000
commitd25c5758ea35b3a5510242ed2943f124cc00de19 (patch)
tree1e338355a8d04ce7cee98d0970155bc4b701edad /sys/arch/powerpc/mac
parent0193f0c2db48a9f4d692c17a58ca88ace3dc1323 (diff)
Since it is possible for the interrupt controller to be configured late
in the config cycle, and pci devices as well as mac onboard devices do not use interrupts to probe. It is possible to record that the interrupt is to be configured, but not configure it with the interrupt controller until the interrupt controller configures itself. This is lazy binding of interrupts. If there is a conflicting interrupt or other problem it will be noticed when the interrupt controller configures and collects the data rather than when the device configures. Currently on the openpic interrupt controller supports these pre-configured interrupts.
Diffstat (limited to 'sys/arch/powerpc/mac')
-rw-r--r--sys/arch/powerpc/mac/openpic.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/sys/arch/powerpc/mac/openpic.c b/sys/arch/powerpc/mac/openpic.c
index 099648c8af7..1f435ac1e01 100644
--- a/sys/arch/powerpc/mac/openpic.c
+++ b/sys/arch/powerpc/mac/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.3 2000/06/15 03:11:01 rahnds Exp $ */
+/* $OpenBSD: openpic.c,v 1.4 2000/07/07 13:22:42 rahnds Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -58,12 +58,12 @@
#include <machine/pio.h>
#include <powerpc/mac/openpicreg.h>
-#define ICU_LEN 64
+#define ICU_LEN 128
#define LEGAL_IRQ(x) ((x >= 0) && (x < ICU_LEN))
static int intrtype[ICU_LEN], intrmask[ICU_LEN], intrlevel[ICU_LEN];
static struct intrhand *intrhand[ICU_LEN] = { 0 };
-static int hwirq[ICU_LEN], virq[64];
+static int hwirq[ICU_LEN], virq[ICU_LEN];
unsigned int imen /* = 0xffffffff */; /* XXX */
static int virq_max = 0;
@@ -145,6 +145,7 @@ vaddr_t openpic_base;
void * openpic_intr_establish( void * lcv, int irq, int type, int level,
int (*ih_fun) __P((void *)), void *ih_arg, char *name);
void openpic_intr_disestablish( void *lcp, void *arg);
+void openpic_collect_preconf_intr();
void
openpic_attach(parent, self, aux)
@@ -171,6 +172,10 @@ openpic_attach(parent, self, aux)
mac_intr_establish_func = openpic_intr_establish;
mac_intr_disestablish_func = openpic_intr_disestablish;
install_extint(ext_intr_openpic);
+
+#if 1
+ openpic_collect_preconf_intr();
+#endif
#if 1
mac_intr_establish(parent, 0x37, IST_LEVEL,
@@ -179,6 +184,28 @@ openpic_attach(parent, self, aux)
printf("\n");
}
+void
+openpic_collect_preconf_intr()
+{
+ int i;
+ printf("postconfiguring interrupts\n");
+ for (i = 0; i < ppc_configed_intr_cnt; i++) {
+ printf("\t%s irq %d level %d fun %x arg %x\n",
+ ppc_configed_intr[i].ih_what,
+ ppc_configed_intr[i].ih_irq,
+ ppc_configed_intr[i].ih_level,
+ ppc_configed_intr[i].ih_fun,
+ ppc_configed_intr[i].ih_arg
+ );
+ openpic_intr_establish(NULL,
+ ppc_configed_intr[i].ih_irq,
+ IST_LEVEL,
+ ppc_configed_intr[i].ih_level,
+ ppc_configed_intr[i].ih_fun,
+ ppc_configed_intr[i].ih_arg,
+ ppc_configed_intr[i].ih_what);
+ }
+}
static int
prog_switch (void *arg)
@@ -419,7 +446,7 @@ mapirq(irq)
{
int v;
- if (irq < 0 || irq >= 64)
+ if (irq < 0 || irq >= ICU_LEN)
panic("invalid irq");
virq_max++;
v = virq_max;