diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-02 17:37:42 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-02 17:37:42 +0000 |
commit | ac829049a09dcce9c6ad4e1815bd4965bd6f79ca (patch) | |
tree | ee55fe39878ac920ee9f15cdc9def37dc0178025 /sys/arch/macppc | |
parent | b4a5e9151c9315eb56920ebff7a4e9757f228b8d (diff) |
If two drivers register the same hardware irq, they should get
the same virtual irq as well.
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r-- | sys/arch/macppc/dev/macintr.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c index 3766be45435..d64cef9b932 100644 --- a/sys/arch/macppc/dev/macintr.c +++ b/sys/arch/macppc/dev/macintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macintr.c,v 1.10 2002/03/02 17:17:37 drahn Exp $ */ +/* $OpenBSD: macintr.c,v 1.11 2002/03/02 17:37:41 drahn Exp $ */ /*- * Copyright (c) 1995 Per Fogelstrom @@ -460,6 +460,9 @@ enable_irq(x) } out32rb(INT_ENABLE_REG0, state0); } + +int m_virq_inited = 0; + /* * Map 64 irqs into 32 (bits). */ @@ -468,6 +471,20 @@ mapirq(irq) int irq; { int v; + int i; + + if (m_virq_inited == 0) { + m_virq_max = 0; + for (i = 0; i < ICU_LEN; i++) { + m_virq[i] = 0; + } + m_virq_inited = 1; + } + + /* irq in table already? */ + if (m_virq[irq] != 0) { + return m_virq[irq]; + } if (irq < 0 || irq >= 64) panic("invalid irq"); |