summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-03-02 17:27:19 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-03-02 17:27:19 +0000
commit67b64cd6cec9b30edd74ec05d2e1279fe3ac56ea (patch)
tree2670845a71875da8048220014961132a253f96fa /sys
parent3c100c7def39d40265a973ef41a190cc5981e804 (diff)
If two drivers register the same hardware irq, they should get
the same virtual irq as well.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/macppc/dev/openpic.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index 030a0320b52..b25e2f9a626 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.11 2002/03/02 17:17:37 drahn Exp $ */
+/* $OpenBSD: openpic.c,v 1.12 2002/03/02 17:27:18 drahn Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -416,6 +416,7 @@ intr_calculatemasks()
imen_o = ~irqs;
}
}
+int o_virq_inited = 0;
/*
* Map 64 irqs into 32 (bits).
*/
@@ -424,6 +425,20 @@ mapirq(irq)
int irq;
{
int v;
+ int i;
+
+ if (o_virq_inited == 0) {
+ o_virq_max = 0;
+ for (i = 0; i < ICU_LEN; i++) {
+ o_virq[i] = -1;
+ }
+ o_virq_inited = 1;
+ }
+
+ /* irq in table already? */
+ if (o_virq[irq] != -1) {
+ return o_virq[irq];
+ }
if (irq < 0 || irq >= ICU_LEN)
panic("invalid irq");