diff options
author | kato <kato@FreeBSD.org> | 1997-06-02 15:45:40 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1997-06-02 15:45:40 +0000 |
commit | 800e70338e229a63144a55975918f2573ee594e9 (patch) | |
tree | a2c307134f4ee93e8b37bd594e0a07c23a6969b0 | |
parent | a45f5948d16726b965c3d1d4206c5908802caa42 (diff) | |
download | FreeBSD-src-800e70338e229a63144a55975918f2573ee594e9.zip FreeBSD-src-800e70338e229a63144a55975918f2573ee594e9.tar.gz |
Synchronize with following files:
Revision Changes Path
> 1.165 +2 -1 src/sys/i386/conf/files.i386
> 1.246 +2 -1 src/sys/i386/i386/machdep.c
> 1.98 +2 -2 src/sys/i386/i386/trap.c
> 1.87 +2 -2 src/sys/i386/isa/clock.c
> 1.89 +2 -356 src/sys/i386/isa/isa.c
> 1.45 +2 -1 src/sys/i386/isa/npx.c
-rw-r--r-- | sys/conf/files.pc98 | 3 | ||||
-rw-r--r-- | sys/pc98/cbus/clock.c | 4 | ||||
-rw-r--r-- | sys/pc98/cbus/pcrtc.c | 4 | ||||
-rw-r--r-- | sys/pc98/conf/files.pc98 | 3 | ||||
-rw-r--r-- | sys/pc98/i386/machdep.c | 3 | ||||
-rw-r--r-- | sys/pc98/i386/trap.c | 4 | ||||
-rw-r--r-- | sys/pc98/pc98/clock.c | 4 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 3 | ||||
-rw-r--r-- | sys/pc98/pc98/npx.c | 4 | ||||
-rw-r--r-- | sys/pc98/pc98/pc98.c | 402 |
10 files changed, 20 insertions, 414 deletions
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98 index c1f9c95..b3133d7 100644 --- a/sys/conf/files.pc98 +++ b/sys/conf/files.pc98 @@ -3,7 +3,7 @@ # # modified for PC-9801 # -# $Id: files.pc98,v 1.25 1997/05/31 12:39:57 kato Exp $ +# $Id: files.pc98,v 1.26 1997/06/02 09:22:55 kato Exp $ # aic7xxx_asm optional ahc device-driver \ dependency "$S/dev/aic7xxx/*.[chyl]" \ @@ -134,6 +134,7 @@ i386/isa/if_wl.c optional wl device-driver i386/isa/if_zp.c optional zp device-driver i386/isa/ipl_funcs.c standard \ compile-with "${CC} -c ${CFLAGS} ${PROF:S/^$/-fomit-frame-pointer/} $<" +i386/isa/intr_machdep.c standard pc98/pc98/pc98.c optional isa device-driver pc98/isa/istallion.c optional stli device-driver pc98/isa/joy.c optional joy device-driver diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 606c39e..daee5ca 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.23 1997/05/30 09:57:08 kato Exp $ + * $Id: clock.c,v 1.24 1997/05/31 12:43:17 kato Exp $ */ /* @@ -76,7 +76,7 @@ #include <i386/isa/isa_device.h> #else #include <i386/isa/isa.h> -#include <i386/isa/isa_device.h> +#include <i386/isa/intr_machdep.h> #include <i386/isa/rtc.h> #endif #include <i386/isa/timerreg.h> diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 606c39e..daee5ca 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.23 1997/05/30 09:57:08 kato Exp $ + * $Id: clock.c,v 1.24 1997/05/31 12:43:17 kato Exp $ */ /* @@ -76,7 +76,7 @@ #include <i386/isa/isa_device.h> #else #include <i386/isa/isa.h> -#include <i386/isa/isa_device.h> +#include <i386/isa/intr_machdep.h> #include <i386/isa/rtc.h> #endif #include <i386/isa/timerreg.h> diff --git a/sys/pc98/conf/files.pc98 b/sys/pc98/conf/files.pc98 index c1f9c95..b3133d7 100644 --- a/sys/pc98/conf/files.pc98 +++ b/sys/pc98/conf/files.pc98 @@ -3,7 +3,7 @@ # # modified for PC-9801 # -# $Id: files.pc98,v 1.25 1997/05/31 12:39:57 kato Exp $ +# $Id: files.pc98,v 1.26 1997/06/02 09:22:55 kato Exp $ # aic7xxx_asm optional ahc device-driver \ dependency "$S/dev/aic7xxx/*.[chyl]" \ @@ -134,6 +134,7 @@ i386/isa/if_wl.c optional wl device-driver i386/isa/if_zp.c optional zp device-driver i386/isa/ipl_funcs.c standard \ compile-with "${CC} -c ${CFLAGS} ${PROF:S/^$/-fomit-frame-pointer/} $<" +i386/isa/intr_machdep.c standard pc98/pc98/pc98.c optional isa device-driver pc98/isa/istallion.c optional stli device-driver pc98/isa/joy.c optional joy device-driver diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index f267033..3db20f5 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.41 1997/05/23 10:17:05 kato Exp $ + * $Id: machdep.c,v 1.42 1997/05/28 09:16:19 kato Exp $ */ #include "npx.h" @@ -117,6 +117,7 @@ #endif #include <i386/isa/isa_device.h> +#include <i386/isa/intr_machdep.h> #ifdef PC98 #include <pc98/pc98/pc98_machdep.h> #else diff --git a/sys/pc98/i386/trap.c b/sys/pc98/i386/trap.c index e1ffa68..34b5972 100644 --- a/sys/pc98/i386/trap.c +++ b/sys/pc98/i386/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.21 1997/05/30 09:59:11 kato Exp $ + * $Id: trap.c,v 1.22 1997/05/31 12:43:11 kato Exp $ */ /* @@ -76,7 +76,7 @@ #include <machine/psl.h> #include <machine/reg.h> #include <machine/trap.h> -#include <machine/../isa/isa_device.h> +#include <machine/../isa/intr_machdep.h> #include <machine/smp.h> #ifdef POWERFAIL_NMI diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c index 606c39e..daee5ca 100644 --- a/sys/pc98/pc98/clock.c +++ b/sys/pc98/pc98/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.23 1997/05/30 09:57:08 kato Exp $ + * $Id: clock.c,v 1.24 1997/05/31 12:43:17 kato Exp $ */ /* @@ -76,7 +76,7 @@ #include <i386/isa/isa_device.h> #else #include <i386/isa/isa.h> -#include <i386/isa/isa_device.h> +#include <i386/isa/intr_machdep.h> #include <i386/isa/rtc.h> #endif #include <i386/isa/timerreg.h> diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index f267033..3db20f5 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.41 1997/05/23 10:17:05 kato Exp $ + * $Id: machdep.c,v 1.42 1997/05/28 09:16:19 kato Exp $ */ #include "npx.h" @@ -117,6 +117,7 @@ #endif #include <i386/isa/isa_device.h> +#include <i386/isa/intr_machdep.h> #ifdef PC98 #include <pc98/pc98/pc98_machdep.h> #else diff --git a/sys/pc98/pc98/npx.c b/sys/pc98/pc98/npx.c index 74d4b97..19282fd 100644 --- a/sys/pc98/pc98/npx.c +++ b/sys/pc98/pc98/npx.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 - * $Id: npx.c,v 1.18 1997/05/08 09:19:56 kato Exp $ + * $Id: npx.c,v 1.19 1997/05/31 12:43:17 kato Exp $ */ #include "npx.h" @@ -69,7 +69,7 @@ #include <i386/isa/icu.h> #include <i386/isa/isa_device.h> - +#include <i386/isa/intr_machdep.h> #ifdef PC98 #include <pc98/pc98/pc98.h> #else diff --git a/sys/pc98/pc98/pc98.c b/sys/pc98/pc98/pc98.c index edd9724..1bb6da23 100644 --- a/sys/pc98/pc98/pc98.c +++ b/sys/pc98/pc98/pc98.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: pc98.c,v 1.28 1997/05/30 10:05:56 kato Exp $ + * $Id: pc98.c,v 1.29 1997/05/31 12:43:17 kato Exp $ */ /* @@ -52,8 +52,6 @@ * Kyoto University Microcomputer Club (KMC) */ -#include "opt_auto_eoi.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/buf.h> @@ -70,6 +68,7 @@ #include <vm/vm_param.h> #include <vm/pmap.h> #include <i386/isa/isa_device.h> +#include <i386/isa/intr_machdep.h> #ifdef PC98 #include <machine/cpufunc.h> #include <pc98/pc98/pc98.h> @@ -84,14 +83,6 @@ #include <sys/interrupt.h> -#ifdef APIC_IO -/* - * This is to accommodate "mixed-mode" programming for - * motherboards that don't connect the 8254 to the IO APIC. - */ -#define AUTO_EOI_1 -#endif - /* ** Register definitions for DMA controller 1 (channels 0..3): */ @@ -115,40 +106,6 @@ #define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */ #define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */ -u_long *intr_countp[ICU_LEN]; -inthand2_t *intr_handler[ICU_LEN]; -u_int intr_mask[ICU_LEN]; -u_int* intr_mptr[ICU_LEN]; -int intr_unit[ICU_LEN]; - -static inthand_t *fastintr[ICU_LEN] = { - &IDTVEC(fastintr0), &IDTVEC(fastintr1), - &IDTVEC(fastintr2), &IDTVEC(fastintr3), - &IDTVEC(fastintr4), &IDTVEC(fastintr5), - &IDTVEC(fastintr6), &IDTVEC(fastintr7), - &IDTVEC(fastintr8), &IDTVEC(fastintr9), - &IDTVEC(fastintr10), &IDTVEC(fastintr11), - &IDTVEC(fastintr12), &IDTVEC(fastintr13), - &IDTVEC(fastintr14), &IDTVEC(fastintr15) -#if defined(APIC_IO) - , &IDTVEC(fastintr16), &IDTVEC(fastintr17), - &IDTVEC(fastintr18), &IDTVEC(fastintr19), - &IDTVEC(fastintr20), &IDTVEC(fastintr21), - &IDTVEC(fastintr22), &IDTVEC(fastintr23) -#endif /* APIC_IO */ -}; - -static inthand_t *slowintr[ICU_LEN] = { - &IDTVEC(intr0), &IDTVEC(intr1), &IDTVEC(intr2), &IDTVEC(intr3), - &IDTVEC(intr4), &IDTVEC(intr5), &IDTVEC(intr6), &IDTVEC(intr7), - &IDTVEC(intr8), &IDTVEC(intr9), &IDTVEC(intr10), &IDTVEC(intr11), - &IDTVEC(intr12), &IDTVEC(intr13), &IDTVEC(intr14), &IDTVEC(intr15) -#if defined(APIC_IO) - , &IDTVEC(intr16), &IDTVEC(intr17), &IDTVEC(intr18), &IDTVEC(intr19), - &IDTVEC(intr20), &IDTVEC(intr21), &IDTVEC(intr22), &IDTVEC(intr23) -#endif /* APIC_IO */ -}; - static void config_isadev __P((struct isa_device *isdp, u_int *mp)); static void config_isadev_c __P((struct isa_device *isdp, u_int *mp, int reconfig)); @@ -158,8 +115,6 @@ static void conflict __P((struct isa_device *dvp, struct isa_device *tmpdvp, static int haveseen __P((struct isa_device *dvp, struct isa_device *tmpdvp, u_int checkbits)); static int isa_dmarangecheck __P((caddr_t va, u_int length, int chan)); -static inthand2_t isa_strayintr; -static void register_imask __P((struct isa_device *dvp, u_int mask)); /* * print a conflict message @@ -638,64 +593,6 @@ config_isadev_c(isdp, mp, reconfig) } } -/* - * Fill in default interrupt table (in case of spuruious interrupt - * during configuration of kernel, setup interrupt control unit - */ -void -isa_defaultirq() -{ - int i; - - /* icu vectors */ - for (i = 0; i < ICU_LEN; i++) - icu_unset(i, (inthand2_t *)NULL); - - /* initialize 8259's */ -#ifdef PC98 - outb(IO_ICU1, 0x11); /* reset; program device, four bytes */ - outb(IO_ICU1+2, NRSVIDT); /* starting at this vector index */ - outb(IO_ICU1+2, 1<<7); /* slave on line 7 */ -#ifdef AUTO_EOI_1 - outb(IO_ICU1+2, 0x1f); /* (master) auto EOI, 8086 mode */ -#else - outb(IO_ICU1+2, 0x1d); /* (master) 8086 mode */ -#endif - outb(IO_ICU1+2, 0xff); /* leave interrupts masked */ - outb(IO_ICU1, 0x0a); /* default to IRR on read */ - - outb(IO_ICU2, 0x11); /* reset; program device, four bytes */ - outb(IO_ICU2+2, NRSVIDT+8); /* staring at this vector index */ - outb(IO_ICU2+2,7); /* my slave id is 7 */ - outb(IO_ICU2+2,9); /* 8086 mode */ - outb(IO_ICU2+2, 0xff); /* leave interrupts masked */ - outb(IO_ICU2, 0x0a); /* default to IRR on read */ -#else - outb(IO_ICU1, 0x11); /* reset; program device, four bytes */ - outb(IO_ICU1+1, NRSVIDT); /* starting at this vector index */ - outb(IO_ICU1+1, 1<<2); /* slave on line 2 */ -#ifdef AUTO_EOI_1 - outb(IO_ICU1+1, 2 | 1); /* auto EOI, 8086 mode */ -#else - outb(IO_ICU1+1, 1); /* 8086 mode */ -#endif - outb(IO_ICU1+1, 0xff); /* leave interrupts masked */ - outb(IO_ICU1, 0x0a); /* default to IRR on read */ - outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */ - - outb(IO_ICU2, 0x11); /* reset; program device, four bytes */ - outb(IO_ICU2+1, NRSVIDT+8); /* staring at this vector index */ - outb(IO_ICU2+1,2); /* my slave id is 2 */ -#ifdef AUTO_EOI_2 - outb(IO_ICU2+1, 2 | 1); /* auto EOI, 8086 mode */ -#else - outb(IO_ICU2+1,1); /* 8086 mode */ -#endif - outb(IO_ICU2+1, 0xff); /* leave interrupts masked */ - outb(IO_ICU2, 0x0a); /* default to IRR on read */ -#endif -} - #ifdef PC98 static caddr_t dma_bouncebuf[4]; static u_int dma_bouncebufsize[4]; @@ -1032,89 +929,6 @@ isa_dmarangecheck(caddr_t va, u_int length, int chan) { return (0); } -#ifdef PC98 -#define NMI_PARITY 0x04 -#define NMI_EPARITY 0x02 -#else -#define NMI_PARITY (1 << 7) -#define NMI_IOCHAN (1 << 6) -#define ENMI_WATCHDOG (1 << 7) -#define ENMI_BUSTIMER (1 << 6) -#define ENMI_IOSTATUS (1 << 5) -#endif - -/* - * Handle a NMI, possibly a machine check. - * return true to panic system, false to ignore. - */ -int -isa_nmi(cd) - int cd; -{ -#ifdef PC98 - int port = inb(0x33); - if (epson_machine_id == 0x20) - epson_outb(0xc16, epson_inb(0xc16) | 0x1); - if (port & NMI_PARITY) { - panic("BASE RAM parity error, likely hardware failure."); - } else if (port & NMI_EPARITY) { - panic("EXTENDED RAM parity error, likely hardware failure."); - } else { - printf("\nNMI Resume ??\n"); - return(0); - } -#else /* IBM-PC */ - int isa_port = inb(0x61); - int eisa_port = inb(0x461); - if(isa_port & NMI_PARITY) { - panic("RAM parity error, likely hardware failure."); - } else if(isa_port & NMI_IOCHAN) { - panic("I/O channel check, likely hardware failure."); - } else if(eisa_port & ENMI_WATCHDOG) { - panic("EISA watchdog timer expired, likely hardware failure."); - } else if(eisa_port & ENMI_BUSTIMER) { - panic("EISA bus timeout, likely hardware failure."); - } else if(eisa_port & ENMI_IOSTATUS) { - panic("EISA I/O port status error."); - } else { - printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); - return(0); - } -#endif -} - -/* - * Caught a stray interrupt, notify - */ -static void -isa_strayintr(d) - int d; -{ - - /* DON'T BOTHER FOR NOW! */ - /* for some reason, we get bursts of intr #7, even if not enabled! */ - /* - * Well the reason you got bursts of intr #7 is because someone - * raised an interrupt line and dropped it before the 8259 could - * prioritize it. This is documented in the intel data book. This - * means you have BAD hardware! I have changed this so that only - * the first 5 get logged, then it quits logging them, and puts - * out a special message. rgrimes 3/25/1993 - */ - /* - * XXX TODO print a different message for #7 if it is for a - * glitch. Glitches can be distinguished from real #7's by - * testing that the in-service bit is _not_ set. The test - * must be done before sending an EOI so it can't be done if - * we are using AUTO_EOI_1. - */ - if (intrcnt[NR_DEVICES + d] <= 5) - log(LOG_ERR, "stray irq %d\n", d); - if (intrcnt[NR_DEVICES + d] == 5) - log(LOG_CRIT, - "too many stray irq %d's; not logging any more\n", d); -} - /* * Find the highest priority enabled display device. Since we can't * distinguish display devices from ttys, depend on display devices @@ -1162,215 +976,3 @@ struct isa_device *find_isadev(table, driverp, unit) return (table); } -/* - * Return nonzero if a (masked) irq is pending for a given device. - */ -#if defined(APIC_IO) - -int -isa_irq_pending(dvp) - struct isa_device *dvp; -{ - /* read APIC IRR containing the 16 ISA INTerrupts */ - return ((lapic__irr1 & 0x00ffffff) - & (u_int32_t)dvp->id_irq) ? 1 : 0; -} - -/* - * an 8259 specific routine, - * for use by boot probes in certain device drivers. - */ -int -icu_irq_pending(dvp) - struct isa_device *dvp; -{ - unsigned id_irq; - id_irq = dvp->id_irq; - if (id_irq & 0xff) - return (inb(IO_ICU1) & id_irq); - return (inb(IO_ICU2) & (id_irq >> 8)); -} - -#else /* APIC_IO */ - -int -isa_irq_pending(dvp) - struct isa_device *dvp; -{ - unsigned id_irq; - - id_irq = dvp->id_irq; - if (id_irq & 0xff) - return (inb(IO_ICU1) & id_irq); - return (inb(IO_ICU2) & (id_irq >> 8)); -} - -#endif /* APIC_IO */ - -int -update_intr_masks(void) -{ - int intr, n=0; - u_int mask,*maskptr; - - for (intr=0; intr < ICU_LEN; intr ++) { -#if defined(APIC_IO) - /* no 8259 SLAVE to ignore */ -#else -#ifdef PC98 - if (intr==7) continue; /* ignore 8259 SLAVE output */ -#else - if (intr==2) continue; /* ignore 8259 SLAVE output */ -#endif -#endif /* APIC_IO */ - maskptr = intr_mptr[intr]; - if (!maskptr) continue; - *maskptr |= 1 << intr; - mask = *maskptr; - if (mask != intr_mask[intr]) { -#if 0 - printf ("intr_mask[%2d] old=%08x new=%08x ptr=%p.\n", - intr, intr_mask[intr], mask, maskptr); -#endif - intr_mask[intr]=mask; - n++; - } - - } - return (n); -} - -/* - * The find_device_id function is only required because of the way the - * device names are currently stored for reporting in systat or vmstat. - * In fact, those programs should be modified to use the sysctl interface - * to obtain a list of driver names by traversing intreclist_head[irq]. - */ - -static int -find_device_id(int irq) -{ - char buf[16]; - char *cp; - int free_id, id; - - sprintf(buf, "pci irq%d", irq); - cp = intrnames; - /* default to 0, which corresponds to clk0 */ - free_id = 0; - - for (id = 0; id < NR_DEVICES; id++) { - if (strcmp(cp, buf) == 0) - return (id); - if (free_id == 0 && strcmp(cp, "pci irqnn") == 0) - free_id = id; - while (*cp++ != '\0'); - } -#if 0 - if (free_id == 0) { - /* - * All pci irq counters are in use, perhaps because config - * is old so there aren't any. Abuse the clk0 counter. - */ - printf("\tcounting shared irq%d as clk0 irq\n", irq); - } -#endif - return (free_id); -} - -void -update_intrname(int intr, int device_id) -{ - char *cp; - int id; - - if (device_id == -1) - device_id = find_device_id(intr); - - if ((u_int)device_id >= NR_DEVICES) - return; - - intr_countp[intr] = &intrcnt[device_id]; - - for (cp = intrnames, id = 0; id <= device_id; id++) - while (*cp++ != '\0') - ; - if (cp > eintrnames) - return; - if (intr < 10) { - cp[-3] = intr + '0'; - cp[-2] = ' '; - } else if (intr < 20) { - cp[-3] = '1'; - cp[-2] = intr - 10 + '0'; - } else { - cp[-3] = '2'; - cp[-2] = intr - 20 + '0'; - } -} - -int -icu_setup(int intr, inthand2_t *handler, void *arg, u_int *maskptr, int flags) -{ - u_long ef; - u_int mask = (maskptr ? *maskptr : 0); - -#if defined(APIC_IO) - if ((u_int)intr >= ICU_LEN) /* no 8259 SLAVE to ignore */ -#else - if ((u_int)intr >= ICU_LEN || intr == 2) -#endif /* APIC_IO */ - if (intr_handler[intr] != isa_strayintr) - return (EBUSY); - - ef = read_eflags(); - disable_intr(); - intr_handler[intr] = handler; - intr_mptr[intr] = maskptr; - intr_mask[intr] = mask | (1 << intr); - intr_unit[intr] = arg; - setidt(ICU_OFFSET + intr, - flags & RI_FAST ? fastintr[intr] : slowintr[intr], - SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - INTREN(1 << intr); - write_eflags(ef); - return (0); -} - -static void -register_imask(dvp, mask) - struct isa_device *dvp; - u_int mask; -{ - if (dvp->id_alive && dvp->id_irq) { - int intr; - - intr = ffs(dvp->id_irq) - 1; - intr_mask[intr] = mask | (1 <<intr); - } - (void) update_intr_masks(); -} - -int -icu_unset(intr, handler) - int intr; - inthand2_t *handler; -{ - u_long ef; - - if ((u_int)intr >= ICU_LEN || handler != intr_handler[intr]) - return (EINVAL); - - INTRDIS(1 << intr); - ef = read_eflags(); - disable_intr(); - intr_countp[intr] = &intrcnt[NR_DEVICES + intr]; - intr_handler[intr] = isa_strayintr; - intr_mptr[intr] = NULL; - intr_mask[intr] = HWI_MASK | SWI_MASK; - intr_unit[intr] = intr; - setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); - write_eflags(ef); - return (0); -} |