From ed3a4b59eb9f47de8399688a7c7d401bf4d4c734 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 27 Dec 1998 00:27:20 +0000 Subject: new priority mechanism for pcmcia interrupt allocation, ie. "best effort" for machines low on interrupts. work by fgsch, and myself --- sys/arch/alpha/dev/shared_intr.c | 16 +++++++++------- sys/arch/i386/isa/isa_machdep.c | 7 +++++-- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/alpha/dev/shared_intr.c b/sys/arch/alpha/dev/shared_intr.c index bc547ccd8bd..d2b31d27cf1 100644 --- a/sys/arch/alpha/dev/shared_intr.c +++ b/sys/arch/alpha/dev/shared_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shared_intr.c,v 1.3 1998/06/29 05:32:50 downsj Exp $ */ +/* $OpenBSD: shared_intr.c,v 1.4 1998/12/27 00:27:18 deraadt Exp $ */ /* $NetBSD: shared_intr.c,v 1.1 1996/11/17 02:03:08 cgd Exp $ */ /* @@ -125,15 +125,17 @@ alpha_shared_intr_check(intr, num, type) return (0); switch (intr[num].intr_sharetype) { - case IST_EDGE: + case IST_NONE: + return (2); + break; case IST_LEVEL: - if (type == intr[num].intr_sharetype) - break; + if (type != intr[num].intr_sharetype) + return (0); + return (2); + case IST_EDGE: case IST_PULSE: if ((type != IST_NONE) && (intr[num].intr_q.tqh_first != NULL)) - return (0); - case IST_NONE: - break; + return (0); } return (1); diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index 23f2b2370a0..2193fddeb99 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.c,v 1.31 1998/07/17 22:00:00 deraadt Exp $ */ +/* $OpenBSD: isa_machdep.c,v 1.32 1998/12/27 00:27:16 deraadt Exp $ */ /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */ #define ISA_DMA_STATS @@ -446,6 +446,7 @@ isa_intr_alloc(ic, mask, type, irq) /* * Just check to see if an IRQ is available/can be shared. + * 0 = no match, 1 = ok match, 2 = great match */ int isa_intr_check(ic, irq, type) @@ -458,12 +459,14 @@ isa_intr_check(ic, irq, type) switch (intrtype[irq]) { case IST_NONE: + return (2); break; - case IST_EDGE: case IST_LEVEL: if (type != intrtype[irq]) return (0); + return (2); break; + case IST_EDGE: case IST_PULSE: if (type != IST_NONE) return (0); -- cgit v1.2.3