summaryrefslogtreecommitdiff
path: root/sys/dev/isa/i82365_isa.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-27 00:27:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-27 00:27:20 +0000
commited3a4b59eb9f47de8399688a7c7d401bf4d4c734 (patch)
treebb8e93b7b038010a811c6a00b505f8ed780622a6 /sys/dev/isa/i82365_isa.c
parent90f8942c32b00998c60aeff1926768212f6ba328 (diff)
new priority mechanism for pcmcia interrupt allocation, ie. "best effort"
for machines low on interrupts. work by fgsch, and myself
Diffstat (limited to 'sys/dev/isa/i82365_isa.c')
-rw-r--r--sys/dev/isa/i82365_isa.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/sys/dev/isa/i82365_isa.c b/sys/dev/isa/i82365_isa.c
index dc62cab308c..1bd07bead49 100644
--- a/sys/dev/isa/i82365_isa.c
+++ b/sys/dev/isa/i82365_isa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365_isa.c,v 1.1 1998/09/11 08:02:50 fgsch Exp $ */
+/* $OpenBSD: i82365_isa.c,v 1.2 1998/12/27 00:27:18 deraadt Exp $ */
/* $NetBSD: i82365_isa.c,v 1.11 1998/06/09 07:25:00 thorpej Exp $ */
/*
@@ -174,6 +174,7 @@ pcic_isa_attach(parent, self, aux)
bus_space_tag_t memt = ia->ia_memt;
bus_space_handle_t ioh;
bus_space_handle_t memh;
+ int i;
/* Map i/o space. */
if (bus_space_map(iot, ia->ia_iobase, ia->ia_iosize, 0, &ioh)) {
@@ -205,15 +206,23 @@ pcic_isa_attach(parent, self, aux)
*/
if ((sc->irq = ia->ia_irq) == IRQUNK) {
- if (isa_intr_alloc(ic,
- PCIC_CSC_INTR_IRQ_VALIDMASK & pcic_isa_intr_alloc_mask,
- IST_EDGE, &sc->irq)) {
- printf("\n%s: can't allocate interrupt\n",
- sc->dev.dv_xname);
- return;
- }
- printf(": using irq %d", sc->irq);
+ int ist = IST_EDGE;
+
+ for (i = 0; i < npcic_isa_intr_list; i++)
+ if (isa_intr_check(ic, pcic_isa_intr_list[i], ist) == 2)
+ goto found;
+ for (i = 0; i < npcic_isa_intr_list; i++)
+ if (isa_intr_check(ic, pcic_isa_intr_list[i], ist))
+ goto found;
+ printf("\n%s: can't allocate interrupt\n", sc->dev.dv_xname);
+ return;
}
+
+found:
+ sc->irq = pcic_isa_intr_list[i];
+
+ printf(": using irq %d", sc->irq);
+
printf("\n");
pcic_attach(sc);