summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcic.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-06-16 06:18:16 +0000
committerimp <imp@FreeBSD.org>2001-06-16 06:18:16 +0000
commit2819707a6c5bef060addfc4e4e04b99055305ddf (patch)
treef8a28603beb7199ec20695bacb5f90568492be2d /sys/pccard/pcic.c
parentb08196841eaf11b05d90c5456e6c5206f940bff7 (diff)
downloadFreeBSD-src-2819707a6c5bef060addfc4e4e04b99055305ddf.zip
FreeBSD-src-2819707a6c5bef060addfc4e4e04b99055305ddf.tar.gz
On PC-98, map IRQ 6 to IRQ 7 at the pcic level. That is, when we're
told to use IRQ 6, progam the pcic to use irq 7 instead. Evidentally, at least some of the cards are wired this way. If you want to use irq 6, configure it. All the mapping is done just before we set the interrupt registers. See [FreeBSD98-testers 5064] for details. Added commentary about valid interrupts on some CBUS pc98 CL PD6722 based cards. Submitted by: Hiroshi TSUKADA-san <hiroshi@kiwi.ne.jp>
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r--sys/pccard/pcic.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index c8b75a4..28ac7f9 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -129,6 +129,16 @@ pcic_putw(struct pcic_slot *sp, int reg, unsigned short word)
sp->putb(sp, reg + 1, (word >> 8) & 0xff);
}
+static __inline int
+host_irq_to_pcic(int irq)
+{
+#ifdef PC98
+ if (irq == 6)
+ irq = 7;
+#endif
+ return (irq);
+}
+
/*
* Free up resources allocated so far.
*/
@@ -284,6 +294,7 @@ pcic_do_mgt_irq(struct pcic_slot *sp, int irq)
} else {
/* Management IRQ changes */
pcic_clrb(sp, PCIC_INT_GEN, PCIC_INTR_ENA);
+ irq = host_irq_to_pcic(irq);
sp->putb(sp, PCIC_STAT_INT, (irq << 4) | 0x8);
}
}
@@ -509,6 +520,7 @@ pcic_mapirq(struct slot *slt, int irq)
struct pcic_slot *sp = slt->cdata;
if (sp->sc->csc_route == pci_parallel)
return;
+ irq = host_irq_to_pcic(irq);
if (irq == 0)
pcic_clrb(sp, PCIC_INT_GEN, 0xF);
else
OpenPOWER on IntegriCloud