summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-27 22:10:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-27 22:10:56 +0000
commit7ed2948b32b317270cab3e79f1c4131941f9b60b (patch)
treefe14ac6c1245a4d30faa6e0beff2ab31ca247c51
parent19c4b654cc723df0e419fd9f12197f491b1bc1d4 (diff)
from netbsd:
The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
-rw-r--r--sys/arch/i386/isa/clock.c3
-rw-r--r--sys/arch/i386/isa/fd.c4
-rw-r--r--sys/arch/i386/isa/isa_machdep.c62
-rw-r--r--sys/arch/i386/isa/lms.c4
-rw-r--r--sys/arch/i386/isa/mms.c4
-rw-r--r--sys/arch/i386/isa/npx.c4
-rw-r--r--sys/arch/i386/isa/pccons.c4
-rw-r--r--sys/arch/i386/isa/pcvt/pcvt_drv.c4
-rw-r--r--sys/arch/i386/isa/pms.c4
-rw-r--r--sys/dev/isa/fd.c4
10 files changed, 31 insertions, 66 deletions
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index ff2f768d41c..9f5fdea7dcb 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -311,8 +311,7 @@ cpu_initclocks()
* XXX If you're doing strange things with multiple clocks, you might
* want to keep track of clock handlers.
*/
- (void)isa_intr_establish(0, ISA_IST_PULSE, ISA_IPL_CLOCK,
- clockintr, 0);
+ (void)isa_intr_establish(0, IST_PULSE, IPL_CLOCK, clockintr, 0);
}
void
diff --git a/sys/arch/i386/isa/fd.c b/sys/arch/i386/isa/fd.c
index 5ef1f655df8..6dc8d799112 100644
--- a/sys/arch/i386/isa/fd.c
+++ b/sys/arch/i386/isa/fd.c
@@ -305,8 +305,8 @@ fdcattach(parent, self, aux)
at_setup_dmachan(fdc->sc_drq, FDC_MAXIOSIZE);
isa_establish(&fdc->sc_id, &fdc->sc_dev);
#endif
- fdc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
- fdcintr, fdc);
+ fdc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, fdcintr,
+ fdc);
/*
* The NVRAM info only tells us about the first two disks on the
diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c
index 2e7e6233e48..c77519c57be 100644
--- a/sys/arch/i386/isa/isa_machdep.c
+++ b/sys/arch/i386/isa/isa_machdep.c
@@ -44,14 +44,11 @@
#include <sys/device.h>
#include <sys/malloc.h>
-#include <vm/vm.h>
-
#include <machine/pio.h>
#include <machine/cpufunc.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
-#include <dev/isa/isadmavar.h>
#include <i386/isa/isa_machdep.h>
#include <i386/isa/icu.h>
@@ -242,6 +239,8 @@ fakeintr(arg)
return 0;
}
+#define LEGAL_IRQ(x) ((x) >= 0 && (x) < ICU_LEN && (x) != 2)
+
/*
* Set up an interrupt handler to start being called.
* XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM.
@@ -249,12 +248,11 @@ fakeintr(arg)
void *
isa_intr_establish(irq, type, level, ih_fun, ih_arg)
int irq;
- isa_intrtype type;
- isa_intrlevel level;
+ int type;
+ int level;
int (*ih_fun) __P((void *));
void *ih_arg;
{
- int mask;
struct intrhand **p, *q, *ih;
static struct intrhand fakehand = {fakeintr};
extern int cold;
@@ -264,20 +262,16 @@ isa_intr_establish(irq, type, level, ih_fun, ih_arg)
if (ih == NULL)
panic("isa_intr_establish: can't malloc handler info");
- mask = 1 << irq;
-
- if (irq < 0 || irq > ICU_LEN || type == ISA_IST_NONE)
+ if (!LEGAL_IRQ(irq) || type == IST_NONE)
panic("intr_establish: bogus irq or type");
- if (fastvec & mask)
- panic("intr_establish: irq is already fast vector");
switch (intrtype[irq]) {
- case ISA_IST_EDGE:
- case ISA_IST_LEVEL:
+ case IST_EDGE:
+ case IST_LEVEL:
if (type == intrtype[irq])
break;
- case ISA_IST_PULSE:
- if (type != ISA_IST_NONE)
+ case IST_PULSE:
+ if (type != IST_NONE)
panic("intr_establish: can't share %s with %s",
isa_intr_typename(intrtype[irq]),
isa_intr_typename(type));
@@ -297,30 +291,7 @@ isa_intr_establish(irq, type, level, ih_fun, ih_arg)
* this with interrupts enabled and don't want the real routine called
* until masking is set up.
*/
- switch (level) {
- case ISA_IPL_NONE:
- fakehand.ih_level = IPL_NONE;
- break;
-
- case ISA_IPL_BIO:
- fakehand.ih_level = IPL_BIO;
- break;
-
- case ISA_IPL_NET:
- fakehand.ih_level = IPL_NET;
- break;
-
- case ISA_IPL_TTY:
- fakehand.ih_level = IPL_TTY;
- break;
-
- case ISA_IPL_CLOCK:
- fakehand.ih_level = IPL_CLOCK;
- break;
-
- default:
- panic("isa_intr_establish: bad interrupt level %d", level);
- }
+ fakehand.ih_level = level;
*p = &fakehand;
intr_calculatemasks();
@@ -332,7 +303,7 @@ isa_intr_establish(irq, type, level, ih_fun, ih_arg)
ih->ih_arg = ih_arg;
ih->ih_count = 0;
ih->ih_next = NULL;
- ih->ih_level = fakehand.ih_level;
+ ih->ih_level = level;
ih->ih_irq = irq;
*p = ih;
@@ -347,16 +318,11 @@ isa_intr_disestablish(arg)
void *arg;
{
struct intrhand *ih = arg;
- int irq, mask;
+ int irq = ih->ih_irq;
struct intrhand **p, *q;
- irq = ih->ih_irq;
- mask = 1 << irq;
-
- if (irq < 0 || irq > ICU_LEN)
+ if (!LEGAL_IRQ(irq))
panic("intr_disestablish: bogus irq");
- if (fastvec & mask)
- fastvec &= ~mask;
/*
* Remove the handler from the chain.
@@ -373,7 +339,7 @@ isa_intr_disestablish(arg)
intr_calculatemasks();
if (intrhand[irq] == NULL)
- intrtype[irq] = ISA_IST_NONE;
+ intrtype[irq] = IST_NONE;
}
/*
diff --git a/sys/arch/i386/isa/lms.c b/sys/arch/i386/isa/lms.c
index 2d79f0d6984..4cacafaa2b9 100644
--- a/sys/arch/i386/isa/lms.c
+++ b/sys/arch/i386/isa/lms.c
@@ -119,8 +119,8 @@ lmsattach(parent, self, aux)
sc->sc_iobase = iobase;
sc->sc_state = 0;
- sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_PULSE, ISA_IPL_TTY,
- lmsintr, sc);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, lmsintr,
+ sc);
}
int
diff --git a/sys/arch/i386/isa/mms.c b/sys/arch/i386/isa/mms.c
index 9081d199a82..7fe4586036d 100644
--- a/sys/arch/i386/isa/mms.c
+++ b/sys/arch/i386/isa/mms.c
@@ -109,8 +109,8 @@ mmsattach(parent, self, aux)
sc->sc_iobase = iobase;
sc->sc_state = 0;
- sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_PULSE, ISA_IPL_TTY,
- mmsintr, sc);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, mmsintr,
+ sc);
}
int
diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c
index ab6f116b8bd..b08c236948e 100644
--- a/sys/arch/i386/isa/npx.c
+++ b/sys/arch/i386/isa/npx.c
@@ -325,8 +325,8 @@ npxattach(parent, self, aux)
case NPX_INTERRUPT:
printf("\n");
lcr0(rcr0() & ~CR0_NE);
- sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE,
- ISA_IPL_NONE, npxintr, 0);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NONE,
+ npxintr, 0);
break;
case NPX_EXCEPTION:
printf(": using exception 16\n");
diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c
index 7ffe1503080..37c5bad0994 100644
--- a/sys/arch/i386/isa/pccons.c
+++ b/sys/arch/i386/isa/pccons.c
@@ -470,8 +470,8 @@ pcattach(parent, self, aux)
printf(": %s\n", vs.color ? "color" : "mono");
do_async_update(1);
- sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_TTY,
- pcintr, sc);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr,
+ sc);
}
int
diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c
index d6aa3e27d81..220b4465b3a 100644
--- a/sys/arch/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c
@@ -335,8 +335,8 @@ pcattach(struct isa_device *dev)
#if PCVT_NETBSD > 9
#if PCVT_NETBSD > 101
- sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_TTY,
- pcintr, (void *)0);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr,
+ (void *)0);
#else /* PCVT_NETBSD > 100 */
vthand.ih_fun = pcrint;
vthand.ih_arg = 0;
diff --git a/sys/arch/i386/isa/pms.c b/sys/arch/i386/isa/pms.c
index 8098b473968..b9d38c02ca8 100644
--- a/sys/arch/i386/isa/pms.c
+++ b/sys/arch/i386/isa/pms.c
@@ -192,8 +192,8 @@ pmsattach(parent, self, aux)
/* Other initialization was done by pmsprobe. */
sc->sc_state = 0;
- sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_TTY,
- pmsintr, sc);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pmsintr,
+ sc);
}
int
diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c
index 5ef1f655df8..6dc8d799112 100644
--- a/sys/dev/isa/fd.c
+++ b/sys/dev/isa/fd.c
@@ -305,8 +305,8 @@ fdcattach(parent, self, aux)
at_setup_dmachan(fdc->sc_drq, FDC_MAXIOSIZE);
isa_establish(&fdc->sc_id, &fdc->sc_dev);
#endif
- fdc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
- fdcintr, fdc);
+ fdc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, fdcintr,
+ fdc);
/*
* The NVRAM info only tells us about the first two disks on the