--- p4_head/sys/amd64/amd64/intr_machdep.c Sun Jan 21 15:14:57 2007 +++ p4_head_intr/sys/amd64/amd64/intr_machdep.c Fri Jan 26 13:54:07 2007 @@ -158,8 +158,8 @@ } int -intr_add_handler(const char *name, int vector, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep) +intr_add_handler(const char *name, int vector, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep) { struct intsrc *isrc; int error; @@ -167,8 +167,8 @@ isrc = intr_lookup_source(vector); if (isrc == NULL) return (EINVAL); - error = intr_event_add_handler(isrc->is_event, name, handler, arg, - intr_priority(flags), flags, cookiep); + error = intr_event_add_handler(isrc->is_event, name, filter, handler, + arg, intr_priority(flags), flags, cookiep); if (error == 0) { intrcnt_updatename(isrc); mtx_lock_spin(&intr_table_lock); @@ -266,7 +266,7 @@ thread = 0; critical_enter(); TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) { + if (ih->ih_filter == NULL) { thread = 1; continue; } @@ -274,9 +274,9 @@ ih->ih_handler, ih->ih_argument == NULL ? frame : ih->ih_argument, ih->ih_name); if (ih->ih_argument == NULL) - ih->ih_handler(frame); + ih->ih_filter(frame); else - ih->ih_handler(ih->ih_argument); + ih->ih_filter(ih->ih_argument); } /* --- p4_head/sys/amd64/amd64/nexus.c Sun Jan 21 15:14:58 2007 +++ p4_head_intr/sys/amd64/amd64/nexus.c Fri Jan 26 13:54:07 2007 @@ -95,7 +95,8 @@ static int nexus_release_resource(device_t, device_t, int, int, struct resource *); static int nexus_setup_intr(device_t, device_t, struct resource *, int flags, - void (*)(void *), void *, void **); + driver_filter_t filter, void (*)(void *), void *, + void **); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); static struct resource_list *nexus_get_reslist(device_t dev, device_t child); @@ -415,7 +416,8 @@ */ static int nexus_setup_intr(device_t bus, device_t child, struct resource *irq, - int flags, void (*ihand)(void *), void *arg, void **cookiep) + int flags, driver_filter_t filter, void (*ihand)(void *), + void *arg, void **cookiep) { int error; @@ -435,7 +437,7 @@ return (error); error = intr_add_handler(device_get_nameunit(child), - rman_get_start(irq), ihand, arg, flags, cookiep); + rman_get_start(irq), filter, ihand, arg, flags, cookiep); return (error); } --- p4_head/sys/amd64/include/intr_machdep.h Sun Jan 21 15:14:59 2007 +++ p4_head_intr/sys/amd64/include/intr_machdep.h Fri Jan 26 13:54:07 2007 @@ -135,8 +135,9 @@ #else #define intr_add_cpu(apic_id) #endif -int intr_add_handler(const char *name, int vector, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep); +int intr_add_handler(const char *name, int vector, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, + void **cookiep); int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); --- p4_head/sys/amd64/isa/clock.c Sun Jan 21 15:15:00 2007 +++ p4_head_intr/sys/amd64/isa/clock.c Fri Jan 26 13:54:07 2007 @@ -140,7 +140,7 @@ 0 /* quality */ }; -static void +static int clkintr(struct trapframe *frame) { @@ -157,6 +157,7 @@ } KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + return (FILTER_HANDLED); } int @@ -211,11 +212,13 @@ * Stat clock ticks can still be lost, causing minor loss of accuracy * in the statistics, but the stat clock will no longer stop. */ -static void +static int rtcintr(struct trapframe *frame) { + int flag = 0; while (rtcin(RTC_INTR) & RTCIR_PERIOD) { + flag = 1; if (profprocs != 0) { if (--pscnt == 0) pscnt = psdiv; @@ -224,6 +227,7 @@ if (pscnt == psdiv) statclock(TRAPF_USERMODE(frame)); } + return(flag ? FILTER_HANDLED : FILTER_STRAY); } #include "opt_ddb.h" @@ -761,8 +765,8 @@ * timecounter to user a simpler algorithm. */ if (!using_lapic_timer) { - intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL, - INTR_TYPE_CLK | INTR_FAST, NULL); + intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, + INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); if (i8254_intsrc != NULL) i8254_pending = @@ -795,8 +799,8 @@ /* Enable periodic interrupts from the RTC. */ rtc_statusb |= RTCSB_PINTR; - intr_add_handler("rtc", 8, (driver_intr_t *)rtcintr, NULL, - INTR_TYPE_CLK | INTR_FAST, NULL); + intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL, + INTR_TYPE_CLK, NULL); writertc(RTC_STATUSB, rtc_statusb); rtcin(RTC_INTR); --- p4_head/sys/amd64/isa/isa.c Sun Jan 21 15:15:01 2007 +++ p4_head_intr/sys/amd64/isa/isa.c Fri Jan 26 13:54:07 2007 @@ -147,10 +147,11 @@ */ int isa_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t *filter, void (*ihand)(void *), void *arg, + void **cookiep) { return (BUS_SETUP_INTR(device_get_parent(bus), child, r, flags, - ihand, arg, cookiep)); + filter, ihand, arg, cookiep)); } int --- p4_head/sys/arm/arm/intr.c Sun Jan 21 15:15:03 2007 +++ p4_head_intr/sys/arm/arm/intr.c Fri Jan 26 13:54:07 2007 @@ -58,8 +58,8 @@ void arm_handler_execute(struct trapframe *, int); void -arm_setup_irqhandler(const char *name, void (*hand)(void*), void *arg, - int irq, int flags, void **cookiep) +arm_setup_irqhandler(const char *name, driver_filter_t *filt, + void (*hand)(void*), void *arg, int irq, int flags, void **cookiep) { struct intr_event *event; int error; @@ -82,7 +82,7 @@ intrcnt_index++; } - intr_event_add_handler(event, name, hand, arg, + intr_event_add_handler(event, name, filt, hand, arg, intr_priority(flags), flags, cookiep); } @@ -118,10 +118,10 @@ /* Execute fast handlers. */ thread = 0; TAILQ_FOREACH(ih, &event->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) + if (ih->ih_filter == NULL) thread = 1; else - ih->ih_handler(ih->ih_argument ? + ih->ih_filter(ih->ih_argument ? ih->ih_argument : frame); } --- p4_head/sys/arm/arm/nexus.c Sun Jan 21 15:15:03 2007 +++ p4_head_intr/sys/arm/arm/nexus.c Fri Jan 26 13:54:07 2007 @@ -81,7 +81,7 @@ struct resource *); static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_intr_t *intr, void *arg, void **cookiep); + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); @@ -125,13 +125,13 @@ static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_intr_t *intr, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { int i; for (i = rman_get_start(res); i <= rman_get_end(res); i++) arm_setup_irqhandler(device_get_nameunit(child), - intr, arg, i, flags, cookiep); + filt, intr, arg, i, flags, cookiep); return (0); } --- p4_head/sys/arm/at91/at91.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91.c Fri Jan 26 13:54:07 2007 @@ -543,14 +543,14 @@ static int at91_setup_intr(device_t dev, device_t child, - struct resource *ires, int flags, driver_intr_t *intr, void *arg, - void **cookiep) + struct resource *ires, int flags, driver_filter_t *filt, + driver_intr_t *intr, void *arg, void **cookiep) { struct at91_softc *sc = device_get_softc(dev); if (rman_get_start(ires) == AT91RM92_IRQ_SYSTEM && !(flags & INTR_FAST)) panic("All system interrupt ISRs must be type INTR_FAST"); - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg, + BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg, cookiep); bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_IECR, 1 << rman_get_start(ires)); --- p4_head/sys/arm/at91/at91_mci.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91_mci.c Fri Jan 26 13:54:07 2007 @@ -192,7 +192,7 @@ * Activate the interrupt */ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - at91_mci_intr, sc, &sc->intrhand); + NULL, at91_mci_intr, sc, &sc->intrhand); if (err) { AT91_MCI_LOCK_DESTROY(sc); goto out; --- p4_head/sys/arm/at91/at91_pio.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91_pio.c Fri Jan 26 13:54:07 2007 @@ -83,7 +83,7 @@ static int at91_pio_probe(device_t dev); static int at91_pio_attach(device_t dev); static int at91_pio_detach(device_t dev); -static void at91_pio_intr(void *); +static int at91_pio_intr(void *); /* helper routines */ static int at91_pio_activate(device_t dev); @@ -148,8 +148,8 @@ * Activate the interrupt, but disable all interrupts in the hardware */ WR4(sc, PIO_IDR, 0xffffffff); - err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_FAST, - at91_pio_intr, sc, &sc->intrhand); + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, + at91_pio_intr, NULL, sc, &sc->intrhand); if (err) { AT91_PIO_LOCK_DESTROY(sc); goto out; @@ -217,7 +217,7 @@ return; } -static void +static int at91_pio_intr(void *xsc) { struct at91_pio_softc *sc = xsc; @@ -232,7 +232,7 @@ AT91_PIO_UNLOCK(sc); #endif wakeup(sc); - return; + return (FILTER_HANDLED); } static int --- p4_head/sys/arm/at91/at91_rtc.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91_rtc.c Fri Jan 26 13:54:07 2007 @@ -110,8 +110,8 @@ * Activate the interrupt, but disable all interrupts in the hardware */ WR4(sc, RTC_IDR, 0xffffffff); - err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_FAST, - at91_rtc_intr, sc, &sc->intrhand); + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, + at91_rtc_intr, NULL, sc, &sc->intrhand); if (err) { AT91_RTC_LOCK_DESTROY(sc); goto out; @@ -173,7 +173,7 @@ return; } -static void +static int at91_rtc_intr(void *xsc) { struct at91_rtc_softc *sc = xsc; @@ -188,7 +188,7 @@ AT91_RTC_UNLOCK(sc); #endif wakeup(sc); - return; + return (FILTER_HANDLED); } /* --- p4_head/sys/arm/at91/at91_spi.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91_spi.c Fri Jan 26 13:54:07 2007 @@ -163,7 +163,7 @@ if (sc->irq_res == NULL) goto errout; err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - at91_spi_intr, sc, &sc->intrhand); + NULL, at91_spi_intr, sc, &sc->intrhand); if (err != 0) goto errout; return (0); --- p4_head/sys/arm/at91/at91_ssc.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91_ssc.c Fri Jan 26 13:54:07 2007 @@ -124,7 +124,7 @@ * Activate the interrupt */ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - at91_ssc_intr, sc, &sc->intrhand); + NULL, at91_ssc_intr, sc, &sc->intrhand); if (err) { AT91_SSC_LOCK_DESTROY(sc); goto out; --- p4_head/sys/arm/at91/at91_st.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91_st.c Fri Jan 26 13:54:07 2007 @@ -183,7 +183,7 @@ WR4(ST_CR, ST_CR_WDRST); } -static void +static int clock_intr(void *arg) { struct trapframe *fp = arg; @@ -194,7 +194,9 @@ tot_count += 32768 / hz; #endif hardclock(TRAPF_USERMODE(fp), TRAPF_PC(fp)); + return (FILTER_HANDLED); } + return (FILTER_STRAY); } void @@ -222,8 +224,8 @@ if (!irq) panic("Unable to allocate irq for the system timer"); else - bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST, - clock_intr, NULL, &ih); + bus_setup_intr(dev, irq, INTR_TYPE_CLK, + clock_intr, NULL, NULL, &ih); WR4(ST_PIMR, rel_value); --- p4_head/sys/arm/at91/at91_twi.c Sun Jan 21 15:15:04 2007 +++ p4_head_intr/sys/arm/at91/at91_twi.c Fri Jan 26 13:54:07 2007 @@ -118,7 +118,7 @@ * Activate the interrupt */ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - at91_twi_intr, sc, &sc->intrhand); + NULL, at91_twi_intr, sc, &sc->intrhand); if (err) { AT91_TWI_LOCK_DESTROY(sc); goto out; --- p4_head/sys/arm/at91/if_ate.c Sun Jan 21 15:15:05 2007 +++ p4_head_intr/sys/arm/at91/if_ate.c Fri Jan 26 13:54:07 2007 @@ -225,7 +225,7 @@ * Activate the interrupt */ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - ate_intr, sc, &sc->intrhand); + NULL, ate_intr, sc, &sc->intrhand); if (err) { ether_ifdetach(ifp); ATE_LOCK_DESTROY(sc); --- p4_head/sys/arm/include/intr.h Sun Jan 21 15:15:06 2007 +++ p4_head_intr/sys/arm/include/intr.h Fri Jan 26 13:54:07 2007 @@ -50,7 +50,7 @@ int arm_get_next_irq(void); void arm_mask_irq(uintptr_t); void arm_unmask_irq(uintptr_t); -void arm_setup_irqhandler(const char *, void (*)(void*), void *, int, int, - void **); +void arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*), + void *, int, int, void **); int arm_remove_irqhandler(void *); #endif /* _MACHINE_INTR_H */ --- p4_head/sys/arm/sa11x0/sa11x0.c Sun Jan 21 15:15:06 2007 +++ p4_head_intr/sys/arm/sa11x0/sa11x0.c Fri Jan 26 13:54:07 2007 @@ -91,14 +91,14 @@ static int sa1110_activate_resource(device_t, device_t, int, int, struct resource *); static int sa1110_setup_intr(device_t, device_t, struct resource *, int, - driver_intr_t *, void *, void **); + driver_filter_t *, driver_intr_t *, void *, void **); struct sa11x0_softc *sa11x0_softc; /* There can be only one. */ static int sa1110_setup_intr(device_t dev, device_t child, - struct resource *ires, int flags, driver_intr_t *intr, void *arg, - void **cookiep) + struct resource *ires, int flags, driver_filter_t *filt, + driver_intr_t *intr, void *arg, void **cookiep) { int saved_cpsr; @@ -113,7 +113,7 @@ saved_cpsr = SetCPSR(I32_bit, I32_bit); SetCPSR(I32_bit, saved_cpsr & I32_bit); - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg, + BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg, cookiep); return (0); } --- p4_head/sys/arm/sa11x0/sa11x0_ost.c Sun Jan 21 15:15:06 2007 +++ p4_head_intr/sys/arm/sa11x0/sa11x0_ost.c Fri Jan 26 13:54:07 2007 @@ -67,9 +67,9 @@ static int saost_attach(device_t); int gettick(void); -static void clockintr(void *); +static int clockintr(void *); #if 0 -static void statintr(void *); +static int statintr(void *); #endif void rtcinit(void); @@ -141,7 +141,7 @@ } -static void +static int clockintr(arg) void *arg; { @@ -184,10 +184,11 @@ #if 0 mtx_unlock_spin(&clock_lock); #endif + return (FILTER_HANDLED); } #if 0 -static void +static int statintr(arg) void *arg; { @@ -227,7 +228,7 @@ saost_sc->sc_statclock_count = nextmatch; statclock(TRAPF_USERMODE(frame)); - + return (FILTER_HANDLED); } #endif @@ -271,10 +272,10 @@ rid = 1; irq2 = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); - bus_setup_intr(dev, irq1, INTR_TYPE_CLK | INTR_FAST, clockintr, NULL, + bus_setup_intr(dev, irq1, INTR_TYPE_CLK, clockintr, NULL, NULL, &ih1); #if 0 - bus_setup_intr(dev, irq2, INTR_TYPE_CLK | INTR_FAST, statintr, NULL + bus_setup_intr(dev, irq2, INTR_TYPE_CLK, statintr, NULL, NULL, ,&ih2); #endif bus_space_write_4(saost_sc->sc_iot, saost_sc->sc_ioh, SAOST_SR, 0xf); --- p4_head/sys/arm/xscale/i80321/i80321_pci.c Sun Jan 21 15:15:07 2007 +++ p4_head_intr/sys/arm/xscale/i80321/i80321_pci.c Fri Jan 26 13:54:07 2007 @@ -346,11 +346,11 @@ static int i80321_pci_setup_intr(device_t dev, device_t child, - struct resource *ires, int flags, driver_intr_t *intr, void *arg, - void **cookiep) + struct resource *ires, int flags, driver_filter_t *filt, + driver_intr_t *intr, void *arg, void **cookiep) { return (BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, - intr, arg, cookiep)); + filt, intr, arg, cookiep)); } static int --- p4_head/sys/arm/xscale/i80321/i80321_timer.c Sun Jan 21 15:15:07 2007 +++ p4_head_intr/sys/arm/xscale/i80321/i80321_timer.c Fri Jan 26 13:54:07 2007 @@ -133,7 +133,7 @@ DRIVER_MODULE(itimer, iq, i80321_timer_driver, i80321_timer_devclass, 0, 0); -void clockhandler(void *); +int clockhandler(void *); static __inline uint32_t @@ -336,8 +336,8 @@ if (!irq) panic("Unable to setup the clock irq handler.\n"); else - bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST, - clockhandler, NULL, &ihl); + bus_setup_intr(dev, irq, INTR_TYPE_CLK, clockhandler, NULL, + NULL, &ihl); tmr0_write(0); /* stop timer */ tisr_write(TISR_TMR0); /* clear interrupt */ @@ -401,7 +401,7 @@ * * Handle the hardclock interrupt. */ -void +int clockhandler(void *arg) { struct trapframe *frame = arg; @@ -412,7 +412,7 @@ if (i80321_hardclock_hook != NULL) (*i80321_hardclock_hook)(); - return; + return (FILTER_HANDLED); } void --- p4_head/sys/arm/xscale/i80321/iq80321.c Sun Jan 21 15:15:07 2007 +++ p4_head_intr/sys/arm/xscale/i80321/iq80321.c Fri Jan 26 13:54:07 2007 @@ -351,11 +351,11 @@ static int iq80321_setup_intr(device_t dev, device_t child, - struct resource *ires, int flags, driver_intr_t *intr, void *arg, - void **cookiep) + struct resource *ires, int flags, driver_filter_t *filt, + driver_intr_t *intr, void *arg, void **cookiep) { - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg, - cookiep); + BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, + arg, cookiep); intr_enabled |= 1 << rman_get_start(ires); i80321_set_intrmask(); --- p4_head/sys/arm/xscale/ixp425/ixp425.c Sun Jan 21 15:15:07 2007 +++ p4_head_intr/sys/arm/xscale/ixp425/ixp425.c Fri Jan 26 13:54:07 2007 @@ -310,8 +310,8 @@ static int ixp425_setup_intr(device_t dev, device_t child, - struct resource *ires, int flags, driver_intr_t *intr, void *arg, - void **cookiep) + struct resource *ires, int flags, driver_filter_t *filt, + driver_intr_t *intr, void *arg, void **cookiep) { uint32_t mask; int i; @@ -324,8 +324,8 @@ rman_set_start(ires, IXP425_INT_UART1); rman_set_end(ires, rman_get_start(ires)); } - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg, - cookiep); + BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, + arg, cookiep); mask = 0; for (i = rman_get_start(ires); i <= rman_get_end(ires); i++) --- p4_head/sys/arm/xscale/ixp425/ixp425_npe.c Sun Jan 21 15:15:08 2007 +++ p4_head_intr/sys/arm/xscale/ixp425/ixp425_npe.c Fri Jan 26 13:54:07 2007 @@ -291,7 +291,7 @@ panic("%s: Unable to allocate irq %u", device_get_name(dev), irq); /* XXX could be a source of entropy */ bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - ixpnpe_intr, sc, &sc->sc_ih); + NULL, ixpnpe_intr, sc, &sc->sc_ih); /* enable output fifo interrupts (NB: must also set OFIFO Write Enable) */ npe_reg_write(sc, IX_NPECTL, npe_reg_read(sc, IX_NPECTL) | (IX_NPECTL_OFE | IX_NPECTL_OFWE)); --- p4_head/sys/arm/xscale/ixp425/ixp425_pci.c Sun Jan 21 15:15:08 2007 +++ p4_head_intr/sys/arm/xscale/ixp425/ixp425_pci.c Fri Jan 26 13:54:07 2007 @@ -254,11 +254,11 @@ static int ixppcib_setup_intr(device_t dev, device_t child, struct resource *ires, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { return (BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, - intr, arg, cookiep)); + filt, intr, arg, cookiep)); } static int --- p4_head/sys/arm/xscale/ixp425/ixp425_timer.c Sun Jan 21 15:15:08 2007 +++ p4_head_intr/sys/arm/xscale/ixp425/ixp425_timer.c Fri Jan 26 13:54:07 2007 @@ -58,7 +58,7 @@ static uint32_t counts_per_hz; /* callback functions for intr_functions */ -void ixpclk_intr(void *); +int ixpclk_intr(void *); struct ixpclk_softc { device_t sc_dev; @@ -182,8 +182,8 @@ if (!irq) panic("Unable to setup the clock irq handler.\n"); else - bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST, - ixpclk_intr, NULL, &ihl); + bus_setup_intr(dev, irq, INTR_TYPE_CLK, ixpclk_intr, NULL, + NULL, &ihl); /* Set up the new clock parameters. */ @@ -244,7 +244,7 @@ * * Handle the hardclock interrupt. */ -void +int ixpclk_intr(void *arg) { struct ixpclk_softc* sc = ixpclk_sc; @@ -254,6 +254,7 @@ OST_TIM0_INT); hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + return (FILTER_HANDLED); } void --- p4_head/sys/compat/ndis/kern_ndis.c Sun Jan 21 15:15:25 2007 +++ p4_head_intr/sys/compat/ndis/kern_ndis.c Fri Jan 26 13:54:07 2007 @@ -1373,7 +1373,7 @@ if (sc->ndis_iftype == PCMCIABus || sc->ndis_iftype == PCIBus) { error = bus_setup_intr(sc->ndis_dev, sc->ndis_irq, INTR_TYPE_NET | INTR_MPSAFE, - ntoskrnl_intr, NULL, &sc->ndis_intrhand); + NULL, ntoskrnl_intr, NULL, &sc->ndis_intrhand); if (error) return(NDIS_STATUS_FAILURE); } --- p4_head/sys/contrib/dev/oltr/if_oltr.c Sun Jan 21 15:16:10 2007 +++ p4_head_intr/sys/contrib/dev/oltr/if_oltr.c Fri Jan 26 13:54:07 2007 @@ -154,7 +154,7 @@ if_free(ifp); return (-1); } - if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, oltr_intr, + if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL, oltr_intr, sc, &sc-> oltr_intrhand)) { device_printf(dev, "couldn't setup interrupt\n"); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); --- p4_head/sys/dev/aac/aac.c Sun Jan 21 15:16:22 2007 +++ p4_head_intr/sys/dev/aac/aac.c Fri Jan 26 13:54:07 2007 @@ -305,20 +305,21 @@ } if (sc->flags & AAC_FLAGS_NEW_COMM) { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_MPSAFE|INTR_TYPE_BIO, aac_new_intr, - sc, &sc->aac_intr)) { + INTR_MPSAFE|INTR_TYPE_BIO, NULL, + aac_new_intr, sc, &sc->aac_intr)) { device_printf(sc->aac_dev, "can't set up interrupt\n"); return (EINVAL); } } else { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_FAST|INTR_TYPE_BIO, aac_fast_intr, + INTR_TYPE_BIO, aac_fast_intr, NULL, sc, &sc->aac_intr)) { device_printf(sc->aac_dev, "can't set up FAST interrupt\n"); if (bus_setup_intr(sc->aac_dev, sc->aac_irq, INTR_MPSAFE|INTR_TYPE_BIO, - aac_fast_intr, sc, &sc->aac_intr)) { + NULL, (driver_intr_t *)aac_fast_intr, + sc, &sc->aac_intr)) { device_printf(sc->aac_dev, "can't set up MPSAFE interrupt\n"); return (EINVAL); @@ -780,7 +781,7 @@ mtx_unlock(&sc->aac_io_lock); } -void +int aac_fast_intr(void *arg) { struct aac_softc *sc; @@ -822,6 +823,7 @@ */ wakeup(sc->aifthread); } + return (FILTER_HANDLED); } /* --- p4_head/sys/dev/aac/aacvar.h Sun Jan 21 15:16:23 2007 +++ p4_head_intr/sys/dev/aac/aacvar.h Fri Jan 26 13:54:07 2007 @@ -425,7 +425,7 @@ extern int aac_suspend(device_t dev); extern int aac_resume(device_t dev); extern void aac_new_intr(void *arg); -extern void aac_fast_intr(void *arg); +extern int aac_fast_intr(void *arg); extern void aac_submit_bio(struct bio *bp); extern void aac_biodone(struct bio *bp); extern void aac_startio(struct aac_softc *sc); --- p4_head/sys/dev/acpica/Osd/OsdInterrupt.c Sun Jan 21 15:16:23 2007 +++ p4_head_intr/sys/dev/acpica/Osd/OsdInterrupt.c Fri Jan 26 13:54:07 2007 @@ -86,7 +86,7 @@ goto error; } if (bus_setup_intr(sc->acpi_dev, sc->acpi_irq, INTR_TYPE_MISC|INTR_MPSAFE, - (driver_intr_t *)ServiceRoutine, Context, &sc->acpi_irq_handle)) { + NULL, (driver_intr_t *)ServiceRoutine, Context, &sc->acpi_irq_handle)) { device_printf(sc->acpi_dev, "could not set up interrupt\n"); goto error; } --- p4_head/sys/dev/adlink/adlink.c Sun Jan 21 15:16:25 2007 +++ p4_head_intr/sys/dev/adlink/adlink.c Fri Jan 26 13:54:07 2007 @@ -115,7 +115,7 @@ static d_ioctl_t adlink_ioctl; static d_mmap_t adlink_mmap; -static void adlink_intr(void *arg); +static int adlink_intr(void *arg); static struct cdevsw adlink_cdevsw = { .d_version = D_VERSION, @@ -124,7 +124,7 @@ .d_name = "adlink", }; -static void +static int adlink_intr(void *arg) { struct softc *sc; @@ -134,7 +134,7 @@ sc = arg; u = bus_read_4(sc->res[0], 0x38); if (!(u & 0x00800000)) - return; + return; // XXX - FILTER_STRAY? bus_write_4(sc->res[0], 0x38, u | 0x003f4000); sc->sample += sc->p0->chunksize / 2; @@ -147,7 +147,7 @@ if (sc->p0->state != STATE_RUN) { printf("adlink: stopping %d\n", sc->p0->state); - return; + return; // XXX - FILTER_STRAY? } pg = pg->next; @@ -156,6 +156,7 @@ bus_write_4(sc->res[0], 0x24, pg->phys); bus_write_4(sc->res[0], 0x28, sc->p0->chunksize); wakeup(sc); + return (FILTER_HANDLED); } static int @@ -372,14 +373,15 @@ if (error) return (error); + /* XXX why do we need INTR_MPSAFE if INTR_FAST was declared too?!?!? */ i = bus_setup_intr(self, sc->res[2], - INTR_MPSAFE | INTR_TYPE_MISC | INTR_FAST, - adlink_intr, sc, &sc->intrhand); + INTR_MPSAFE | INTR_TYPE_MISC, + adlink_intr, NULL, sc, &sc->intrhand); if (i) { printf("adlink: Couldn't get FAST intr\n"); i = bus_setup_intr(self, sc->res[2], INTR_MPSAFE | INTR_TYPE_MISC, - adlink_intr, sc, &sc->intrhand); + NULL, (driver_intr_t *)adlink_intr, sc, &sc->intrhand); } if (i) { --- p4_head/sys/dev/advansys/adv_eisa.c Sun Jan 21 15:16:25 2007 +++ p4_head_intr/sys/dev/advansys/adv_eisa.c Fri Jan 26 13:54:07 2007 @@ -323,7 +323,8 @@ /* * Enable our interrupt handler. */ - bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih); + bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, adv_intr, + adv, &ih); /* Attach sub-devices - always succeeds */ adv_attach(adv); --- p4_head/sys/dev/advansys/adv_isa.c Sun Jan 21 15:16:25 2007 +++ p4_head_intr/sys/dev/advansys/adv_isa.c Fri Jan 26 13:54:07 2007 @@ -337,7 +337,7 @@ RF_ACTIVE); if (irqres == NULL || bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, - adv_intr, adv, &ih)) { + NULL, adv_intr, adv, &ih)) { bus_dmamap_unload(overrun_dmat, overrun_dmamap); bus_dmamem_free(overrun_dmat, overrun_buf, overrun_dmamap); --- p4_head/sys/dev/advansys/adv_pci.c Sun Jan 21 15:16:25 2007 +++ p4_head_intr/sys/dev/advansys/adv_pci.c Fri Jan 26 13:54:07 2007 @@ -309,7 +309,8 @@ irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqrid, RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || - bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih)) { + bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, NULL, + adv_intr, adv, &ih)) { adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; --- p4_head/sys/dev/advansys/adwcam.c Sun Jan 21 15:16:26 2007 +++ p4_head_intr/sys/dev/advansys/adwcam.c Fri Jan 26 13:54:07 2007 @@ -1213,8 +1213,8 @@ s = splcam(); /* Hook up our interrupt handler */ if ((error = bus_setup_intr(adw->device, adw->irq, - INTR_TYPE_CAM | INTR_ENTROPY, adw_intr, - adw, &adw->ih)) != 0) { + INTR_TYPE_CAM | INTR_ENTROPY, NULL, + adw_intr, adw, &adw->ih)) != 0) { device_printf(adw->device, "bus_setup_intr() failed: %d\n", error); goto fail; --- p4_head/sys/dev/aha/aha_isa.c Sun Jan 21 15:16:27 2007 +++ p4_head_intr/sys/dev/aha/aha_isa.c Fri Jan 26 13:54:07 2007 @@ -272,7 +272,7 @@ } error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM|INTR_ENTROPY, - aha_intr, aha, &ih); + NULL, aha_intr, aha, &ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); goto fail; --- p4_head/sys/dev/ahb/ahb.c Sun Jan 21 15:16:27 2007 +++ p4_head_intr/sys/dev/ahb/ahb.c Fri Jan 26 13:54:07 2007 @@ -378,7 +378,8 @@ goto error_exit; /* Enable our interrupt */ - bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, ahbintr, ahb, &ih); + bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, ahbintr, + ahb, &ih); return (0); error_exit: --- p4_head/sys/dev/aic/aic_cbus.c Sun Jan 21 15:16:27 2007 +++ p4_head_intr/sys/dev/aic/aic_cbus.c Fri Jan 26 13:54:07 2007 @@ -211,7 +211,7 @@ } error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY, - aic_intr, aic, &sc->sc_ih); + NULL, aic_intr, aic, &sc->sc_ih); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_isa_release_resources(dev); --- p4_head/sys/dev/aic/aic_isa.c Sun Jan 21 15:16:27 2007 +++ p4_head_intr/sys/dev/aic/aic_isa.c Fri Jan 26 13:54:07 2007 @@ -188,7 +188,7 @@ } error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY, - aic_intr, aic, &sc->sc_ih); + NULL, aic_intr, aic, &sc->sc_ih); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_isa_release_resources(dev); --- p4_head/sys/dev/aic/aic_pccard.c Sun Jan 21 15:16:27 2007 +++ p4_head_intr/sys/dev/aic/aic_pccard.c Fri Jan 26 13:54:07 2007 @@ -142,7 +142,7 @@ } error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY, - aic_intr, aic, &sc->sc_ih); + NULL, aic_intr, aic, &sc->sc_ih); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_pccard_release_resources(dev); --- p4_head/sys/dev/aic7xxx/aic79xx_osm.c Sun Jan 21 15:16:29 2007 +++ p4_head_intr/sys/dev/aic7xxx/aic79xx_osm.c Fri Jan 26 13:54:07 2007 @@ -95,7 +95,7 @@ /* Hook up our interrupt handler */ error = bus_setup_intr(ahd->dev_softc, ahd->platform_data->irq, - INTR_TYPE_CAM, ahd_platform_intr, ahd, + INTR_TYPE_CAM, NULL, ahd_platform_intr, ahd, &ahd->platform_data->ih); if (error != 0) device_printf(ahd->dev_softc, "bus_setup_intr() failed: %d\n", --- p4_head/sys/dev/aic7xxx/aic7xxx_osm.c Sun Jan 21 15:16:31 2007 +++ p4_head_intr/sys/dev/aic7xxx/aic7xxx_osm.c Fri Jan 26 13:54:07 2007 @@ -107,7 +107,7 @@ /* Hook up our interrupt handler */ error = bus_setup_intr(ahc->dev_softc, ahc->platform_data->irq, - INTR_TYPE_CAM, ahc_platform_intr, ahc, + INTR_TYPE_CAM, NULL, ahc_platform_intr, ahc, &ahc->platform_data->ih); if (error != 0) --- p4_head/sys/dev/amd/amd.c Sun Jan 21 15:16:32 2007 +++ p4_head_intr/sys/dev/amd/amd.c Fri Jan 26 13:54:07 2007 @@ -2460,7 +2460,7 @@ RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || bus_setup_intr(dev, irqres, INTR_TYPE_CAM | INTR_ENTROPY, - amd_intr, amd, &ih)) { + NULL, amd_intr, amd, &ih)) { if (bootverbose) printf("amd%d: unable to register interrupt handler!\n", unit); --- p4_head/sys/dev/amr/amr_pci.c Sun Jan 21 15:16:32 2007 +++ p4_head_intr/sys/dev/amr/amr_pci.c Fri Jan 26 13:54:07 2007 @@ -263,7 +263,7 @@ goto out; } if (bus_setup_intr(sc->amr_dev, sc->amr_irq, - INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, amr_pci_intr, + INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, NULL, amr_pci_intr, sc, &sc->amr_intr)) { device_printf(sc->amr_dev, "can't set up interrupt\n"); goto out; --- p4_head/sys/dev/an/if_an_isa.c Sun Jan 21 15:16:33 2007 +++ p4_head_intr/sys/dev/an/if_an_isa.c Fri Jan 26 13:54:07 2007 @@ -122,7 +122,7 @@ } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - an_intr, sc, &sc->irq_handle); + NULL, an_intr, sc, &sc->irq_handle); if (error) { an_release_resources(dev); return (error); --- p4_head/sys/dev/an/if_an_pccard.c Sun Jan 21 15:16:33 2007 +++ p4_head_intr/sys/dev/an/if_an_pccard.c Fri Jan 26 13:54:07 2007 @@ -153,7 +153,7 @@ * Must setup the interrupt after the an_attach to prevent racing. */ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - an_intr, sc, &sc->irq_handle); + NULL, an_intr, sc, &sc->irq_handle); fail: if (error) an_release_resources(dev); --- p4_head/sys/dev/an/if_an_pci.c Sun Jan 21 15:16:33 2007 +++ p4_head_intr/sys/dev/an/if_an_pci.c Fri Jan 26 13:54:07 2007 @@ -240,7 +240,7 @@ * Must setup the interrupt after the an_attach to prevent racing. */ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - an_intr, sc, &sc->irq_handle); + NULL, an_intr, sc, &sc->irq_handle); fail: if (error) --- p4_head/sys/dev/ar/if_ar.c Sun Jan 21 15:16:33 2007 +++ p4_head_intr/sys/dev/ar/if_ar.c Fri Jan 26 13:54:07 2007 @@ -259,7 +259,7 @@ arc_init(hc); if(bus_setup_intr(device, hc->res_irq, - INTR_TYPE_NET, arintr, hc, &hc->intr_cookie) != 0) + INTR_TYPE_NET, NULL, arintr, hc, &hc->intr_cookie) != 0) return (1); sc = hc->sc; --- p4_head/sys/dev/arcmsr/arcmsr.c Sun Jan 21 15:16:33 2007 +++ p4_head_intr/sys/dev/arcmsr/arcmsr.c Fri Jan 26 13:54:07 2007 @@ -2113,7 +2113,7 @@ irqres=bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE); if(irqres == NULL || bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE - , arcmsr_interrupt, acb, &acb->ih)) { + , NULL, arcmsr_interrupt, acb, &acb->ih)) { arcmsr_free_resource(acb); printf("arcmsr%d: unable to register interrupt handler!\n", unit); return ENXIO; --- p4_head/sys/dev/arl/if_arl_isa.c Sun Jan 21 15:16:34 2007 +++ p4_head_intr/sys/dev/arl/if_arl_isa.c Fri Jan 26 13:54:07 2007 @@ -303,7 +303,7 @@ arl_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - arl_intr, sc, &sc->irq_handle); + NULL, arl_intr, sc, &sc->irq_handle); if (error) { arl_release_resources(dev); return (error); --- p4_head/sys/dev/asr/asr.c Sun Jan 21 15:16:35 2007 +++ p4_head_intr/sys/dev/asr/asr.c Fri Jan 26 13:54:07 2007 @@ -2297,7 +2297,7 @@ return (0); } if (bus_setup_intr(dev, sc->ha_irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - (driver_intr_t *)asr_intr, (void *)sc, &(sc->ha_intr))) { + NULL, (driver_intr_t *)asr_intr, (void *)sc, &(sc->ha_intr))) { return (0); } sc->ha_irq = pci_read_config(dev, PCIR_INTLINE, sizeof(char)); --- p4_head/sys/dev/ata/ata-all.c Sun Jan 21 15:16:36 2007 +++ p4_head_intr/sys/dev/ata/ata-all.c Fri Jan 26 13:54:07 2007 @@ -134,7 +134,7 @@ device_printf(dev, "unable to allocate interrupt\n"); return ENXIO; } - if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, + if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL, (driver_intr_t *)ata_interrupt, ch, &ch->ih))) { device_printf(dev, "unable to setup interrupt\n"); return error; --- p4_head/sys/dev/ata/ata-cbus.c Sun Jan 21 15:16:36 2007 +++ p4_head_intr/sys/dev/ata/ata-cbus.c Fri Jan 26 13:54:07 2007 @@ -144,7 +144,7 @@ } if ((bus_setup_intr(dev, ctlr->irq, ATA_INTR_FLAGS, - ata_cbus_intr, ctlr, &ctlr->ih))) { + NULL, ata_cbus_intr, ctlr, &ctlr->ih))) { device_printf(dev, "unable to setup interrupt\n"); bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io); bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, ctlr->ctlio); @@ -188,12 +188,16 @@ static int ata_cbus_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, - void **cookiep) + int flags, driver_filter_t *filter, driver_intr_t *intr, + void *arg, void **cookiep) { struct ata_cbus_controller *controller = device_get_softc(dev); int unit = ((struct ata_channel *)device_get_softc(child))->unit; + if (filter != NULL) { + printf("ata-cbus.c: we cannot use a filter here\n"); + return (EINVAL); + } controller->interrupt[unit].function = intr; controller->interrupt[unit].argument = arg; *cookiep = controller; --- p4_head/sys/dev/ata/ata-chipset.c Sun Jan 21 15:16:36 2007 +++ p4_head_intr/sys/dev/ata/ata-chipset.c Fri Jan 26 13:54:08 2007 @@ -3205,7 +3205,7 @@ u_int32_t dimm = ATA_INL(ctlr->r_res2, 0x000c0080); if (bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle) || - bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, + bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL, ata_promise_sx4_intr, ctlr, &ctlr->handle)) { device_printf(dev, "unable to setup interrupt\n"); goto failnfree; @@ -3239,7 +3239,7 @@ /* mio type controllers need an interrupt intercept */ if (bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle) || - bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, + bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL, ata_promise_mio_intr, ctlr, &ctlr->handle)) { device_printf(dev, "unable to setup interrupt\n"); goto failnfree; @@ -5099,7 +5099,7 @@ device_printf(dev, "unable to map interrupt\n"); return ENXIO; } - if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, + if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL, ata_generic_intr, ctlr, &ctlr->handle))) { device_printf(dev, "unable to setup interrupt\n"); return ENXIO; --- p4_head/sys/dev/ata/ata-pci.c Sun Jan 21 15:16:37 2007 +++ p4_head_intr/sys/dev/ata/ata-pci.c Fri Jan 26 13:54:08 2007 @@ -335,17 +335,21 @@ int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *function, void *argument, - void **cookiep) + int flags, driver_filter_t *filter, driver_intr_t *function, + void *argument, void **cookiep) { if (ata_legacy(dev)) { return BUS_SETUP_INTR(device_get_parent(dev), child, irq, - flags, function, argument, cookiep); + flags, filter, function, argument, cookiep); } else { struct ata_pci_controller *controller = device_get_softc(dev); int unit = ((struct ata_channel *)device_get_softc(child))->unit; + if (filter != NULL) { + printf("ata-pci.c: we cannot use a filter here\n"); + return (EINVAL); + } controller->interrupt[unit].function = function; controller->interrupt[unit].argument = argument; *cookiep = controller; --- p4_head/sys/dev/ata/ata-pci.h Sun Jan 21 15:16:37 2007 +++ p4_head_intr/sys/dev/ata/ata-pci.h Fri Jan 26 13:54:08 2007 @@ -427,7 +427,7 @@ int ata_pci_detach(device_t dev); struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); -int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_intr_t *function, void *argument, void **cookiep); +int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); int ata_pci_allocate(device_t dev); void ata_pci_hw(device_t dev); --- p4_head/sys/dev/ath/if_ath_pci.c Sun Jan 21 15:16:38 2007 +++ p4_head_intr/sys/dev/ath/if_ath_pci.c Fri Jan 26 13:54:08 2007 @@ -169,7 +169,7 @@ } if (bus_setup_intr(dev, psc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - ath_intr, sc, &psc->sc_ih)) { + NULL, ath_intr, sc, &psc->sc_ih)) { device_printf(dev, "could not establish interrupt\n"); goto bad2; } --- p4_head/sys/dev/atkbdc/atkbd_atkbdc.c Sun Jan 21 15:16:39 2007 +++ p4_head_intr/sys/dev/atkbdc/atkbd_atkbdc.c Fri Jan 26 13:54:08 2007 @@ -136,7 +136,7 @@ RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) return ENXIO; - error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, atkbdintr, + error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, atkbdintr, kbd, &sc->ih); if (error) bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); --- p4_head/sys/dev/atkbdc/psm.c Sun Jan 21 15:16:39 2007 +++ p4_head_intr/sys/dev/atkbdc/psm.c Fri Jan 26 13:54:08 2007 @@ -1275,7 +1275,7 @@ RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) return (ENXIO); - error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, psmintr, sc, &sc->ih); + error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, psmintr, sc, &sc->ih); if (error) { bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); return (error); --- p4_head/sys/dev/awi/if_awi_pccard.c Sun Jan 21 15:16:40 2007 +++ p4_head_intr/sys/dev/awi/if_awi_pccard.c Fri Jan 26 13:54:08 2007 @@ -239,7 +239,7 @@ if (psc->sc_intrhand == 0) { error = bus_setup_intr(dev, psc->sc_irq_res, INTR_TYPE_NET, - (void (*)(void *))awi_intr, sc, &psc->sc_intrhand); + NULL, (void (*)(void *))awi_intr, sc, &psc->sc_intrhand); if (error) { device_printf(dev, "couldn't establish interrupt error=%d\n", error); --- p4_head/sys/dev/bce/if_bce.c Sun Jan 21 15:16:40 2007 +++ p4_head_intr/sys/dev/bce/if_bce.c Fri Jan 26 13:54:08 2007 @@ -768,7 +768,7 @@ #endif /* Hookup IRQ last. */ - rc = bus_setup_intr(dev, sc->bce_irq, INTR_TYPE_NET | INTR_MPSAFE, + rc = bus_setup_intr(dev, sc->bce_irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, bce_intr, sc, &sc->bce_intrhand); if (rc) { --- p4_head/sys/dev/bfe/if_bfe.c Sun Jan 21 15:16:41 2007 +++ p4_head_intr/sys/dev/bfe/if_bfe.c Fri Jan 26 13:54:08 2007 @@ -423,7 +423,7 @@ * Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->bfe_irq, INTR_TYPE_NET | INTR_MPSAFE, - bfe_intr, sc, &sc->bfe_intrhand); + NULL, bfe_intr, sc, &sc->bfe_intrhand); if (error) { printf("bfe%d: couldn't set up irq\n", unit); --- p4_head/sys/dev/bge/if_bge.c Sun Jan 21 15:16:41 2007 +++ p4_head_intr/sys/dev/bge/if_bge.c Fri Jan 26 13:54:08 2007 @@ -2499,7 +2499,7 @@ * Hookup IRQ last. */ error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, - bge_intr, sc, &sc->bge_intrhand); + NULL, bge_intr, sc, &sc->bge_intrhand); if (error) { bge_detach(dev); --- p4_head/sys/dev/bktr/bktr_os.c Sun Jan 21 15:16:42 2007 +++ p4_head_intr/sys/dev/bktr/bktr_os.c Fri Jan 26 13:54:08 2007 @@ -384,7 +384,7 @@ } error = bus_setup_intr(dev, bktr->res_irq, INTR_TYPE_TTY, - bktr_intr, bktr, &bktr->res_ih); + NULL, bktr_intr, bktr, &bktr->res_ih); if (error) { device_printf(dev, "could not setup irq\n"); goto fail; --- p4_head/sys/dev/buslogic/bt.c Sun Jan 21 15:16:43 2007 +++ p4_head_intr/sys/dev/buslogic/bt.c Fri Jan 26 13:54:08 2007 @@ -896,7 +896,7 @@ /* * Setup interrupt. */ - error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM|INTR_ENTROPY, + error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, bt_intr, bt, &bt->ih); if (error) { device_printf(dev, "bus_setup_intr() failed: %d\n", error); --- p4_head/sys/dev/ce/if_ce.c Sun Jan 21 15:16:44 2007 +++ p4_head_intr/sys/dev/ce/if_ce.c Fri Jan 26 13:54:08 2007 @@ -667,7 +667,7 @@ #else INTR_TYPE_NET, #endif - ce_intr, bd, &bd->ce_intrhand); + NULL, ce_intr, bd, &bd->ce_intrhand); if (error) { printf ("ce%d: cannot set up irq\n", unit); bus_release_resource (dev, SYS_RES_IRQ, 0, bd->ce_irq); --- p4_head/sys/dev/ciss/ciss.c Sun Jan 21 15:16:46 2007 +++ p4_head_intr/sys/dev/ciss/ciss.c Fri Jan 26 13:54:08 2007 @@ -655,7 +655,7 @@ return(ENXIO); } if (bus_setup_intr(sc->ciss_dev, sc->ciss_irq_resource, - INTR_TYPE_CAM|INTR_ENTROPY, ciss_intr, sc, + INTR_TYPE_CAM|INTR_ENTROPY, NULL, ciss_intr, sc, &sc->ciss_intr)) { ciss_printf(sc, "can't set up interrupt\n"); return(ENXIO); --- p4_head/sys/dev/cm/if_cm_isa.c Sun Jan 21 15:16:47 2007 +++ p4_head_intr/sys/dev/cm/if_cm_isa.c Fri Jan 26 13:54:08 2007 @@ -107,7 +107,7 @@ mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - cmintr, sc, &sc->irq_handle); + NULL, cmintr, sc, &sc->irq_handle); if (error) goto err; --- p4_head/sys/dev/cp/if_cp.c Sun Jan 21 15:16:48 2007 +++ p4_head_intr/sys/dev/cp/if_cp.c Fri Jan 26 13:54:08 2007 @@ -481,7 +481,7 @@ callout_init (&led_timo[unit], cp_mpsafenet ? CALLOUT_MPSAFE : 0); error = bus_setup_intr (dev, bd->cp_irq, INTR_TYPE_NET|(cp_mpsafenet?INTR_MPSAFE:0), - cp_intr, bd, &bd->cp_intrhand); + NULL, cp_intr, bd, &bd->cp_intrhand); if (error) { cp_destroy = 1; printf ("cp%d: cannot set up irq\n", unit); --- p4_head/sys/dev/cs/if_cs_isa.c Sun Jan 21 15:16:48 2007 +++ p4_head_intr/sys/dev/cs/if_cs_isa.c Fri Jan 26 13:54:08 2007 @@ -99,7 +99,7 @@ cs_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - csintr, sc, &sc->irq_handle); + NULL, csintr, sc, &sc->irq_handle); if (error) { cs_release_resources(dev); return (error); --- p4_head/sys/dev/cs/if_cs_pccard.c Sun Jan 21 15:16:48 2007 +++ p4_head_intr/sys/dev/cs/if_cs_pccard.c Fri Jan 26 13:54:08 2007 @@ -91,7 +91,7 @@ if (error != 0) goto bad; error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - csintr, sc, &sc->irq_handle); + NULL, csintr, sc, &sc->irq_handle); if (error != 0) goto bad; --- p4_head/sys/dev/ct/ct_isa.c Sun Jan 21 15:16:49 2007 +++ p4_head_intr/sys/dev/ct/ct_isa.c Fri Jan 26 13:54:08 2007 @@ -330,7 +330,7 @@ splx(s); if (bus_setup_intr(dev, ct->irq_res, INTR_TYPE_CAM, - (driver_intr_t *)ctintr, ct, &ct->sc_ih)) { + NULL, (driver_intr_t *)ctintr, ct, &ct->sc_ih)) { ct_space_unmap(dev, ct); return ENXIO; } --- p4_head/sys/dev/ctau/if_ct.c Sun Jan 21 15:16:50 2007 +++ p4_head_intr/sys/dev/ctau/if_ct.c Fri Jan 26 13:54:08 2007 @@ -682,7 +682,7 @@ s = splimp (); if (bus_setup_intr (dev, bd->irq_res, INTR_TYPE_NET|(ct_mpsafenet?INTR_MPSAFE:0), - ct_intr, bd, &bd->intrhand)) { + NULL, ct_intr, bd, &bd->intrhand)) { printf ("ct%d: Can't setup irq %ld\n", unit, irq); bd->board = 0; adapter [unit] = 0; --- p4_head/sys/dev/cx/if_cx.c Sun Jan 21 15:16:51 2007 +++ p4_head_intr/sys/dev/cx/if_cx.c Fri Jan 26 13:54:08 2007 @@ -780,7 +780,7 @@ s = splhigh (); if (bus_setup_intr (dev, bd->irq_res, INTR_TYPE_NET|(cx_mpsafenet?INTR_MPSAFE:0), - cx_intr, bd, &bd->intrhand)) { + NULL, cx_intr, bd, &bd->intrhand)) { printf ("cx%d: Can't setup irq %ld\n", unit, irq); bd->board = 0; b->sys = 0; --- p4_head/sys/dev/cy/cy.c Sun Jan 21 15:16:51 2007 +++ p4_head_intr/sys/dev/cy/cy.c Fri Jan 26 13:54:08 2007 @@ -644,7 +644,7 @@ com->mcr_image |= com->mcr_rts); } -void +int cyintr(void *vcom) { struct com_s *basecom; @@ -671,7 +671,7 @@ /* poll to see if it has any work */ status = cd_inb(iobase, CD1400_SVRR, cy_align); if (status == 0) - continue; + continue; // XXX - FILTER_STRAY? #ifdef CyDebug ++cy_svrr_probes; #endif @@ -1111,6 +1111,7 @@ swi_sched(cy_slow_ih, SWI_DELAY); COM_UNLOCK(); + return (FILTER_HANDLED); } static void --- p4_head/sys/dev/cy/cy_isa.c Sun Jan 21 15:16:51 2007 +++ p4_head_intr/sys/dev/cy/cy_isa.c Fri Jan 26 13:54:08 2007 @@ -133,8 +133,8 @@ device_printf(dev, "interrupt resource allocation failed\n"); goto fail; } - if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY | INTR_FAST, cyintr, - vsc, &irq_cookie) != 0) { + if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY, + cyintr, NULL, vsc, &irq_cookie) != 0) { device_printf(dev, "interrupt setup failed\n"); goto fail; } --- p4_head/sys/dev/cy/cy_pci.c Sun Jan 21 15:16:51 2007 +++ p4_head_intr/sys/dev/cy/cy_pci.c Fri Jan 26 13:54:08 2007 @@ -145,14 +145,14 @@ goto fail; } #ifdef CY_PCI_FASTINTR - irq_setup = bus_setup_intr(dev, irq_res, INTR_TYPE_TTY | INTR_FAST, - cyintr, vsc, &irq_cookie); + irq_setup = bus_setup_intr(dev, irq_res, INTR_TYPE_TTY, + cyintr, NULL, vsc, &irq_cookie); #else irq_setup = ENXIO; #endif if (irq_setup != 0) irq_setup = bus_setup_intr(dev, irq_res, INTR_TYPE_TTY, - cyintr, vsc, &irq_cookie); + NULL, (driver_intr_t *)cyintr, vsc, &irq_cookie); if (irq_setup != 0) { device_printf(dev, "interrupt setup failed\n"); goto fail; --- p4_head/sys/dev/cy/cyvar.h Sun Jan 21 15:16:51 2007 +++ p4_head_intr/sys/dev/cy/cyvar.h Fri Jan 26 13:54:08 2007 @@ -32,5 +32,5 @@ extern char cy_driver_name[]; void *cyattach_common(cy_addr cy_iobase, int cy_align); -driver_intr_t cyintr; +driver_filter_t cyintr; int cy_units(cy_addr cy_iobase, int cy_align); --- p4_head/sys/dev/dc/if_dc.c Sun Jan 21 15:16:51 2007 +++ p4_head_intr/sys/dev/dc/if_dc.c Fri Jan 26 13:54:08 2007 @@ -2265,7 +2265,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET | INTR_MPSAFE, - dc_intr, sc, &sc->dc_intrhand); + NULL, dc_intr, sc, &sc->dc_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/dev/de/if_de.c Sun Jan 21 15:16:52 2007 +++ p4_head_intr/sys/dev/de/if_de.c Fri Jan 26 13:54:08 2007 @@ -4890,7 +4890,7 @@ res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (res == 0 || bus_setup_intr(dev, res, INTR_TYPE_NET | - INTR_MPSAFE, intr_rtn, sc, &ih)) { + INTR_MPSAFE, NULL, intr_rtn, sc, &ih)) { device_printf(dev, "couldn't map interrupt\n"); tulip_busdma_cleanup(sc); ether_ifdetach(sc->tulip_ifp); --- p4_head/sys/dev/dpt/dpt_eisa.c Sun Jan 21 15:16:58 2007 +++ p4_head_intr/sys/dev/dpt/dpt_eisa.c Fri Jan 26 13:54:08 2007 @@ -155,7 +155,7 @@ splx(s); if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - dpt_intr, dpt, &dpt->ih)) { + NULL, dpt_intr, dpt, &dpt->ih)) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto bad; --- p4_head/sys/dev/dpt/dpt_pci.c Sun Jan 21 15:16:58 2007 +++ p4_head_intr/sys/dev/dpt/dpt_pci.c Fri Jan 26 13:54:08 2007 @@ -163,7 +163,7 @@ splx(s); if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - dpt_intr, dpt, &dpt->ih)) { + NULL, dpt_intr, dpt, &dpt->ih)) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto bad; --- p4_head/sys/dev/drm/drm_irq.c Sun Jan 21 15:16:59 2007 +++ p4_head_intr/sys/dev/drm/drm_irq.c Fri Jan 26 13:54:08 2007 @@ -110,7 +110,7 @@ dev->irq_handler, dev, &dev->irqh); #else retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY | INTR_MPSAFE, - drm_irq_handler_wrap, dev, &dev->irqh); + NULL, drm_irq_handler_wrap, dev, &dev->irqh); #endif if (retcode != 0) goto err; --- p4_head/sys/dev/ed/if_ed_cbus.c Sun Jan 21 15:17:02 2007 +++ p4_head_intr/sys/dev/ed/if_ed_cbus.c Fri Jan 26 13:54:08 2007 @@ -243,7 +243,7 @@ ed_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - edintr, sc, &sc->irq_handle); + NULL, edintr, sc, &sc->irq_handle); if (error) { ed_release_resources(dev); return (error); --- p4_head/sys/dev/ed/if_ed_isa.c Sun Jan 21 15:17:03 2007 +++ p4_head_intr/sys/dev/ed/if_ed_isa.c Fri Jan 26 13:54:08 2007 @@ -170,7 +170,7 @@ ed_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - edintr, sc, &sc->irq_handle); + NULL, edintr, sc, &sc->irq_handle); if (error) { ed_release_resources(dev); return (error); --- p4_head/sys/dev/ed/if_ed_pccard.c Sun Jan 21 15:17:03 2007 +++ p4_head_intr/sys/dev/ed/if_ed_pccard.c Fri Jan 26 13:54:08 2007 @@ -478,7 +478,7 @@ goto bad; error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - edintr, sc, &sc->irq_handle); + NULL, edintr, sc, &sc->irq_handle); if (error) { device_printf(dev, "setup intr failed %d \n", error); goto bad; --- p4_head/sys/dev/ed/if_ed_pci.c Sun Jan 21 15:17:03 2007 +++ p4_head_intr/sys/dev/ed/if_ed_pci.c Fri Jan 26 13:54:08 2007 @@ -107,7 +107,7 @@ return (error); } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - edintr, sc, &sc->irq_handle); + NULL, edintr, sc, &sc->irq_handle); if (error) { ed_release_resources(dev); return (error); --- p4_head/sys/dev/em/if_em.c Sun Jan 21 15:17:04 2007 +++ p4_head_intr/sys/dev/em/if_em.c Fri Jan 26 13:54:08 2007 @@ -275,7 +275,7 @@ static poll_handler_t em_poll; static void em_intr(void *); #else -static void em_intr_fast(void *); +static int em_intr_fast(void *); static void em_add_int_process_limit(struct adapter *, const char *, const char *, int *, int); static void em_handle_rxtx(void *context, int pending); @@ -1307,7 +1307,7 @@ * Fast Interrupt Service routine * *********************************************************************/ -static void +static int em_intr_fast(void *arg) { struct adapter *adapter = arg; @@ -1320,11 +1320,11 @@ /* Hot eject? */ if (reg_icr == 0xffffffff) - return; + return (FILTER_STRAY); /* Definitely not our interrupt. */ if (reg_icr == 0x0) - return; + return (FILTER_STRAY); /* * Starting with the 82571 chip, bit 31 should be used to @@ -1332,7 +1332,7 @@ */ if (adapter->hw.mac_type >= em_82571 && (reg_icr & E1000_ICR_INT_ASSERTED) == 0) - return; + return (FILTER_STRAY); /* * Mask interrupts until the taskqueue is finished running. This is @@ -1348,6 +1348,7 @@ if (reg_icr & E1000_ICR_RXO) adapter->rx_overruns++; + return (FILTER_HANDLED); } #endif /* ! DEVICE_POLLING */ @@ -2173,8 +2174,8 @@ #ifdef DEVICE_POLLING if (adapter->int_handler_tag == NULL && (error = bus_setup_intr(dev, - adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, em_intr, adapter, - &adapter->int_handler_tag)) != 0) { + adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, NULL, em_intr, + adapter, &adapter->int_handler_tag)) != 0) { device_printf(dev, "Failed to register interrupt handler"); return (error); } @@ -2190,7 +2191,7 @@ taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s taskq", device_get_nameunit(adapter->dev)); if ((error = bus_setup_intr(dev, adapter->res_interrupt, - INTR_TYPE_NET | INTR_FAST, em_intr_fast, adapter, + INTR_TYPE_NET, em_intr_fast, NULL, adapter, &adapter->int_handler_tag)) != 0) { device_printf(dev, "Failed to register fast interrupt " "handler: %d\n", error); --- p4_head/sys/dev/en/if_en_pci.c Sun Jan 21 15:17:05 2007 +++ p4_head_intr/sys/dev/en/if_en_pci.c Fri Jan 26 13:54:08 2007 @@ -277,7 +277,7 @@ * Do the interrupt SETUP last just before returning */ error = bus_setup_intr(dev, scp->irq, INTR_TYPE_NET, - en_intr, sc, &scp->ih); + NULL, en_intr, sc, &scp->ih); if (error) { en_reset(sc); atm_ifdetach(sc->ifp); --- p4_head/sys/dev/ep/if_ep_eisa.c Sun Jan 21 15:17:05 2007 +++ p4_head_intr/sys/dev/ep/if_ep_eisa.c Fri Jan 26 13:54:08 2007 @@ -217,8 +217,8 @@ device_printf(dev, "ep_attach() failed! (%d)\n", error); goto bad; } - if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, ep_intr, - sc, &sc->ep_intrhand))) { + if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, ep_intr, sc, &sc->ep_intrhand))) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); goto bad; } --- p4_head/sys/dev/ep/if_ep_isa.c Sun Jan 21 15:17:05 2007 +++ p4_head_intr/sys/dev/ep/if_ep_isa.c Fri Jan 26 13:54:08 2007 @@ -336,8 +336,8 @@ device_printf(sc->dev, "Invalid EEPROM checksum!\n"); goto bad; } - if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, ep_intr, - sc, &sc->ep_intrhand))) { + if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, ep_intr, sc, &sc->ep_intrhand))) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); goto bad; } --- p4_head/sys/dev/ep/if_ep_pccard.c Sun Jan 21 15:17:05 2007 +++ p4_head_intr/sys/dev/ep/if_ep_pccard.c Fri Jan 26 13:54:08 2007 @@ -204,7 +204,7 @@ goto bad; } if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, - ep_intr, sc, &sc->ep_intrhand))) { + NULL, ep_intr, sc, &sc->ep_intrhand))) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); goto bad; } --- p4_head/sys/dev/esp/esp_sbus.c Sun Jan 21 15:17:06 2007 +++ p4_head_intr/sys/dev/esp/esp_sbus.c Fri Jan 26 13:54:08 2007 @@ -691,7 +691,7 @@ return (ENXIO); } if (bus_setup_intr(esc->sc_dev, esc->sc_irqres, - INTR_TYPE_BIO|INTR_MPSAFE, ncr53c9x_intr, sc, &esc->sc_irq)) { + INTR_TYPE_BIO|INTR_MPSAFE, NULL, ncr53c9x_intr, sc, &esc->sc_irq)) { device_printf(esc->sc_dev, "cannot set up interrupt\n"); error = ENXIO; goto fail_ires; --- p4_head/sys/dev/ex/if_ex_isa.c Sun Jan 21 15:17:06 2007 +++ p4_head_intr/sys/dev/ex/if_ex_isa.c Fri Jan 26 13:54:08 2007 @@ -314,7 +314,7 @@ } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - ex_intr, (void *)sc, &sc->ih); + NULL, ex_intr, (void *)sc, &sc->ih); if (error) { device_printf(dev, "bus_setup_intr() failed!\n"); goto bad; --- p4_head/sys/dev/ex/if_ex_pccard.c Sun Jan 21 15:17:06 2007 +++ p4_head_intr/sys/dev/ex/if_ex_pccard.c Fri Jan 26 13:54:08 2007 @@ -165,7 +165,7 @@ } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - ex_intr, (void *)sc, &sc->ih); + NULL, ex_intr, (void *)sc, &sc->ih); if (error) { device_printf(dev, "bus_setup_intr() failed!\n"); goto bad; --- p4_head/sys/dev/fatm/if_fatm.c Sun Jan 21 15:17:07 2007 +++ p4_head_intr/sys/dev/fatm/if_fatm.c Fri Jan 26 13:54:08 2007 @@ -3060,7 +3060,7 @@ #endif error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET | INTR_MPSAFE, - fatm_intr, sc, &sc->ih); + NULL, fatm_intr, sc, &sc->ih); if (error) { if_printf(ifp, "couldn't setup irq\n"); goto fail; --- p4_head/sys/dev/fdc/fdc.c Sun Jan 21 15:17:09 2007 +++ p4_head_intr/sys/dev/fdc/fdc.c Fri Jan 26 13:54:08 2007 @@ -261,6 +261,7 @@ #define FD_NOT_VALID -2 static driver_intr_t fdc_intr; +static driver_filter_t fdc_intr_fast; static void fdc_reset(struct fdc_data *); SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver"); @@ -686,6 +687,14 @@ wakeup(arg); } +static int +fdc_intr_fast(void *arg) +{ + + wakeup(arg); + return(FILTER_HANDLED); +} + /* * fdc_pio(): perform programmed IO read/write for YE PCMCIA floppy. */ @@ -1758,9 +1767,11 @@ return (error); } error = bus_setup_intr(dev, fdc->res_irq, - INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE | - ((fdc->flags & FDC_NOFAST) ? 0 : INTR_FAST), - fdc_intr, fdc, &fdc->fdc_intr); + INTR_TYPE_BIO | INTR_ENTROPY | + ((fdc->flags & FDC_NOFAST) ? INTR_MPSAFE : 0), + ((fdc->flags & FDC_NOFAST) ? NULL : fdc_intr_fast), + ((fdc->flags & FDC_NOFAST) ? fdc_intr : NULL), + fdc, &fdc->fdc_intr); if (error) { device_printf(dev, "cannot setup interrupt\n"); return (error); --- p4_head/sys/dev/fe/if_fe.c Sun Jan 21 15:17:10 2007 +++ p4_head_intr/sys/dev/fe/if_fe.c Fri Jan 26 13:54:08 2007 @@ -741,7 +741,7 @@ } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - fe_intr, sc, &sc->irq_handle); + NULL, fe_intr, sc, &sc->irq_handle); if (error) { if_free(ifp); fe_release_resource(dev); --- p4_head/sys/dev/firewire/fwohci_pci.c Sun Jan 21 15:17:10 2007 +++ p4_head_intr/sys/dev/firewire/fwohci_pci.c Fri Jan 26 13:54:08 2007 @@ -342,7 +342,7 @@ #else INTR_TYPE_NET, #endif - (driver_intr_t *) fwohci_intr, sc, &sc->ih); + NULL, (driver_intr_t *) fwohci_intr, sc, &sc->ih); #if defined(__DragonFly__) || __FreeBSD_version < 500000 /* XXX splcam() should mask this irq for sbp.c*/ err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_CAM, --- p4_head/sys/dev/fxp/if_fxp.c Sun Jan 21 15:17:12 2007 +++ p4_head_intr/sys/dev/fxp/if_fxp.c Fri Jan 26 13:54:08 2007 @@ -807,7 +807,7 @@ * Hook our interrupt after all initialization is complete. */ error = bus_setup_intr(dev, sc->fxp_res[1], INTR_TYPE_NET | INTR_MPSAFE, - fxp_intr, sc, &sc->ih); + NULL, fxp_intr, sc, &sc->ih); if (error) { device_printf(dev, "could not setup irq\n"); ether_ifdetach(sc->ifp); --- p4_head/sys/dev/gem/if_gem_pci.c Sun Jan 21 15:17:12 2007 +++ p4_head_intr/sys/dev/gem/if_gem_pci.c Fri Jan 26 13:54:08 2007 @@ -210,7 +210,7 @@ } if (bus_setup_intr(dev, gsc->gsc_ires, INTR_TYPE_NET | INTR_MPSAFE, - gem_intr, sc, &gsc->gsc_ih) != 0) { + NULL, gem_intr, sc, &gsc->gsc_ih) != 0) { device_printf(dev, "failed to set up interrupt\n"); gem_detach(sc); goto fail_ires; --- p4_head/sys/dev/hatm/if_hatm.c Sun Jan 21 15:17:13 2007 +++ p4_head_intr/sys/dev/hatm/if_hatm.c Fri Jan 26 13:54:08 2007 @@ -1951,7 +1951,7 @@ #endif error = bus_setup_intr(dev, sc->irqres, sc->mpsafe | INTR_TYPE_NET, - hatm_intr, &sc->irq_0, &sc->ih); + NULL, hatm_intr, &sc->irq_0, &sc->ih); if (error != 0) { device_printf(dev, "could not setup interrupt\n"); hatm_detach(dev); --- p4_head/sys/dev/hfa/hfa_pci.c Sun Jan 21 15:17:15 2007 +++ p4_head_intr/sys/dev/hfa/hfa_pci.c Fri Jan 26 13:54:08 2007 @@ -161,7 +161,7 @@ * Map interrupt in */ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - hfa_intr, sc, &sc->irq_ih); + NULL, hfa_intr, sc, &sc->irq_ih); if (error) { device_printf(dev, "Interrupt handler setup failed.\n"); goto fail; --- p4_head/sys/dev/hifn/hifn7751.c Sun Jan 21 15:17:15 2007 +++ p4_head_intr/sys/dev/hifn/hifn7751.c Fri Jan 26 13:54:08 2007 @@ -530,7 +530,7 @@ * so make sure the IRQ is marked appropriately. */ if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - hifn_intr, sc, &sc->sc_intrhand)) { + NULL, hifn_intr, sc, &sc->sc_intrhand)) { device_printf(dev, "could not setup interrupt\n"); goto fail_intr2; } --- p4_head/sys/dev/hme/if_hme_pci.c Sun Jan 21 15:17:15 2007 +++ p4_head_intr/sys/dev/hme/if_hme_pci.c Fri Jan 26 13:54:08 2007 @@ -351,7 +351,7 @@ } if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET | - INTR_MPSAFE, hme_intr, sc, &hsc->hsc_ih)) != 0) { + INTR_MPSAFE, NULL, hme_intr, sc, &hsc->hsc_ih)) != 0) { device_printf(dev, "couldn't establish interrupt\n"); hme_detach(sc); goto fail_ires; --- p4_head/sys/dev/hme/if_hme_sbus.c Sun Jan 21 15:17:15 2007 +++ p4_head_intr/sys/dev/hme/if_hme_sbus.c Fri Jan 26 13:54:08 2007 @@ -269,7 +269,7 @@ } if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET | - INTR_MPSAFE, hme_intr, sc, &hsc->hsc_ih)) != 0) { + INTR_MPSAFE, NULL, hme_intr, sc, &hsc->hsc_ih)) != 0) { device_printf(dev, "couldn't establish interrupt\n"); hme_detach(sc); goto fail_ires; --- p4_head/sys/dev/hptmv/entry.c Sun Jan 21 15:17:17 2007 +++ p4_head_intr/sys/dev/hptmv/entry.c Fri Jan 26 13:54:08 2007 @@ -1929,7 +1929,7 @@ return(ENXIO); } - if(bus_setup_intr(pAdapter->hpt_dev, pAdapter->hpt_irq, INTR_TYPE_CAM, hpt_intr, pAdapter, &pAdapter->hpt_intr)) + if(bus_setup_intr(pAdapter->hpt_dev, pAdapter->hpt_irq, INTR_TYPE_CAM, NULL, hpt_intr, pAdapter, &pAdapter->hpt_intr)) { hpt_printk(("can't set up interrupt\n")); free(pAdapter, M_DEVBUF); --- p4_head/sys/dev/ichsmb/ichsmb.c Sun Jan 21 15:17:19 2007 +++ p4_head_intr/sys/dev/ichsmb/ichsmb.c Fri Jan 26 13:54:08 2007 @@ -125,7 +125,7 @@ /* Set up interrupt handler */ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, - ichsmb_device_intr, sc, &sc->irq_handle); + NULL, ichsmb_device_intr, sc, &sc->irq_handle); if (error != 0) { device_printf(dev, "can't setup irq\n"); goto fail; --- p4_head/sys/dev/ida/ida_eisa.c Sun Jan 21 15:17:19 2007 +++ p4_head_intr/sys/dev/ida/ida_eisa.c Fri Jan 26 13:54:08 2007 @@ -324,7 +324,7 @@ } error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, - ida_intr, ida, &ida->ih); + NULL, ida_intr, ida, &ida->ih); if (error) { device_printf(dev, "can't setup interrupt\n"); ida_free(ida); --- p4_head/sys/dev/ida/ida_pci.c Sun Jan 21 15:17:19 2007 +++ p4_head_intr/sys/dev/ida/ida_pci.c Fri Jan 26 13:54:08 2007 @@ -298,7 +298,7 @@ return (ENOMEM); } error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, - ida_intr, ida, &ida->ih); + NULL, ida_intr, ida, &ida->ih); if (error) { device_printf(dev, "can't setup interrupt\n"); ida_free(ida); --- p4_head/sys/dev/idt/idt_pci.c Sun Jan 21 15:17:20 2007 +++ p4_head_intr/sys/dev/idt/idt_pci.c Fri Jan 26 13:54:08 2007 @@ -160,7 +160,7 @@ goto fail; } - error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, nicstar_intr, + error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, NULL, nicstar_intr, sc, &sc->irq_ih); if (error) { device_printf(dev, "could not setup irq.\n"); --- p4_head/sys/dev/ie/if_ie_isa.c Sun Jan 21 15:17:20 2007 +++ p4_head_intr/sys/dev/ie/if_ie_isa.c Fri Jan 26 13:54:08 2007 @@ -270,7 +270,7 @@ } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - ie_intr, sc, &sc->irq_ih); + NULL, ie_intr, sc, &sc->irq_ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); goto bad; @@ -561,7 +561,7 @@ } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - ie_intr, sc, &sc->irq_ih); + NULL, ie_intr, sc, &sc->irq_ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); goto bad; @@ -773,7 +773,7 @@ } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - ie_intr, sc, &sc->irq_ih); + NULL, ie_intr, sc, &sc->irq_ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); goto bad; --- p4_head/sys/dev/iir/iir_pci.c Sun Jan 21 15:17:21 2007 +++ p4_head_intr/sys/dev/iir/iir_pci.c Fri Jan 26 13:54:08 2007 @@ -344,7 +344,7 @@ /* associate interrupt handler */ if (bus_setup_intr( dev, irq, INTR_TYPE_CAM, - iir_intr, gdt, &ih )) { + NULL, iir_intr, gdt, &ih )) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto err; --- p4_head/sys/dev/ipmi/ipmi.c Sun Jan 21 15:17:21 2007 +++ p4_head_intr/sys/dev/ipmi/ipmi.c Fri Jan 26 13:54:08 2007 @@ -845,7 +845,7 @@ if (sc->ipmi_irq_res != NULL && sc->ipmi_intr != NULL) { error = bus_setup_intr(dev, sc->ipmi_irq_res, INTR_TYPE_MISC, - sc->ipmi_intr, sc, &sc->ipmi_irq); + NULL, sc->ipmi_intr, sc, &sc->ipmi_irq); if (error) { device_printf(dev, "can't set up interrupt\n"); return (error); --- p4_head/sys/dev/ips/ips_pci.c Sun Jan 21 15:17:22 2007 +++ p4_head_intr/sys/dev/ips/ips_pci.c Fri Jan 26 13:54:08 2007 @@ -130,7 +130,8 @@ device_printf(dev, "irq allocation failed\n"); goto error; } - if(bus_setup_intr(dev, sc->irqres, INTR_TYPE_BIO|INTR_MPSAFE, sc->ips_adapter_intr, sc, &sc->irqcookie)){ + if(bus_setup_intr(dev, sc->irqres, INTR_TYPE_BIO|INTR_MPSAFE, NULL, + sc->ips_adapter_intr, sc, &sc->irqcookie)){ device_printf(dev, "irq setup failed\n"); goto error; } --- p4_head/sys/dev/ipw/if_ipw.c Sun Jan 21 15:17:22 2007 +++ p4_head_intr/sys/dev/ipw/if_ipw.c Fri Jan 26 13:54:08 2007 @@ -348,7 +348,7 @@ * Hook our interrupt after all initialization is complete. */ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, - ipw_intr, sc, &sc->sc_ih); + NULL, ipw_intr, sc, &sc->sc_ih); if (error != 0) { device_printf(dev, "could not set up interrupt\n"); goto fail; --- p4_head/sys/dev/isp/isp_pci.c Sun Jan 21 15:17:23 2007 +++ p4_head_intr/sys/dev/isp/isp_pci.c Fri Jan 26 13:54:08 2007 @@ -1136,7 +1136,7 @@ locksetup++; #endif - if (bus_setup_intr(dev, irq, ISP_IFLAGS, isp_pci_intr, isp, &pcs->ih)) { + if (bus_setup_intr(dev, irq, ISP_IFLAGS, NULL, isp_pci_intr, isp, &pcs->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; } --- p4_head/sys/dev/isp/isp_sbus.c Sun Jan 21 15:17:23 2007 +++ p4_head_intr/sys/dev/isp/isp_sbus.c Fri Jan 26 13:54:08 2007 @@ -312,7 +312,7 @@ } if (bus_setup_intr(dev, sbs->sbus_ires, ISP_IFLAGS, - isp_sbus_intr, isp, &sbs->ih)) { + NULL, isp_sbus_intr, isp, &sbs->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; } --- p4_head/sys/dev/iwi/if_iwi.c Sun Jan 21 15:17:32 2007 +++ p4_head_intr/sys/dev/iwi/if_iwi.c Fri Jan 26 13:54:08 2007 @@ -468,7 +468,7 @@ * Hook our interrupt after all initialization is complete. */ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, - iwi_intr, sc, &sc->sc_ih); + NULL, iwi_intr, sc, &sc->sc_ih); if (error != 0) { device_printf(dev, "could not set up interrupt\n"); goto fail; --- p4_head/sys/dev/ixgb/if_ixgb.c Sun Jan 21 15:17:33 2007 +++ p4_head_intr/sys/dev/ixgb/if_ixgb.c Fri Jan 26 13:54:08 2007 @@ -1268,7 +1268,7 @@ } if (bus_setup_intr(dev, adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, - (void (*) (void *))ixgb_intr, adapter, + NULL, (void (*) (void *))ixgb_intr, adapter, &adapter->int_handler_tag)) { printf("ixgb%d: Error registering interrupt handler!\n", adapter->unit); --- p4_head/sys/dev/le/if_le_cbus.c Sun Jan 21 15:17:34 2007 +++ p4_head_intr/sys/dev/le/if_le_cbus.c Fri Jan 26 13:54:08 2007 @@ -377,7 +377,7 @@ } error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE, - am7990_intr, sc, &lesc->sc_ih); + NULL, am7990_intr, sc, &lesc->sc_ih); if (error != 0) { device_printf(dev, "cannot set up interrupt\n"); goto fail_am7990; --- p4_head/sys/dev/le/if_le_isa.c Sun Jan 21 15:17:34 2007 +++ p4_head_intr/sys/dev/le/if_le_isa.c Fri Jan 26 13:54:08 2007 @@ -432,7 +432,7 @@ } error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE, - am7990_intr, sc, &lesc->sc_ih); + NULL, am7990_intr, sc, &lesc->sc_ih); if (error != 0) { device_printf(dev, "cannot set up interrupt\n"); goto fail_am7990; --- p4_head/sys/dev/le/if_le_lebuffer.c Sun Jan 21 15:17:34 2007 +++ p4_head_intr/sys/dev/le/if_le_lebuffer.c Fri Jan 26 13:54:08 2007 @@ -341,7 +341,7 @@ } error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE, - am7990_intr, sc, &lesc->sc_ih); + NULL, am7990_intr, sc, &lesc->sc_ih); if (error != 0) { device_printf(dev, "cannot set up interrupt\n"); goto fail_am7990; --- p4_head/sys/dev/le/if_le_ledma.c Sun Jan 21 15:17:34 2007 +++ p4_head_intr/sys/dev/le/if_le_ledma.c Fri Jan 26 13:54:08 2007 @@ -419,7 +419,7 @@ } error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE, - am7990_intr, sc, &lesc->sc_ih); + NULL, am7990_intr, sc, &lesc->sc_ih); if (error != 0) { device_printf(dev, "cannot set up interrupt\n"); goto fail_am7990; --- p4_head/sys/dev/le/if_le_pci.c Sun Jan 21 15:17:34 2007 +++ p4_head_intr/sys/dev/le/if_le_pci.c Fri Jan 26 13:54:08 2007 @@ -442,7 +442,7 @@ } error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE, - am79900_intr, sc, &lesc->sc_ih); + NULL, am79900_intr, sc, &lesc->sc_ih); if (error != 0) { device_printf(dev, "cannot set up interrupt\n"); goto fail_am79900; --- p4_head/sys/dev/lge/if_lge.c Sun Jan 21 15:17:34 2007 +++ p4_head_intr/sys/dev/lge/if_lge.c Fri Jan 26 13:54:08 2007 @@ -573,7 +573,7 @@ ether_ifattach(ifp, eaddr); error = bus_setup_intr(dev, sc->lge_irq, INTR_TYPE_NET | INTR_MPSAFE, - lge_intr, sc, &sc->lge_intrhand); + NULL, lge_intr, sc, &sc->lge_intrhand); if (error) { ether_ifdetach(ifp); --- p4_head/sys/dev/lmc/if_lmc.c Sun Jan 21 15:17:35 2007 +++ p4_head_intr/sys/dev/lmc/if_lmc.c Fri Jan 26 13:54:08 2007 @@ -5700,7 +5700,7 @@ return ENXIO; } if ((error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - bsd_interrupt, sc, &sc->irq_cookie))) + NULL, bsd_interrupt, sc, &sc->irq_cookie))) { printf("%s: bus_setup_intr() failed; error %d\n", NAME_UNIT, error); fbsd_detach(dev); --- p4_head/sys/dev/mfi/mfi.c Sun Jan 21 15:17:36 2007 +++ p4_head_intr/sys/dev/mfi/mfi.c Fri Jan 26 13:54:08 2007 @@ -360,7 +360,7 @@ return (EINVAL); } if (bus_setup_intr(sc->mfi_dev, sc->mfi_irq, INTR_MPSAFE|INTR_TYPE_BIO, - mfi_intr, sc, &sc->mfi_intr)) { + NULL, mfi_intr, sc, &sc->mfi_intr)) { device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); return (EINVAL); } --- p4_head/sys/dev/mlx/mlx.c Sun Jan 21 15:17:38 2007 +++ p4_head_intr/sys/dev/mlx/mlx.c Fri Jan 26 13:54:08 2007 @@ -364,7 +364,7 @@ device_printf(sc->mlx_dev, "can't allocate interrupt\n"); return(ENXIO); } - error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | INTR_ENTROPY, mlx_intr, sc, &sc->mlx_intr); + error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | INTR_ENTROPY, NULL, mlx_intr, sc, &sc->mlx_intr); if (error) { device_printf(sc->mlx_dev, "can't set up interrupt\n"); return(ENXIO); --- p4_head/sys/dev/mly/mly.c Sun Jan 21 15:17:39 2007 +++ p4_head_intr/sys/dev/mly/mly.c Fri Jan 26 13:54:08 2007 @@ -380,7 +380,7 @@ mly_printf(sc, "can't allocate interrupt\n"); goto fail; } - if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM | INTR_ENTROPY, mly_intr, sc, &sc->mly_intr)) { + if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM | INTR_ENTROPY, NULL, mly_intr, sc, &sc->mly_intr)) { mly_printf(sc, "can't set up interrupt\n"); goto fail; } --- p4_head/sys/dev/mpt/mpt_pci.c Sun Jan 21 15:17:41 2007 +++ p4_head_intr/sys/dev/mpt/mpt_pci.c Fri Jan 26 13:54:08 2007 @@ -548,7 +548,7 @@ mpt_disable_ints(mpt); /* Register the interrupt handler */ - if (bus_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, mpt_pci_intr, + if (bus_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, NULL, mpt_pci_intr, mpt, &mpt->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; --- p4_head/sys/dev/mse/mse.c Sun Jan 21 15:17:42 2007 +++ p4_head_intr/sys/dev/mse/mse.c Fri Jan 26 13:54:08 2007 @@ -134,7 +134,7 @@ } if (bus_setup_intr(dev, sc->sc_intr, - INTR_TYPE_TTY, mseintr, sc, &sc->sc_ih)) { + INTR_TYPE_TTY, NULL, mseintr, sc, &sc->sc_ih)) { bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); bus_release_resource(dev, SYS_RES_IRQ, rid, sc->sc_intr); return ENXIO; --- p4_head/sys/dev/msk/if_msk.c Sun Jan 21 15:17:42 2007 +++ p4_head_intr/sys/dev/msk/if_msk.c Fri Jan 26 13:54:08 2007 @@ -228,7 +228,7 @@ static int msk_detach(device_t); static void msk_tick(void *); -static void msk_intr(void *); +static int msk_intr(void *); static void msk_int_task(void *, int); static void msk_intr_phy(struct msk_if_softc *); static void msk_intr_gmac(struct msk_if_softc *); @@ -1784,7 +1784,7 @@ device_get_nameunit(sc->msk_dev)); /* Hook interrupt last to avoid having to lock softc. */ error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET | - INTR_MPSAFE | INTR_FAST, msk_intr, sc, &sc->msk_intrhand[0]); + INTR_MPSAFE, msk_intr, NULL, sc, &sc->msk_intrhand[0]); if (error != 0) { device_printf(dev, "couldn't set up interrupt handler\n"); @@ -3481,7 +3481,7 @@ return (sc->msk_stat_cons != CSR_READ_2(sc, STAT_PUT_IDX)); } -static void +static int msk_intr(void *xsc) { struct msk_softc *sc; @@ -3492,10 +3492,11 @@ /* Reading B0_Y2_SP_ISRC2 masks further interrupts. */ if (status == 0 || status == 0xffffffff) { CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); - return; + return (FILTER_STRAY); } taskqueue_enqueue(sc->msk_tq, &sc->msk_int_task); + return (FILTER_HANDLED); } static void --- p4_head/sys/dev/mxge/if_mxge.c Sun Jan 21 15:17:44 2007 +++ p4_head_intr/sys/dev/mxge/if_mxge.c Fri Jan 26 13:54:08 2007 @@ -2407,7 +2407,7 @@ err = bus_setup_intr(sc->dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - mxge_intr, sc, &sc->ih); + NULL, mxge_intr, sc, &sc->ih); if (err != 0) { goto abort_with_rings; } --- p4_head/sys/dev/my/if_my.c Sun Jan 21 15:17:44 2007 +++ p4_head_intr/sys/dev/my/if_my.c Fri Jan 26 13:54:08 2007 @@ -958,7 +958,7 @@ ether_ifattach(ifp, eaddr); error = bus_setup_intr(dev, sc->my_irq, INTR_TYPE_NET | INTR_MPSAFE, - my_intr, sc, &sc->my_intrhand); + NULL, my_intr, sc, &sc->my_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/dev/ncv/ncr53c500_pccard.c Sun Jan 21 15:17:44 2007 +++ p4_head_intr/sys/dev/ncv/ncr53c500_pccard.c Fri Jan 26 13:54:08 2007 @@ -246,7 +246,7 @@ return(ENXIO); } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - ncv_pccard_intr, (void *)sc, &sc->ncv_intrhand); + NULL, ncv_pccard_intr, (void *)sc, &sc->ncv_intrhand); if (error) { ncv_release_resource(dev); return(error); --- p4_head/sys/dev/nfe/if_nfe.c Sun Jan 21 15:17:45 2007 +++ p4_head_intr/sys/dev/nfe/if_nfe.c Fri Jan 26 13:54:08 2007 @@ -409,7 +409,7 @@ ether_ifattach(ifp, sc->eaddr); error = bus_setup_intr(dev, sc->nfe_irq, INTR_TYPE_NET | INTR_MPSAFE, - nfe_intr, sc, &sc->nfe_intrhand); + NULL, nfe_intr, sc, &sc->nfe_intrhand); if (error) { printf("nfe%d: couldn't set up irq\n", unit); --- p4_head/sys/dev/nge/if_nge.c Sun Jan 21 15:17:45 2007 +++ p4_head_intr/sys/dev/nge/if_nge.c Fri Jan 26 13:54:08 2007 @@ -915,7 +915,7 @@ * Hookup IRQ last. */ error = bus_setup_intr(dev, sc->nge_irq, INTR_TYPE_NET | INTR_MPSAFE, - nge_intr, sc, &sc->nge_intrhand); + NULL, nge_intr, sc, &sc->nge_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); goto fail; --- p4_head/sys/dev/nsp/nsp_pccard.c Sun Jan 21 15:17:46 2007 +++ p4_head_intr/sys/dev/nsp/nsp_pccard.c Fri Jan 26 13:54:08 2007 @@ -187,7 +187,7 @@ return(ENXIO); } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - nsp_pccard_intr, (void *)sc, &sc->nsp_intrhand); + NULL, nsp_pccard_intr, (void *)sc, &sc->nsp_intrhand); if (error) { nsp_release_resource(dev); return(error); --- p4_head/sys/dev/nve/if_nve.c Sun Jan 21 15:17:46 2007 +++ p4_head_intr/sys/dev/nve/if_nve.c Fri Jan 26 13:54:08 2007 @@ -536,7 +536,7 @@ /* Activate our interrupt handler. - attach last to avoid lock */ error = bus_setup_intr(sc->dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, - nve_intr, sc, &sc->sc_ih); + NULL, nve_intr, sc, &sc->sc_ih); if (error) { device_printf(sc->dev, "couldn't set up interrupt handler\n"); goto fail; --- p4_head/sys/dev/patm/if_patm_attach.c Sun Jan 21 15:17:47 2007 +++ p4_head_intr/sys/dev/patm/if_patm_attach.c Fri Jan 26 13:54:08 2007 @@ -442,7 +442,7 @@ patm_debug(sc, ATTACH, "attaching interrupt handler"); error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET | INTR_MPSAFE, - patm_intr, sc, &sc->ih); + NULL, patm_intr, sc, &sc->ih); if (error != 0) { patm_printf(sc, "could not setup interrupt\n"); atm_ifdetach(sc->ifp); --- p4_head/sys/dev/pccard/pccard.c Sun Jan 21 15:17:47 2007 +++ p4_head_intr/sys/dev/pccard/pccard.c Fri Jan 26 13:54:08 2007 @@ -118,10 +118,10 @@ static int pccard_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); static void pccard_child_detached(device_t parent, device_t dev); -static void pccard_intr(void *arg); +static int pccard_intr(void *arg); static int pccard_setup_intr(device_t dev, device_t child, - struct resource *irq, int flags, driver_intr_t *intr, - void *arg, void **cookiep); + struct resource *irq, int flags, driver_filter_t *filt, + driver_intr_t *intr, void *arg, void **cookiep); static int pccard_teardown_intr(device_t dev, device_t child, struct resource *r, void *cookie); @@ -1173,7 +1173,7 @@ pccard_function_disable(pf); } -static void +static int pccard_intr(void *arg) { struct pccard_function *pf = (struct pccard_function*) arg; @@ -1204,13 +1204,19 @@ else doisr = 0; } - if (pf->intr_handler != NULL && doisr) - pf->intr_handler(pf->intr_handler_arg); + if (doisr) { + if (pf->filt_handler != NULL) + pf->filt_handler(pf->intr_handler_arg); + else + pf->intr_handler(pf->intr_handler_arg); + } + return (FILTER_HANDLED); } static int pccard_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) { struct pccard_softc *sc = PCCARD_SOFTC(dev); struct pccard_ivar *ivar = PCCARD_IVAR(child); @@ -1219,10 +1225,17 @@ if (pf->intr_handler != NULL) panic("Only one interrupt handler per function allowed"); - err = bus_generic_setup_intr(dev, child, irq, flags, pccard_intr, - pf, cookiep); + if (filt != NULL && intr != NULL) + return (EINVAL); + if (filt != NULL) + err = bus_generic_setup_intr(dev, child, irq, flags, + pccard_intr, NULL, pf, cookiep); + else + err = bus_generic_setup_intr(dev, child, irq, flags, + NULL, (driver_intr_t *)pccard_intr, pf, cookiep); if (err != 0) return (err); + pf->filt_handler = filt; pf->intr_handler = intr; pf->intr_handler_arg = arg; pf->intr_handler_cookie = *cookiep; --- p4_head/sys/dev/pccard/pccardvarp.h Sun Jan 21 15:17:48 2007 +++ p4_head_intr/sys/dev/pccard/pccardvarp.h Fri Jan 26 13:54:08 2007 @@ -112,6 +112,7 @@ bus_addr_t pf_mfc_iobase; bus_addr_t pf_mfc_iomax; int pf_flags; + driver_filter_t *filt_handler; driver_intr_t *intr_handler; void *intr_handler_arg; void *intr_handler_cookie; --- p4_head/sys/dev/pccbb/pccbb.c Sun Jan 21 15:17:48 2007 +++ p4_head_intr/sys/dev/pccbb/pccbb.c Fri Jan 26 13:54:08 2007 @@ -348,7 +348,8 @@ int cbb_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) { struct cbb_intrhand *ih; struct cbb_softc *sc = device_get_softc(dev); @@ -360,7 +361,7 @@ * least common denominator until the base system supports mixing * and matching better. */ - if ((flags & INTR_FAST) != 0) + if (filt != NULL) return (EINVAL); ih = malloc(sizeof(struct cbb_intrhand), M_DEVBUF, M_NOWAIT); if (ih == NULL) @@ -374,7 +375,7 @@ * XXX for now that's all we need to do. */ err = BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags, - cbb_func_intr, ih, &ih->cookie); + NULL, cbb_func_intr, ih, &ih->cookie); if (err != 0) { free(ih, M_DEVBUF); return (err); --- p4_head/sys/dev/pccbb/pccbb_pci.c Sun Jan 21 15:17:48 2007 +++ p4_head_intr/sys/dev/pccbb/pccbb_pci.c Fri Jan 26 13:54:08 2007 @@ -400,7 +400,7 @@ } if (bus_setup_intr(brdev, sc->irq_res, INTR_TYPE_AV | INTR_MPSAFE, - cbb_pci_intr, sc, &sc->intrhand)) { + NULL, cbb_pci_intr, sc, &sc->intrhand)) { device_printf(brdev, "couldn't establish interrupt\n"); goto err; } --- p4_head/sys/dev/pccbb/pccbbvar.h Sun Jan 21 15:17:48 2007 +++ p4_head_intr/sys/dev/pccbb/pccbbvar.h Fri Jan 26 13:54:08 2007 @@ -136,7 +136,8 @@ int type, int rid, struct resource *r); int cbb_resume(device_t self); int cbb_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, void **cookiep); + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep); int cbb_suspend(device_t self); int cbb_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); --- p4_head/sys/dev/pcf/envctrl.c Sun Jan 21 15:17:48 2007 +++ p4_head_intr/sys/dev/pcf/envctrl.c Fri Jan 26 13:54:08 2007 @@ -135,7 +135,7 @@ rv = bus_setup_intr(dev, sc->res_irq, INTR_TYPE_NET /* | INTR_ENTROPY */, - pcf_intr, sc, &sc->intr_cookie); + NULL, pcf_intr, sc, &sc->intr_cookie); if (rv) { device_printf(dev, "could not setup IRQ\n"); goto error; --- p4_head/sys/dev/pcf/pcf_ebus.c Sun Jan 21 15:17:48 2007 +++ p4_head_intr/sys/dev/pcf/pcf_ebus.c Fri Jan 26 13:54:08 2007 @@ -194,7 +194,7 @@ if (sc->res_irq) { rv = bus_setup_intr(dev, sc->res_irq, - INTR_TYPE_NET /* | INTR_ENTROPY */, pcf_intr, sc, + INTR_TYPE_NET /* | INTR_ENTROPY */, NULL, pcf_intr, sc, &sc->intr_cookie); if (rv) { device_printf(dev, "could not setup IRQ\n"); --- p4_head/sys/dev/pcf/pcf_isa.c Sun Jan 21 15:17:48 2007 +++ p4_head_intr/sys/dev/pcf/pcf_isa.c Fri Jan 26 13:54:08 2007 @@ -155,7 +155,7 @@ if (sc->res_irq) { rv = bus_setup_intr(dev, sc->res_irq, INTR_TYPE_NET /* | INTR_ENTROPY */, - pcf_intr, sc, &sc->intr_cookie); + NULL, pcf_intr, sc, &sc->intr_cookie); if (rv) { device_printf(dev, "could not setup IRQ\n"); goto error; --- p4_head/sys/dev/ppbus/if_plip.c Sun Jan 21 15:17:49 2007 +++ p4_head_intr/sys/dev/ppbus/if_plip.c Fri Jan 26 13:54:08 2007 @@ -358,7 +358,7 @@ /* attach our interrupt handler, later detached when the bus is released */ if ((error = bus_setup_intr(dev, sc->res_irq, - INTR_TYPE_NET, lp_intr, dev, &ih))) { + INTR_TYPE_NET, NULL, lp_intr, dev, &ih))) { ppb_release_bus(ppbus, dev); return (error); } --- p4_head/sys/dev/ppbus/lpt.c Sun Jan 21 15:17:49 2007 +++ p4_head_intr/sys/dev/ppbus/lpt.c Fri Jan 26 13:54:08 2007 @@ -760,7 +760,7 @@ if (sc->sc_irq & LP_USE_IRQ) { /* register our interrupt handler */ err = bus_setup_intr(lptdev, sc->intr_resource, - INTR_TYPE_TTY, lpt_intr, lptdev, + INTR_TYPE_TTY, NULL, lpt_intr, lptdev, &sc->intr_cookie); if (err) { device_printf(lptdev, "handler registration failed, polled mode.\n"); --- p4_head/sys/dev/ppbus/ppbconf.c Sun Jan 21 15:17:50 2007 +++ p4_head_intr/sys/dev/ppbus/ppbconf.c Fri Jan 26 13:54:08 2007 @@ -417,7 +417,7 @@ static int ppbus_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep) { int error; struct ppb_data *ppb = DEVTOSOFTC(bus); @@ -428,7 +428,7 @@ return (EINVAL); if ((error = BUS_SETUP_INTR(device_get_parent(bus), child, r, flags, - ihand, arg, cookiep))) + filt, ihand, arg, cookiep))) return (error); /* store the resource and the cookie for eventually forcing --- p4_head/sys/dev/ppbus/pps.c Sun Jan 21 15:17:50 2007 +++ p4_head_intr/sys/dev/ppbus/pps.c Fri Jan 26 13:54:08 2007 @@ -51,7 +51,7 @@ void *intr_cookie; /* interrupt registration cookie */ }; -static void ppsintr(void *arg); +static int ppsintr(void *arg); static void ppshcpoll(void *arg); #define DEVTOSOFTC(dev) \ @@ -205,7 +205,7 @@ /* attach the interrupt handler */ if ((error = bus_setup_intr(ppsdev, sc->intr_resource, - (INTR_TYPE_TTY | INTR_MPSAFE | INTR_FAST), ppsintr, + (INTR_TYPE_TTY | INTR_MPSAFE), ppsintr, NULL, sc, &sc->intr_cookie))) { ppb_release_bus(ppbus, ppsdev); return (error); @@ -276,14 +276,14 @@ mtx_unlock_spin(&sc->mtx); } -static void +static int ppsintr(void *arg) { struct pps_data *sc = (struct pps_data *)arg; pps_capture(&sc->pps[0]); if (!(ppb_rstr(sc->ppbus) & nACK)) - return; + return (FILTER_STRAY); if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT) ppb_wctr(sc->ppbus, IRQENABLE | AUTOFEED); mtx_lock_spin(&sc->mtx); @@ -291,6 +291,7 @@ mtx_unlock_spin(&sc->mtx); if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT) ppb_wctr(sc->ppbus, IRQENABLE); + return (FILTER_HANDLED); } static int --- p4_head/sys/dev/ppc/ppc.c Sun Jan 21 15:17:50 2007 +++ p4_head_intr/sys/dev/ppc/ppc.c Fri Jan 26 13:54:08 2007 @@ -1822,7 +1822,7 @@ if (ppc->res_irq) { /* default to the tty mask for registration */ /* XXX */ if (bus_setup_intr(dev, ppc->res_irq, INTR_TYPE_TTY, - ppcintr, dev, &ppc->intr_cookie) == 0) { + NULL, ppcintr, dev, &ppc->intr_cookie) == 0) { /* remember the ppcintr is registered */ ppc->ppc_registered = 1; @@ -1963,7 +1963,7 @@ */ int ppc_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep) { int error; struct ppc_data *ppc = DEVTOSOFTC(bus); @@ -1985,7 +1985,7 @@ /* pass registration to the upper layer, ignore the incoming resource */ return (BUS_SETUP_INTR(device_get_parent(bus), child, - r, flags, ihand, arg, cookiep)); + r, flags, filt, ihand, arg, cookiep)); } /* @@ -2006,7 +2006,7 @@ /* default to the tty mask for registration */ /* XXX */ if (ppc->ppc_irq && !(error = BUS_SETUP_INTR(parent, bus, ppc->res_irq, - INTR_TYPE_TTY, ppcintr, bus, &ppc->intr_cookie))) { + INTR_TYPE_TTY, NULL, ppcintr, bus, &ppc->intr_cookie))) { /* remember the ppcintr is registered */ ppc->ppc_registered = 1; --- p4_head/sys/dev/ppc/ppcvar.h Sun Jan 21 15:17:51 2007 +++ p4_head_intr/sys/dev/ppc/ppcvar.h Fri Jan 26 13:54:08 2007 @@ -40,7 +40,7 @@ int ppc_exec_microseq(device_t, struct ppb_microseq **); int ppc_setup_intr(device_t, device_t, struct resource *, int, - void (*)(void *), void *, void **); + driver_filter_t *filt, void (*)(void *), void *, void **); int ppc_teardown_intr(device_t, device_t, struct resource *, void *); void ppc_reset_epp(device_t); void ppc_ecp_sync(device_t); --- p4_head/sys/dev/pst/pst-iop.c Sun Jan 21 15:17:51 2007 +++ p4_head_intr/sys/dev/pst/pst-iop.c Fri Jan 26 13:54:08 2007 @@ -159,7 +159,7 @@ /* setup and enable interrupts */ bus_setup_intr(sc->dev, sc->r_irq, INTR_TYPE_BIO|INTR_ENTROPY|INTR_MPSAFE, - iop_intr, sc, &sc->handle); + NULL, iop_intr, sc, &sc->handle); sc->reg->oqueue_intr_mask = 0x0; } --- p4_head/sys/dev/puc/puc.c Sun Jan 21 15:17:51 2007 +++ p4_head_intr/sys/dev/puc/puc.c Fri Jan 26 13:54:08 2007 @@ -59,7 +59,7 @@ int p_hasintr:1; - driver_intr_t *p_ih; + driver_filter_t *p_ih; serdev_intr_t *p_ihsrc[PUC_ISRCCNT]; void *p_iharg; @@ -125,7 +125,7 @@ return (bar); } -static void +static int puc_intr(void *arg) { struct puc_port *port; @@ -183,7 +183,9 @@ if (port->p_ihsrc[i] != NULL) (*port->p_ihsrc[i])(port->p_iharg); } + return (FILTER_HANDLED); } + return (FILTER_STRAY); } int @@ -312,11 +314,11 @@ RF_ACTIVE|RF_SHAREABLE); if (sc->sc_ires != NULL) { error = bus_setup_intr(dev, sc->sc_ires, - INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->sc_icookie); + INTR_TYPE_TTY, puc_intr, NULL, sc, &sc->sc_icookie); if (error) error = bus_setup_intr(dev, sc->sc_ires, - INTR_TYPE_TTY | INTR_MPSAFE, puc_intr, sc, - &sc->sc_icookie); + INTR_TYPE_TTY | INTR_MPSAFE, NULL, + (driver_intr_t *)puc_intr, sc, &sc->sc_icookie); else sc->sc_fastintr = 1; @@ -583,7 +585,7 @@ int puc_bus_setup_intr(device_t dev, device_t child, struct resource *res, - int flags, void (*ihand)(void *), void *arg, void **cookiep) + int flags, driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep) { struct puc_port *port; struct puc_softc *sc; @@ -602,7 +604,7 @@ port = device_get_ivars(child); KASSERT(port != NULL, ("%s %d", __func__, __LINE__)); - if (ihand == NULL || cookiep == NULL || res != port->p_ires) + if (filt == NULL || cookiep == NULL || res != port->p_ires) return (EINVAL); if (rman_get_device(port->p_ires) != originator) return (ENXIO); @@ -624,16 +626,16 @@ } if (!serdev) return (BUS_SETUP_INTR(device_get_parent(dev), originator, - sc->sc_ires, flags, ihand, arg, cookiep)); + sc->sc_ires, flags, filt, ihand, arg, cookiep)); /* We demand that serdev devices use fast interrupts. */ - if (!(flags & INTR_FAST)) + if (filt == NULL) return (ENXIO); sc->sc_serdevs |= 1UL << (port->p_nr - 1); port->p_hasintr = 1; - port->p_ih = ihand; + port->p_ih = filt; port->p_iharg = arg; *cookiep = port; --- p4_head/sys/dev/puc/puc_bfe.h Sun Jan 21 15:17:51 2007 +++ p4_head_intr/sys/dev/puc/puc_bfe.h Fri Jan 26 13:54:08 2007 @@ -88,7 +88,7 @@ int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *); int puc_bus_release_resource(device_t, device_t, int, int, struct resource *); int puc_bus_setup_intr(device_t, device_t, struct resource *, int, - driver_intr_t *, void *, void **); + driver_filter_t *, driver_intr_t *, void *, void **); int puc_bus_teardown_intr(device_t, device_t, struct resource *, void *); #endif /* _DEV_PUC_BFE_H_ */ --- p4_head/sys/dev/ral/if_ral_pci.c Sun Jan 21 15:17:51 2007 +++ p4_head_intr/sys/dev/ral/if_ral_pci.c Fri Jan 26 13:54:08 2007 @@ -209,7 +209,7 @@ * Hook our interrupt after all initialization is complete. */ error = bus_setup_intr(dev, psc->irq, INTR_TYPE_NET | INTR_MPSAFE, - psc->sc_opns->intr, psc, &psc->sc_ih); + NULL, psc->sc_opns->intr, psc, &psc->sc_ih); if (error != 0) { device_printf(dev, "could not set up interrupt\n"); return error; --- p4_head/sys/dev/ray/if_ray.c Sun Jan 21 15:17:52 2007 +++ p4_head_intr/sys/dev/ray/if_ray.c Fri Jan 26 13:54:08 2007 @@ -3749,7 +3749,7 @@ return (ENOMEM); } if ((error = bus_setup_intr(sc->dev, sc->irq_res, INTR_TYPE_NET, - ray_intr, sc, &sc->irq_handle)) != 0) { + NULL, ray_intr, sc, &sc->irq_handle)) != 0) { RAY_PRINTF(sc, "Failed to setup irq"); return (error); } --- p4_head/sys/dev/rc/rc.c Sun Jan 21 15:17:53 2007 +++ p4_head_intr/sys/dev/rc/rc.c Fri Jan 26 13:54:08 2007 @@ -304,8 +304,8 @@ ttycreate(tp, TS_CALLOUT, "m%d", chan + base); } - error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_TTY, rc_intr, sc, - &sc->sc_hwicookie); + error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_TTY, NULL, rc_intr, + sc, &sc->sc_hwicookie); if (error) { device_printf(dev, "failed to register interrupt handler\n"); goto fail; --- p4_head/sys/dev/re/if_re.c Sun Jan 21 15:17:53 2007 +++ p4_head_intr/sys/dev/re/if_re.c Fri Jan 26 13:54:08 2007 @@ -241,7 +241,7 @@ static void re_poll (struct ifnet *, enum poll_cmd, int); static void re_poll_locked (struct ifnet *, enum poll_cmd, int); #endif -static void re_intr (void *); +static int re_intr (void *); static void re_tick (void *); static void re_tx_task (void *, int); static void re_int_task (void *, int); @@ -1318,8 +1318,8 @@ #endif /* Hook interrupt last to avoid having to lock softc */ - error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE | - INTR_FAST, re_intr, sc, &sc->rl_intrhand); + error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE, + re_intr, NULL, sc, &sc->rl_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); @@ -1927,7 +1927,7 @@ } #endif /* DEVICE_POLLING */ -static void +static int re_intr(arg) void *arg; { @@ -1938,12 +1938,12 @@ status = CSR_READ_2(sc, RL_ISR); if (status == 0xFFFF || (status & RL_INTRS_CPLUS) == 0) - return; + return (FILTER_STRAY); CSR_WRITE_2(sc, RL_IMR, 0); taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_inttask); - return; + return (FILTER_HANDLED); } static void --- p4_head/sys/dev/rr232x/osm_bsd.c Sun Jan 21 15:17:55 2007 +++ p4_head_intr/sys/dev/rr232x/osm_bsd.c Fri Jan 26 13:54:08 2007 @@ -1131,7 +1131,7 @@ } if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, - hpt_pci_intr, vbus_ext, &hba->irq_handle)) + NULL, hpt_pci_intr, vbus_ext, &hba->irq_handle)) { os_printk("can't set up interrupt"); return ; --- p4_head/sys/dev/safe/safe.c Sun Jan 21 15:17:56 2007 +++ p4_head_intr/sys/dev/safe/safe.c Fri Jan 26 13:54:08 2007 @@ -265,7 +265,7 @@ * so make sure the IRQ is mapped appropriately. */ if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - safe_intr, sc, &sc->sc_ih)) { + NULL, safe_intr, sc, &sc->sc_ih)) { device_printf(dev, "could not establish interrupt\n"); goto bad2; } --- p4_head/sys/dev/sbni/if_sbni_isa.c Sun Jan 21 15:17:56 2007 +++ p4_head_intr/sys/dev/sbni/if_sbni_isa.c Fri Jan 26 13:54:08 2007 @@ -123,7 +123,7 @@ printf(" irq %ld\n", rman_get_start(sc->irq_res)); error = bus_setup_intr( dev, sc->irq_res, INTR_TYPE_NET, - sbni_intr, sc, &sc->irq_handle); + NULL, sbni_intr, sc, &sc->irq_handle); if (error) { printf("sbni%d: bus_setup_intr\n", next_sbni_unit); bus_release_resource( --- p4_head/sys/dev/sbni/if_sbni_pci.c Sun Jan 21 15:17:56 2007 +++ p4_head_intr/sys/dev/sbni/if_sbni_pci.c Fri Jan 26 13:54:08 2007 @@ -137,7 +137,7 @@ if (sc->irq_res) { printf(" irq %ld\n", rman_get_start(sc->irq_res)); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - sbni_intr, sc, &sc->irq_handle); + NULL, sbni_intr, sc, &sc->irq_handle); if (error) { printf("sbni%d: bus_setup_intr\n", next_sbni_unit); goto attach_failed; --- p4_head/sys/dev/sbsh/if_sbsh.c Sun Jan 21 15:17:56 2007 +++ p4_head_intr/sys/dev/sbsh/if_sbsh.c Fri Jan 26 13:54:08 2007 @@ -256,7 +256,7 @@ init_card(sc); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - sbsh_intr, sc, &sc->intr_hand); + NULL, sbsh_intr, sc, &sc->intr_hand); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); bus_release_resource(dev, SYS_RES_MEMORY, --- p4_head/sys/dev/scc/scc_bfe.h Sun Jan 21 15:17:56 2007 +++ p4_head_intr/sys/dev/scc/scc_bfe.h Fri Jan 26 13:54:08 2007 @@ -76,7 +76,7 @@ int m_probed:1; int m_sysdev:1; - driver_intr_t *ih; + driver_filter_t *ih; serdev_intr_t *ih_src[SCC_ISRCCNT]; void *ih_arg; }; @@ -146,7 +146,7 @@ int scc_bus_read_ivar(device_t, device_t, int, uintptr_t *); int scc_bus_release_resource(device_t, device_t, int, int, struct resource *); int scc_bus_setup_intr(device_t, device_t, struct resource *, int, - void (*)(void *), void *, void **); + driver_filter_t *, void (*)(void *), void *, void **); int scc_bus_teardown_intr(device_t, device_t, struct resource *, void *); #endif /* _DEV_SCC_BFE_H_ */ --- p4_head/sys/dev/scc/scc_core.c Sun Jan 21 15:17:57 2007 +++ p4_head_intr/sys/dev/scc/scc_core.c Fri Jan 26 13:54:08 2007 @@ -50,7 +50,7 @@ MALLOC_DEFINE(M_SCC, "SCC", "SCC driver"); -static void +static int scc_bfe_intr(void *arg) { struct scc_softc *sc = arg; @@ -88,7 +88,9 @@ else SCC_ICLEAR(sc, ch); } + return (FILTER_HANDLED); } + return (FILTER_STRAY); } int @@ -217,12 +219,12 @@ if (ch->ch_ires == NULL) continue; error = bus_setup_intr(dev, ch->ch_ires, - INTR_TYPE_TTY | INTR_FAST, scc_bfe_intr, sc, + INTR_TYPE_TTY, scc_bfe_intr, NULL, sc, &ch->ch_icookie); if (error) { error = bus_setup_intr(dev, ch->ch_ires, - INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc, - &ch->ch_icookie); + INTR_TYPE_TTY | INTR_MPSAFE, NULL, + (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie); } else sc->sc_fastintr = 1; @@ -495,7 +497,7 @@ int scc_bus_setup_intr(device_t dev, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep) { struct scc_chan *ch; struct scc_mode *m; @@ -506,14 +508,14 @@ return (EINVAL); /* Interrupt handlers must be FAST or MPSAFE. */ - if ((flags & (INTR_FAST|INTR_MPSAFE)) == 0) + if (filt == NULL && !(flags & INTR_MPSAFE)) return (EINVAL); sc = device_get_softc(dev); if (sc->sc_polled) return (ENXIO); - if (sc->sc_fastintr && !(flags & INTR_FAST)) { + if (sc->sc_fastintr && filt == NULL) { sc->sc_fastintr = 0; for (c = 0; c < sc->sc_class->cl_channels; c++) { ch = &sc->sc_chan[c]; @@ -521,15 +523,15 @@ continue; bus_teardown_intr(dev, ch->ch_ires, ch->ch_icookie); bus_setup_intr(dev, ch->ch_ires, - INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc, - &ch->ch_icookie); + INTR_TYPE_TTY | INTR_MPSAFE, NULL, + (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie); } } m = device_get_ivars(child); m->m_hasintr = 1; - m->m_fastintr = (flags & INTR_FAST) ? 1 : 0; - m->ih = ihand; + m->m_fastintr = (filt != NULL) ? 1 : 0; + m->ih = (filt != NULL) ? filt : (driver_filter_t *)ihand; m->ih_arg = arg; i = 0, isrc = SER_INT_OVERRUN; --- p4_head/sys/dev/sio/sio.c Sun Jan 21 15:17:58 2007 +++ p4_head_intr/sys/dev/sio/sio.c Fri Jan 26 13:54:08 2007 @@ -263,7 +263,7 @@ static int comopen(struct tty *tp, struct cdev *dev); static void sioinput(struct com_s *com); static void siointr1(struct com_s *com); -static void siointr(void *arg); +static int siointr(void *arg); static int commodem(struct tty *tp, int sigon, int sigoff); static int comparam(struct tty *tp, struct termios *t); static void siopoll(void *); @@ -1075,12 +1075,13 @@ com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (com->irqres) { ret = bus_setup_intr(dev, com->irqres, - INTR_TYPE_TTY | INTR_FAST, - siointr, com, &com->cookie); + INTR_TYPE_TTY, + siointr, NULL, com, + &com->cookie); if (ret) { ret = bus_setup_intr(dev, com->irqres, INTR_TYPE_TTY, - siointr, com, &com->cookie); + NULL, (driver_intr_t *)siointr, com, &com->cookie); if (ret == 0) device_printf(dev, "unable to activate interrupt in fast mode - using normal mode\n"); } @@ -1378,7 +1379,7 @@ outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS); } -static void +static int siointr(arg) void *arg; { @@ -1422,6 +1423,7 @@ } while (possibly_more_intrs); mtx_unlock_spin(&sio_lock); #endif /* COM_MULTIPORT */ + return(FILTER_HANDLED); } static struct timespec siots[8]; --- p4_head/sys/dev/sk/if_sk.c Sun Jan 21 15:17:59 2007 +++ p4_head_intr/sys/dev/sk/if_sk.c Fri Jan 26 13:54:08 2007 @@ -1799,7 +1799,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->sk_res[1], INTR_TYPE_NET|INTR_MPSAFE, - sk_intr, sc, &sc->sk_intrhand); + NULL, sk_intr, sc, &sc->sk_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/dev/sn/if_sn.c Sun Jan 21 15:17:59 2007 +++ p4_head_intr/sys/dev/sn/if_sn.c Fri Jan 26 13:54:08 2007 @@ -218,7 +218,8 @@ * during startup to avoid LORs in the network layer. */ if ((err = bus_setup_intr(dev, sc->irq_res, - INTR_TYPE_NET | INTR_MPSAFE, sn_intr, sc, &sc->intrhand)) != 0) { + INTR_TYPE_NET | INTR_MPSAFE, NULL, sn_intr, sc, + &sc->intrhand)) != 0) { sn_detach(dev); return err; } --- p4_head/sys/dev/snc/if_snc_cbus.c Sun Jan 21 15:18:00 2007 +++ p4_head_intr/sys/dev/snc/if_snc_cbus.c Fri Jan 26 13:54:08 2007 @@ -190,7 +190,7 @@ snc_alloc_irq(dev, 0, 0); error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - sncintr, sc, &sc->irq_handle); + NULL, sncintr, sc, &sc->irq_handle); if (error) { printf("snc_isa_attach: bus_setup_intr() failed\n"); snc_release_resources(dev); --- p4_head/sys/dev/snc/if_snc_pccard.c Sun Jan 21 15:18:00 2007 +++ p4_head_intr/sys/dev/snc/if_snc_pccard.c Fri Jan 26 13:54:08 2007 @@ -135,7 +135,7 @@ snc_alloc_irq(dev, 0, 0); error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - sncintr, sc, &sc->irq_handle); + NULL, sncintr, sc, &sc->irq_handle); if (error) { printf("snc_isa_attach: bus_setup_intr() failed\n"); snc_release_resources(dev); --- p4_head/sys/dev/sound/isa/gusc.c Sun Jan 21 15:18:00 2007 +++ p4_head_intr/sys/dev/sound/isa/gusc.c Fri Jan 26 13:54:08 2007 @@ -316,7 +316,7 @@ } if (scp->irq != NULL) - bus_setup_intr(dev, scp->irq, INTR_TYPE_AV, gusc_intr, scp, &ih); + bus_setup_intr(dev, scp->irq, INTR_TYPE_AV, NULL, gusc_intr, scp, &ih); bus_generic_attach(dev); return (0); @@ -419,11 +419,15 @@ static int gusc_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep) { sc_p scp = (sc_p)device_get_softc(dev); devclass_t devclass; + if (filter != NULL) { + printf("gusc.c: we cannot use a filter here\n"); + return (EINVAL); + } devclass = device_get_devclass(child); if (strcmp(devclass_get_name(devclass), "midi") == 0) { scp->midi_intr.intr = intr; @@ -434,7 +438,7 @@ scp->pcm_intr.arg = arg; return 0; } - return bus_generic_setup_intr(dev, child, irq, flags, intr, + return bus_generic_setup_intr(dev, child, irq, flags, filter, intr, arg, cookiep); } --- p4_head/sys/dev/sound/isa/sbc.c Sun Jan 21 15:18:01 2007 +++ p4_head_intr/sys/dev/sound/isa/sbc.c Fri Jan 26 13:54:08 2007 @@ -80,8 +80,8 @@ static int sbc_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r); static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, - void **cookiep); + int flags, driver_filter_t *filter, driver_intr_t *intr, + void *arg, void **cookiep); static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); @@ -503,13 +503,17 @@ static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, - void **cookiep) + int flags, driver_filter_t *filter, driver_intr_t *intr, + void *arg, void **cookiep) { struct sbc_softc *scp = device_get_softc(dev); struct sbc_ihl *ihl = NULL; int i, ret; + if (filter != NULL) { + printf("sbc.c: we cannot use a filter here\n"); + return (EINVAL); + } sbc_lock(scp); i = 0; while (i < IRQ_MAX) { --- p4_head/sys/dev/sound/pci/csa.c Sun Jan 21 15:18:02 2007 +++ p4_head_intr/sys/dev/sound/pci/csa.c Fri Jan 26 13:54:08 2007 @@ -82,7 +82,8 @@ struct resource *r); static int csa_setup_intr(device_t bus, device_t child, struct resource *irq, int flags, - driver_intr_t *intr, void *arg, void **cookiep); + driver_filter_t *filter, driver_intr_t *intr, + void *arg, void **cookiep); static int csa_teardown_intr(device_t bus, device_t child, struct resource *irq, void *cookie); static driver_intr_t csa_intr; @@ -439,12 +440,17 @@ static int csa_setup_intr(device_t bus, device_t child, struct resource *irq, int flags, - driver_intr_t *intr, void *arg, void **cookiep) + driver_filter_t *filter, driver_intr_t *intr, void *arg, + void **cookiep) { sc_p scp; csa_res *resp; struct sndcard_func *func; + if (filter != NULL) { + printf("ata-csa.c: we cannot use a filter here\n"); + return (EINVAL); + } scp = device_get_softc(bus); resp = &scp->res; --- p4_head/sys/dev/sound/pci/emu10kx.c Sun Jan 21 15:18:03 2007 +++ p4_head_intr/sys/dev/sound/pci/emu10kx.c Fri Jan 26 13:54:08 2007 @@ -2834,7 +2834,7 @@ i = 0; sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE); - if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, emu_intr, sc, &sc->ih)) { + if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, NULL, emu_intr, sc, &sc->ih)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } --- p4_head/sys/dev/sound/pci/vibes.c Sun Jan 21 15:18:07 2007 +++ p4_head_intr/sys/dev/sound/pci/vibes.c Fri Jan 26 13:54:08 2007 @@ -762,7 +762,7 @@ sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || - bus_setup_intr(dev, sc->irq, INTR_TYPE_AV, sv_intr, sc, &sc->ih)) { + bus_setup_intr(dev, sc->irq, INTR_TYPE_AV, NULL, sv_intr, sc, &sc->ih)) { device_printf(dev, "sv_attach: Unable to map interrupt\n"); goto fail; } --- p4_head/sys/dev/sound/pcm/sound.c Sun Jan 21 15:18:09 2007 +++ p4_head_intr/sys/dev/sound/pcm/sound.c Fri Jan 26 13:54:08 2007 @@ -129,7 +129,7 @@ #else flags = INTR_TYPE_AV; #endif - return bus_setup_intr(dev, res, flags, hand, param, cookiep); + return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep); } #ifndef PCM_DEBUG_MTX --- p4_head/sys/dev/sr/if_sr.c Sun Jan 21 15:18:11 2007 +++ p4_head_intr/sys/dev/sr/if_sr.c Fri Jan 26 13:54:08 2007 @@ -390,7 +390,7 @@ sr_init_sca(hc); if (bus_setup_intr(device, hc->res_irq, - INTR_TYPE_NET, srintr, hc, &hc->intr_cookie) != 0) + INTR_TYPE_NET, NULL, srintr, hc, &hc->intr_cookie) != 0) goto errexit; /* --- p4_head/sys/dev/stg/tmc18c30_isa.c Sun Jan 21 15:18:11 2007 +++ p4_head_intr/sys/dev/stg/tmc18c30_isa.c Fri Jan 26 13:54:08 2007 @@ -97,7 +97,7 @@ } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - stg_intr, (void *)sc, &sc->stg_intrhand); + NULL, stg_intr, (void *)sc, &sc->stg_intrhand); if (error) { stg_release_resource(dev); return(error); --- p4_head/sys/dev/stg/tmc18c30_pccard.c Sun Jan 21 15:18:11 2007 +++ p4_head_intr/sys/dev/stg/tmc18c30_pccard.c Fri Jan 26 13:54:08 2007 @@ -108,7 +108,7 @@ return(ENXIO); } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - stg_intr, (void *)sc, &sc->stg_intrhand); + NULL, stg_intr, (void *)sc, &sc->stg_intrhand); if (error) { stg_release_resource(dev); return(error); --- p4_head/sys/dev/stg/tmc18c30_pci.c Sun Jan 21 15:18:11 2007 +++ p4_head_intr/sys/dev/stg/tmc18c30_pci.c Fri Jan 26 13:54:08 2007 @@ -101,7 +101,7 @@ /* XXXX remove INTR_ENTROPY below for MFC */ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - stg_intr, (void *)sc, &sc->stg_intrhand); + NULL, stg_intr, (void *)sc, &sc->stg_intrhand); if (error) { stg_release_resource(dev); return(error); --- p4_head/sys/dev/stge/if_stge.c Sun Jan 21 15:18:12 2007 +++ p4_head_intr/sys/dev/stge/if_stge.c Fri Jan 26 13:54:08 2007 @@ -809,7 +809,7 @@ * Hookup IRQ */ error = bus_setup_intr(dev, sc->sc_res[1], INTR_TYPE_NET | INTR_MPSAFE, - stge_intr, sc, &sc->sc_ih); + NULL, stge_intr, sc, &sc->sc_ih); if (error != 0) { ether_ifdetach(ifp); device_printf(sc->sc_dev, "couldn't set up IRQ\n"); --- p4_head/sys/dev/sym/sym_hipd.c Sun Jan 21 15:18:14 2007 +++ p4_head_intr/sys/dev/sym/sym_hipd.c Fri Jan 26 13:54:08 2007 @@ -8958,7 +8958,7 @@ * Establish our interrupt handler. */ err = bus_setup_intr(np->device, np->irq_res, - INTR_TYPE_CAM | INTR_ENTROPY, sym_intr, np, + INTR_TYPE_CAM | INTR_ENTROPY, NULL, sym_intr, np, &np->intr); if (err) { device_printf(np->device, "bus_setup_intr() failed: %d\n", --- p4_head/sys/dev/ti/if_ti.c Sun Jan 21 15:18:15 2007 +++ p4_head_intr/sys/dev/ti/if_ti.c Fri Jan 26 13:54:08 2007 @@ -2547,7 +2547,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->ti_irq, INTR_TYPE_NET|INTR_MPSAFE, - ti_intr, sc, &sc->ti_intrhand); + NULL, ti_intr, sc, &sc->ti_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/dev/trm/trm.c Sun Jan 21 15:18:16 2007 +++ p4_head_intr/sys/dev/trm/trm.c Fri Jan 26 13:54:08 2007 @@ -3596,7 +3596,7 @@ RF_SHAREABLE | RF_ACTIVE); if (pACB->irq == NULL || bus_setup_intr(dev, pACB->irq, - INTR_TYPE_CAM, trm_Interrupt, pACB, &pACB->ih)) { + INTR_TYPE_CAM, NULL, trm_Interrupt, pACB, &pACB->ih)) { printf("trm%d: register Interrupt handler error!\n", unit); goto bad; } --- p4_head/sys/dev/twa/tw_osl_freebsd.c Sun Jan 21 15:18:23 2007 +++ p4_head_intr/sys/dev/twa/tw_osl_freebsd.c Fri Jan 26 13:54:08 2007 @@ -174,9 +174,11 @@ static TW_INT32 twa_detach(device_t dev); static TW_INT32 twa_shutdown(device_t dev); static TW_VOID twa_busdma_lock(TW_VOID *lock_arg, bus_dma_lock_op_t op); -static TW_VOID twa_pci_intr(TW_VOID *arg); #ifdef TW_OSLI_DEFERRED_INTR_USED +static int twa_pci_intr_fast(TW_VOID *arg); static TW_VOID twa_deferred_intr(TW_VOID *context, TW_INT32 pending); +#else +static TW_VOID twa_pci_intr(TW_VOID *arg); #endif /* TW_OSLI_DEFERRED_INTR_USED */ static TW_INT32 tw_osli_alloc_mem(struct twa_softc *sc); @@ -357,12 +359,13 @@ return(ENXIO); } if ((error = bus_setup_intr(sc->bus_dev, sc->irq_res, - ((mp_ncpus > 1) ? (INTR_MPSAFE + INTR_TYPE_CAM | INTR_MPSAFE, #ifdef TW_OSLI_DEFERRED_INTR_USED - | INTR_FAST -#endif /* TW_OSLI_DEFERRED_INTR_USED */ - ) : 0) | INTR_TYPE_CAM, - twa_pci_intr, sc, &sc->intr_handle))) { + twa_pci_intr_fast, NULL, +#else + NULL, twa_pci_intr, +#endif + sc, &sc->intr_handle))) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, @@ -977,7 +980,28 @@ } +#ifdef TW_OSLI_DEFERRED_INTR_USED +/* + * Function name: twa_pci_intr_fast + * Description: Interrupt handler. Wrapper for twa_interrupt. + * + * Input: arg -- ptr to OSL internal ctlr context + * Output: FILTER_HANDLED or FILTER_STRAY + * Return value: None + */ +static int +twa_pci_intr_fast(TW_VOID *arg) +{ + struct twa_softc *sc = (struct twa_softc *)arg; + tw_osli_dbg_dprintf(10, sc, "entered"); + if (tw_cl_interrupt(&(sc->ctlr_handle))) { + tw_cl_deferred_interrupt(&(sc->ctlr_handle)); + return(FILTER_HANDLED); + } + return(FILTER_STRAY); +} +#else /* * Function name: twa_pci_intr * Description: Interrupt handler. Wrapper for twa_interrupt. @@ -993,15 +1017,9 @@ tw_osli_dbg_dprintf(10, sc, "entered"); if (tw_cl_interrupt(&(sc->ctlr_handle))) -#ifdef TW_OSLI_DEFERRED_INTR_USED - taskqueue_enqueue_fast(taskqueue_fast, - &(sc->deferred_intr_callback)); -#else /* TW_OSLI_DEFERRED_INTR_USED */ tw_cl_deferred_interrupt(&(sc->ctlr_handle)); -#endif /* TW_OSLI_DEFERRED_INTR_USED */ } - - +#endif #ifdef TW_OSLI_DEFERRED_INTR_USED --- p4_head/sys/dev/twe/twe_freebsd.c Sun Jan 21 15:18:24 2007 +++ p4_head_intr/sys/dev/twe/twe_freebsd.c Fri Jan 26 13:54:08 2007 @@ -254,7 +254,8 @@ twe_free(sc); return(ENXIO); } - if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO | INTR_ENTROPY, twe_pci_intr, sc, &sc->twe_intr)) { + if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO | INTR_ENTROPY, + NULL, twe_pci_intr, sc, &sc->twe_intr)) { twe_printf(sc, "can't set up interrupt\n"); twe_free(sc); return(ENXIO); --- p4_head/sys/dev/tx/if_tx.c Sun Jan 21 15:18:24 2007 +++ p4_head_intr/sys/dev/tx/if_tx.c Fri Jan 26 13:54:08 2007 @@ -418,7 +418,7 @@ /* Activate our interrupt handler. */ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - epic_intr, sc, &sc->sc_ih); + NULL, epic_intr, sc, &sc->sc_ih); if (error) { device_printf(dev, "couldn't set up irq\n"); goto fail; --- p4_head/sys/dev/txp/if_txp.c Sun Jan 21 15:18:25 2007 +++ p4_head_intr/sys/dev/txp/if_txp.c Fri Jan 26 13:54:08 2007 @@ -340,7 +340,7 @@ ether_ifattach(ifp, eaddr); error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - txp_intr, sc, &sc->sc_intrhand); + NULL, txp_intr, sc, &sc->sc_intrhand); if (error) { ether_ifdetach(ifp); --- p4_head/sys/dev/uart/uart_core.c Sun Jan 21 15:18:25 2007 +++ p4_head_intr/sys/dev/uart/uart_core.c Fri Jan 26 13:54:08 2007 @@ -227,13 +227,14 @@ return (0); } -static void +static int uart_intr(void *arg) { struct uart_softc *sc = arg; - int ipend; + int flag = 0, ipend; while (!sc->sc_leaving && (ipend = UART_IPEND(sc)) != 0) { + flag = 1; if (ipend & SER_INT_OVERRUN) uart_intr_overrun(sc); if (ipend & SER_INT_BREAK) @@ -243,8 +244,9 @@ if (ipend & SER_INT_SIGCHG) uart_intr_sigchg(sc); if (ipend & SER_INT_TXIDLE) - uart_intr_txidle(sc); + uart_intr_txidle(sc); } + return((flag)?FILTER_HANDLED:FILTER_STRAY); } serdev_intr_t * @@ -401,12 +403,12 @@ RF_ACTIVE | RF_SHAREABLE); if (sc->sc_ires != NULL) { error = bus_setup_intr(dev, - sc->sc_ires, INTR_TYPE_TTY | INTR_FAST, uart_intr, - sc, &sc->sc_icookie); + sc->sc_ires, INTR_TYPE_TTY, + uart_intr, NULL, sc, &sc->sc_icookie); if (error) error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_TTY | INTR_MPSAFE, - uart_intr, sc, &sc->sc_icookie); + NULL, (driver_intr_t *)uart_intr, sc, &sc->sc_icookie); else sc->sc_fastintr = 1; --- p4_head/sys/dev/ubsec/ubsec.c Sun Jan 21 15:18:26 2007 +++ p4_head_intr/sys/dev/ubsec/ubsec.c Fri Jan 26 13:54:08 2007 @@ -345,7 +345,7 @@ * so make sure the IRQ is mapped appropriately. */ if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE, - ubsec_intr, sc, &sc->sc_ih)) { + NULL, ubsec_intr, sc, &sc->sc_ih)) { device_printf(dev, "could not establish interrupt\n"); goto bad2; } --- p4_head/sys/dev/usb/ehci_pci.c Sun Jan 21 15:18:26 2007 +++ p4_head_intr/sys/dev/usb/ehci_pci.c Fri Jan 26 13:54:08 2007 @@ -370,7 +370,7 @@ } err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, - (driver_intr_t *) ehci_intr, sc, &sc->ih); + NULL, (driver_intr_t *)ehci_intr, sc, &sc->ih); if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->ih = NULL; --- p4_head/sys/dev/usb/ohci_pci.c Sun Jan 21 15:18:28 2007 +++ p4_head_intr/sys/dev/usb/ohci_pci.c Fri Jan 26 13:54:08 2007 @@ -297,8 +297,8 @@ sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } - err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, ohci_intr, sc, - &sc->ih); + err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, NULL, ohci_intr, + sc, &sc->ih); if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->ih = NULL; --- p4_head/sys/dev/usb/uhci_pci.c Sun Jan 21 15:18:29 2007 +++ p4_head_intr/sys/dev/usb/uhci_pci.c Fri Jan 26 13:54:08 2007 @@ -330,7 +330,7 @@ } err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, - (driver_intr_t *) uhci_intr, sc, &sc->ih); + NULL, (driver_intr_t *) uhci_intr, sc, &sc->ih); if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->ih = NULL; --- p4_head/sys/dev/vge/if_vge.c Sun Jan 21 15:18:32 2007 +++ p4_head_intr/sys/dev/vge/if_vge.c Fri Jan 26 13:54:08 2007 @@ -1035,7 +1035,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->vge_irq, INTR_TYPE_NET|INTR_MPSAFE, - vge_intr, sc, &sc->vge_intrhand); + NULL, vge_intr, sc, &sc->vge_intrhand); if (error) { printf("vge%d: couldn't set up irq\n", unit); --- p4_head/sys/dev/vx/if_vx_eisa.c Sun Jan 21 15:18:33 2007 +++ p4_head_intr/sys/dev/vx/if_vx_eisa.c Fri Jan 26 13:54:08 2007 @@ -152,8 +152,8 @@ if (vx_attach(dev) == 0) goto bad; - if (bus_setup_intr(dev, irq, INTR_TYPE_NET | INTR_MPSAFE, vx_intr, sc, - &sc->vx_intrhand)) + if (bus_setup_intr(dev, irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, + vx_intr, sc, &sc->vx_intrhand)) goto bad_mtx; return (0); --- p4_head/sys/dev/vx/if_vx_pci.c Sun Jan 21 15:18:33 2007 +++ p4_head_intr/sys/dev/vx/if_vx_pci.c Fri Jan 26 13:54:08 2007 @@ -148,7 +148,7 @@ goto bad; if (bus_setup_intr(dev, sc->vx_irq, INTR_TYPE_NET | INTR_MPSAFE, - vx_intr, sc, &sc->vx_intrhand)) + NULL, vx_intr, sc, &sc->vx_intrhand)) goto bad_mtx; /* defect check for 3C590 */ --- p4_head/sys/dev/wi/if_wi.c Sun Jan 21 15:18:33 2007 +++ p4_head_intr/sys/dev/wi/if_wi.c Fri Jan 26 13:54:08 2007 @@ -264,7 +264,7 @@ * unless you can prove it! */ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, - wi_intr, sc, &sc->wi_intrhand); + NULL, wi_intr, sc, &sc->wi_intrhand); if (error) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); --- p4_head/sys/dev/xe/if_xe.c Sun Jan 21 15:18:35 2007 +++ p4_head_intr/sys/dev/xe/if_xe.c Fri Jan 26 13:54:08 2007 @@ -1925,8 +1925,8 @@ xe_deactivate(dev); return ENOMEM; } - if ((err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, xe_intr, sc, - &sc->intrhand)) != 0) { + if ((err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL, + xe_intr, sc, &sc->intrhand)) != 0) { xe_deactivate(dev); return err; } --- p4_head/sys/i386/i386/intr_machdep.c Sun Jan 21 15:19:02 2007 +++ p4_head_intr/sys/i386/i386/intr_machdep.c Fri Jan 26 13:54:09 2007 @@ -149,8 +149,8 @@ } int -intr_add_handler(const char *name, int vector, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep) +intr_add_handler(const char *name, int vector, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep) { struct intsrc *isrc; int error; @@ -158,8 +158,8 @@ isrc = intr_lookup_source(vector); if (isrc == NULL) return (EINVAL); - error = intr_event_add_handler(isrc->is_event, name, handler, arg, - intr_priority(flags), flags, cookiep); + error = intr_event_add_handler(isrc->is_event, name, filter, handler, + arg, intr_priority(flags), flags, cookiep); if (error == 0) { intrcnt_updatename(isrc); mtx_lock_spin(&intr_table_lock); @@ -257,7 +257,7 @@ thread = 0; critical_enter(); TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) { + if (ih->ih_filter == NULL) { thread = 1; continue; } @@ -265,7 +265,7 @@ ih->ih_handler, ih->ih_argument == NULL ? frame : ih->ih_argument, ih->ih_name); if (ih->ih_argument == NULL) - ih->ih_handler(frame); + ih->ih_filter(frame); else ih->ih_handler(ih->ih_argument); } --- p4_head/sys/i386/i386/nexus.c Sun Jan 21 15:19:03 2007 +++ p4_head_intr/sys/i386/i386/nexus.c Fri Jan 26 13:54:09 2007 @@ -102,7 +102,8 @@ static int nexus_release_resource(device_t, device_t, int, int, struct resource *); static int nexus_setup_intr(device_t, device_t, struct resource *, int flags, - void (*)(void *), void *, void **); + driver_filter_t filter, void (*)(void *), void *, + void **); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); static struct resource_list *nexus_get_reslist(device_t dev, device_t child); @@ -470,7 +471,8 @@ */ static int nexus_setup_intr(device_t bus, device_t child, struct resource *irq, - int flags, void (*ihand)(void *), void *arg, void **cookiep) + int flags, driver_filter_t filter, void (*ihand)(void *), + void *arg, void **cookiep) { int error; @@ -490,7 +492,7 @@ return (error); error = intr_add_handler(device_get_nameunit(child), - rman_get_start(irq), ihand, arg, flags, cookiep); + rman_get_start(irq), filter, ihand, arg, flags, cookiep); return (error); } --- p4_head/sys/i386/include/intr_machdep.h Sun Jan 21 15:19:06 2007 +++ p4_head_intr/sys/i386/include/intr_machdep.h Fri Jan 26 13:54:09 2007 @@ -132,8 +132,8 @@ #else #define intr_add_cpu(apic_id) #endif -int intr_add_handler(const char *name, int vector, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep); +int intr_add_handler(const char *name, int vector, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); --- p4_head/sys/i386/isa/clock.c Sun Jan 21 15:19:08 2007 +++ p4_head_intr/sys/i386/isa/clock.c Fri Jan 26 13:54:09 2007 @@ -142,7 +142,7 @@ 0 /* quality */ }; -static void +static int clkintr(struct trapframe *frame) { @@ -164,6 +164,7 @@ if (MCA_system) outb(0x61, inb(0x61) | 0x80); #endif + return (FILTER_HANDLED); } int @@ -218,7 +219,7 @@ * Stat clock ticks can still be lost, causing minor loss of accuracy * in the statistics, but the stat clock will no longer stop. */ -static void +static int rtcintr(struct trapframe *frame) { @@ -231,6 +232,7 @@ if (pscnt == psdiv) statclock(TRAPF_USERMODE(frame)); } + return (FILTER_HANDLED); } #include "opt_ddb.h" @@ -761,8 +763,8 @@ * timecounter to user a simpler algorithm. */ if (!using_lapic_timer) { - intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL, - INTR_TYPE_CLK | INTR_FAST, NULL); + intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, + INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); if (i8254_intsrc != NULL) i8254_pending = @@ -795,8 +797,8 @@ /* Enable periodic interrupts from the RTC. */ rtc_statusb |= RTCSB_PINTR; - intr_add_handler("rtc", 8, (driver_intr_t *)rtcintr, NULL, - INTR_TYPE_CLK | INTR_FAST, NULL); + intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL, + INTR_TYPE_CLK, NULL); writertc(RTC_STATUSB, rtc_statusb); rtcin(RTC_INTR); --- p4_head/sys/i386/isa/isa.c Sun Jan 21 15:19:08 2007 +++ p4_head_intr/sys/i386/isa/isa.c Fri Jan 26 13:54:09 2007 @@ -262,10 +262,11 @@ */ int isa_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t filter, void (*ihand)(void *), void *arg, + void **cookiep) { return (BUS_SETUP_INTR(device_get_parent(bus), child, r, flags, - ihand, arg, cookiep)); + filter, ihand, arg, cookiep)); } int --- p4_head/sys/i386/isa/npx.c Sun Jan 21 15:19:09 2007 +++ p4_head_intr/sys/i386/isa/npx.c Fri Jan 26 13:54:09 2007 @@ -149,7 +149,7 @@ static void fpurstor(union savefpu *); static int npx_attach(device_t dev); static void npx_identify(driver_t *driver, device_t parent); -static void npx_intr(void *); +static int npx_intr(void *); static int npx_probe(device_t dev); #ifdef I586_CPU_XXX static long timezero(const char *funcname, @@ -201,7 +201,7 @@ /* * Do minimal handling of npx interrupts to convert them to traps. */ -static void +static int npx_intr(dummy) void *dummy; { @@ -234,6 +234,7 @@ td->td_flags |= TDF_ASTPENDING; mtx_unlock_spin(&sched_lock); } + return (FILTER_HANDLED); } /* @@ -279,8 +280,8 @@ irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num, irq_num, 1, RF_ACTIVE); if (irq_res != NULL) { - if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC | INTR_FAST, - npx_intr, NULL, &irq_cookie) != 0) + if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC, + npx_intr, NULL, NULL, &irq_cookie) != 0) panic("npx: can't create intr"); } --- p4_head/sys/ia64/ia64/interrupt.c Sun Jan 21 15:19:16 2007 +++ p4_head_intr/sys/ia64/ia64/interrupt.c Fri Jan 26 13:54:09 2007 @@ -283,8 +283,9 @@ } int -ia64_setup_intr(const char *name, int irq, driver_intr_t handler, void *arg, - enum intr_type flags, void **cookiep, volatile long *cntp) +ia64_setup_intr(const char *name, int irq, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, + void **cookiep, volatile long *cntp) { struct ia64_intr *i; int errcode; @@ -331,7 +332,7 @@ } /* Second, add this handler. */ - errcode = intr_event_add_handler(i->event, name, handler, arg, + errcode = intr_event_add_handler(i->event, name, filter, handler, arg, intr_priority(flags), flags, cookiep); if (errcode) return errcode; @@ -381,13 +382,13 @@ thread = 0; critical_enter(); TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) { + if (ih->ih_filter == NULL) { thread = 1; continue; } CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_handler, ih->ih_argument, ih->ih_name); - ih->ih_handler(ih->ih_argument); + ih->ih_filter, ih->ih_argument, ih->ih_name); + ih->ih_filter(ih->ih_argument); } critical_exit(); --- p4_head/sys/ia64/ia64/nexus.c Sun Jan 21 15:19:17 2007 +++ p4_head_intr/sys/ia64/ia64/nexus.c Fri Jan 26 13:54:09 2007 @@ -89,7 +89,8 @@ static int nexus_release_resource(device_t, device_t, int, int, struct resource *); static int nexus_setup_intr(device_t, device_t, struct resource *, int flags, - void (*)(void *), void *, void **); + driver_filter_t filter, void (*)(void *), void *, + void **); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); static struct resource_list *nexus_get_reslist(device_t dev, device_t child); @@ -422,7 +423,8 @@ */ static int nexus_setup_intr(device_t bus, device_t child, struct resource *irq, - int flags, void (*ihand)(void *), void *arg, void **cookiep) + int flags, driver_filter_t filter, void (*ihand)(void *), + void *arg, void **cookiep) { driver_t *driver; int error; @@ -445,7 +447,7 @@ return (error); error = ia64_setup_intr(device_get_nameunit(child), - rman_get_start(irq), ihand, arg, flags, cookiep, 0); + rman_get_start(irq), filter, ihand, arg, flags, cookiep, 0); return (error); } --- p4_head/sys/ia64/include/intr.h Sun Jan 21 15:19:17 2007 +++ p4_head_intr/sys/ia64/include/intr.h Fri Jan 26 13:54:09 2007 @@ -51,9 +51,9 @@ struct sapic; void ia64_add_sapic(struct sapic *sa); -int ia64_setup_intr(const char *name, int irq, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep, - volatile long *cntp); +int ia64_setup_intr(const char *name, int irq, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, + void **cookiep, volatile long *cntp); int ia64_teardown_intr(void *cookie); void ia64_dispatch_intr(void *frame, unsigned long vector); --- p4_head/sys/isa/isa_common.h Sun Jan 21 15:19:18 2007 +++ p4_head_intr/sys/isa/isa_common.h Fri Jan 26 13:54:09 2007 @@ -70,7 +70,8 @@ int type, int rid, struct resource *r); extern int isa_setup_intr(device_t bus, device_t child, struct resource *r, - int flags, void (*ihand)(void *), void *arg, void **cookiep); + int flags, driver_filter_t *filter, void (*ihand)(void *), void *arg, + void **cookiep); extern int isa_teardown_intr(device_t bus, device_t child, struct resource *r, void *cookie); --- p4_head/sys/kern/bus_if.m Sun Jan 21 15:19:19 2007 +++ p4_head_intr/sys/kern/bus_if.m Fri Jan 26 13:54:09 2007 @@ -326,6 +326,7 @@ device_t _child; struct resource *_irq; int _flags; + driver_filter_t *_filter; driver_intr_t *_intr; void *_arg; void **_cookiep; --- p4_head/sys/kern/kern_intr.c Sun Jan 21 15:19:21 2007 +++ p4_head_intr/sys/kern/kern_intr.c Fri Jan 26 13:54:09 2007 @@ -324,25 +324,24 @@ int intr_event_add_handler(struct intr_event *ie, const char *name, - driver_intr_t handler, void *arg, u_char pri, enum intr_type flags, - void **cookiep) + driver_filter_t filter, driver_intr_t handler, void *arg, u_char pri, + enum intr_type flags, void **cookiep) { struct intr_handler *ih, *temp_ih; struct intr_thread *it; - if (ie == NULL || name == NULL || handler == NULL) + if (ie == NULL || name == NULL || (handler == NULL && filter == NULL)) return (EINVAL); /* Allocate and populate an interrupt handler structure. */ ih = malloc(sizeof(struct intr_handler), M_ITHREAD, M_WAITOK | M_ZERO); + ih->ih_filter = filter; ih->ih_handler = handler; ih->ih_argument = arg; ih->ih_name = name; ih->ih_event = ie; ih->ih_pri = pri; - if (flags & INTR_FAST) - ih->ih_flags = IH_FAST; - else if (flags & INTR_EXCL) + if (flags & INTR_EXCL) ih->ih_flags = IH_EXCLUSIVE; if (flags & INTR_MPSAFE) ih->ih_flags |= IH_MPSAFE; @@ -372,7 +371,7 @@ intr_event_update(ie); /* Create a thread if we need one. */ - while (ie->ie_thread == NULL && !(flags & INTR_FAST)) { + while (ie->ie_thread == NULL && handler != NULL) { if (ie->ie_flags & IE_ADDING_THREAD) msleep(ie, &ie->ie_lock, 0, "ithread", 0); else { @@ -589,7 +588,7 @@ if (eventp != NULL) *eventp = ie; } - return (intr_event_add_handler(ie, name, handler, arg, + return (intr_event_add_handler(ie, name, NULL, handler, arg, (pri * RQ_PPQ) + PI_SOFT, flags, cookiep)); /* XXKSE.. think of a better way to get separate queues */ } @@ -669,10 +668,6 @@ atomic_store_rel_int(&ih->ih_need, 0); } - /* Fast handlers are handled in primary interrupt context. */ - if (ih->ih_flags & IH_FAST) - continue; - /* Execute this handler. */ CTR6(KTR_INTR, "%s: pid %d exec %p(%p) for %s flg=%x", __func__, p->p_pid, (void *)ih->ih_handler, ih->ih_argument, @@ -828,14 +823,10 @@ db_printsym((uintptr_t)ih->ih_handler, DB_STGY_PROC); db_printf("(%p)", ih->ih_argument); if (ih->ih_need || - (ih->ih_flags & (IH_FAST | IH_EXCLUSIVE | IH_ENTROPY | IH_DEAD | + (ih->ih_flags & (IH_EXCLUSIVE | IH_ENTROPY | IH_DEAD | IH_MPSAFE)) != 0) { db_printf(" {"); comma = 0; - if (ih->ih_flags & IH_FAST) { - db_printf("FAST"); - comma = 1; - } if (ih->ih_flags & IH_EXCLUSIVE) { if (comma) db_printf(", "); --- p4_head/sys/kern/subr_bus.c Sun Jan 21 15:19:26 2007 +++ p4_head_intr/sys/kern/subr_bus.c Fri Jan 26 13:54:09 2007 @@ -50,6 +50,7 @@ #include #include #include +#include #include @@ -3095,12 +3096,13 @@ */ int bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, + void **cookiep) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_SETUP_INTR(dev->parent, child, irq, flags, - intr, arg, cookiep)); + filter, intr, arg, cookiep)); return (EINVAL); } @@ -3457,7 +3459,7 @@ */ int bus_setup_intr(device_t dev, struct resource *r, int flags, - driver_intr_t handler, void *arg, void **cookiep) + driver_filter_t filter, driver_intr_t handler, void *arg, void **cookiep) { int error; @@ -3466,14 +3468,19 @@ !debug_mpsafenet) flags &= ~INTR_MPSAFE; error = BUS_SETUP_INTR(dev->parent, dev, r, flags, - handler, arg, cookiep); + filter, handler, arg, cookiep); if (error == 0) { - if (!(flags & (INTR_MPSAFE | INTR_FAST))) + if (handler != NULL && !(flags & INTR_MPSAFE)) device_printf(dev, "[GIANT-LOCKED]\n"); if (bootverbose && (flags & INTR_MPSAFE)) device_printf(dev, "[MPSAFE]\n"); - if (flags & INTR_FAST) - device_printf(dev, "[FAST]\n"); + if (filter != NULL) { + if (handler == NULL) + device_printf(dev, "[FILTER]\n"); + else + device_printf(dev, "[FILTER+ITHREAD]\n"); + } else + device_printf(dev, "[ITHREAD]\n"); } } else error = EINVAL; --- p4_head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Sun Jan 21 15:19:58 2007 +++ p4_head_intr/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Fri Jan 26 13:54:09 2007 @@ -635,7 +635,7 @@ } sc->irq_cookie = NULL; - if (bus_setup_intr(dev, sc->irq, INTR_TYPE_TTY, bt3c_intr, sc, + if (bus_setup_intr(dev, sc->irq, INTR_TYPE_TTY, NULL, bt3c_intr, sc, &sc->irq_cookie) != 0) { device_printf(dev, "Could not setup ISR\n"); goto bad; --- p4_head/sys/pc98/cbus/clock.c Sun Jan 21 15:20:29 2007 +++ p4_head_intr/sys/pc98/cbus/clock.c Fri Jan 26 13:54:09 2007 @@ -139,7 +139,7 @@ 0 /* quality */ }; -static void +static int clkintr(struct trapframe *frame) { @@ -156,6 +156,7 @@ } KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + return (FILTER_HANDLED); } int @@ -703,8 +704,8 @@ * timecounter to user a simpler algorithm. */ if (!using_lapic_timer) { - intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL, - INTR_TYPE_CLK | INTR_FAST, NULL); + intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, + NULL, INTR_TYPE_CLK | INTR_FAST, NULL); i8254_intsrc = intr_lookup_source(0); if (i8254_intsrc != NULL) i8254_pending = --- p4_head/sys/pc98/cbus/fdc.c Sun Jan 21 15:20:29 2007 +++ p4_head_intr/sys/pc98/cbus/fdc.c Fri Jan 26 13:54:09 2007 @@ -822,7 +822,7 @@ fdc = device_get_softc(dev); fdc->fdc_dev = dev; error = bus_setup_intr(dev, fdc->res_irq, - INTR_TYPE_BIO | INTR_ENTROPY, fdc_intr, fdc, + INTR_TYPE_BIO | INTR_ENTROPY, NULL, fdc_intr, fdc, &fdc->fdc_intr); if (error) { device_printf(dev, "cannot setup interrupt\n"); --- p4_head/sys/pc98/cbus/pckbd.c Sun Jan 21 15:20:30 2007 +++ p4_head_intr/sys/pc98/cbus/pckbd.c Fri Jan 26 13:54:09 2007 @@ -137,7 +137,7 @@ res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (res == NULL) return ENXIO; - bus_setup_intr(dev, res, INTR_TYPE_TTY, pckbd_isa_intr, kbd, &ih); + bus_setup_intr(dev, res, INTR_TYPE_TTY, NULL, pckbd_isa_intr, kbd, &ih); return 0; } --- p4_head/sys/pc98/cbus/sio.c Sun Jan 21 15:20:30 2007 +++ p4_head_intr/sys/pc98/cbus/sio.c Fri Jan 26 13:54:09 2007 @@ -350,7 +350,7 @@ static int comopen(struct tty *tp, struct cdev *dev); static void sioinput(struct com_s *com); static void siointr1(struct com_s *com); -static void siointr(void *arg); +static int siointr(void *arg); static int commodem(struct tty *tp, int sigon, int sigoff); static int comparam(struct tty *tp, struct termios *t); static void siopoll(void *); @@ -1739,12 +1739,13 @@ com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (com->irqres) { ret = bus_setup_intr(dev, com->irqres, - INTR_TYPE_TTY | INTR_FAST, - siointr, com, &com->cookie); + INTR_TYPE_TTY, + siointr, NULL, com, &com->cookie); if (ret) { ret = bus_setup_intr(dev, com->irqres, INTR_TYPE_TTY, - siointr, com, &com->cookie); + NULL, (driver_intr_t *)siointr, + com, &com->cookie); if (ret == 0) device_printf(dev, "unable to activate interrupt in fast mode - using normal mode\n"); } @@ -2155,7 +2156,7 @@ #endif } -static void +static int siointr(arg) void *arg; { @@ -2221,6 +2222,7 @@ } while (possibly_more_intrs); mtx_unlock_spin(&sio_lock); #endif /* COM_MULTIPORT */ + return (FILTER_HANDLED); } static struct timespec siots[8]; --- p4_head/sys/pci/if_pcn.c Sun Jan 21 15:20:33 2007 +++ p4_head_intr/sys/pci/if_pcn.c Fri Jan 26 13:54:09 2007 @@ -670,7 +670,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->pcn_irq, INTR_TYPE_NET | INTR_MPSAFE, - pcn_intr, sc, &sc->pcn_intrhand); + NULL, pcn_intr, sc, &sc->pcn_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/pci/if_rl.c Sun Jan 21 15:20:33 2007 +++ p4_head_intr/sys/pci/if_rl.c Fri Jan 26 13:54:09 2007 @@ -972,7 +972,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE, - rl_intr, sc, &sc->rl_intrhand); + NULL, rl_intr, sc, &sc->rl_intrhand); if (error) { device_printf(sc->rl_dev, "couldn't set up irq\n"); ether_ifdetach(ifp); --- p4_head/sys/pci/if_sf.c Sun Jan 21 15:20:33 2007 +++ p4_head_intr/sys/pci/if_sf.c Fri Jan 26 13:54:09 2007 @@ -784,7 +784,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->sf_irq, INTR_TYPE_NET | INTR_MPSAFE, - sf_intr, sc, &sc->sf_intrhand); + NULL, sf_intr, sc, &sc->sf_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/pci/if_sis.c Sun Jan 21 15:20:34 2007 +++ p4_head_intr/sys/pci/if_sis.c Fri Jan 26 13:54:09 2007 @@ -1226,7 +1226,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->sis_res[1], INTR_TYPE_NET | INTR_MPSAFE, - sis_intr, sc, &sc->sis_intrhand); + NULL, sis_intr, sc, &sc->sis_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/pci/if_ste.c Sun Jan 21 15:20:34 2007 +++ p4_head_intr/sys/pci/if_ste.c Fri Jan 26 13:54:09 2007 @@ -1113,7 +1113,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->ste_irq, INTR_TYPE_NET | INTR_MPSAFE, - ste_intr, sc, &sc->ste_intrhand); + NULL, ste_intr, sc, &sc->ste_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/pci/if_tl.c Sun Jan 21 15:20:34 2007 +++ p4_head_intr/sys/pci/if_tl.c Fri Jan 26 13:54:09 2007 @@ -1303,7 +1303,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->tl_irq, INTR_TYPE_NET | INTR_MPSAFE, - tl_intr, sc, &sc->tl_intrhand); + NULL, tl_intr, sc, &sc->tl_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/pci/if_vr.c Sun Jan 21 15:20:34 2007 +++ p4_head_intr/sys/pci/if_vr.c Fri Jan 26 13:54:09 2007 @@ -764,7 +764,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->vr_irq, INTR_TYPE_NET | INTR_MPSAFE, - vr_intr, sc, &sc->vr_intrhand); + NULL, vr_intr, sc, &sc->vr_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/pci/if_wb.c Sun Jan 21 15:20:34 2007 +++ p4_head_intr/sys/pci/if_wb.c Fri Jan 26 13:54:09 2007 @@ -872,7 +872,7 @@ /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->wb_irq, INTR_TYPE_NET | INTR_MPSAFE, - wb_intr, sc, &sc->wb_intrhand); + NULL, wb_intr, sc, &sc->wb_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); --- p4_head/sys/pci/if_xl.c Sun Jan 21 15:20:35 2007 +++ p4_head_intr/sys/pci/if_xl.c Fri Jan 26 13:54:09 2007 @@ -1606,7 +1606,7 @@ ether_ifattach(ifp, eaddr); error = bus_setup_intr(dev, sc->xl_irq, INTR_TYPE_NET | INTR_MPSAFE, - xl_intr, sc, &sc->xl_intrhand); + NULL, xl_intr, sc, &sc->xl_intrhand); if (error) { device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); --- p4_head/sys/pci/intpm.c Sun Jan 21 15:20:35 2007 +++ p4_head_intr/sys/pci/intpm.c Fri Jan 26 13:54:09 2007 @@ -159,8 +159,8 @@ goto fail; } - error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, intsmb_rawintr, - sc, &sc->irq_hand); + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, NULL, + intsmb_rawintr, sc, &sc->irq_hand); if (error) { device_printf(dev, "Failed to map intr\n"); goto fail; --- p4_head/sys/powerpc/include/intr_machdep.h Sun Jan 21 15:20:37 2007 +++ p4_head_intr/sys/powerpc/include/intr_machdep.h Fri Jan 26 13:54:09 2007 @@ -45,8 +45,8 @@ void intr_init(void (*)(void), int, void (*)(uintptr_t), void (*)(uintptr_t)); void intr_setup(u_int, ih_func_t *, void *, u_int); -int inthand_add(const char *, u_int, void (*)(void *), void *, int, - void **); +int inthand_add(const char *, u_int, driver_filter_t *filter, + void (*)(void *), void *, int, void **); int inthand_remove(u_int, void *); void intr_handle(u_int); --- p4_head/sys/powerpc/include/openpicvar.h Sun Jan 21 15:20:37 2007 +++ p4_head_intr/sys/powerpc/include/openpicvar.h Fri Jan 26 13:54:09 2007 @@ -58,8 +58,8 @@ struct resource *openpic_allocate_intr(device_t, device_t, int *, u_long, u_int); int openpic_setup_intr(device_t, device_t, - struct resource *, int, driver_intr_t, void *, - void **); + struct resource *, int, driver_filter_t, + driver_intr_t, void *, void **); int openpic_teardown_intr(device_t, device_t, struct resource *, void *); int openpic_release_intr(device_t dev, device_t, int, --- p4_head/sys/powerpc/powermac/hrowpic.c Sun Jan 21 15:20:38 2007 +++ p4_head_intr/sys/powerpc/powermac/hrowpic.c Fri Jan 26 13:54:09 2007 @@ -79,8 +79,8 @@ static struct resource *hrowpic_allocate_intr(device_t, device_t, int *, u_long, u_int); static int hrowpic_setup_intr(device_t, device_t, - struct resource *, int, driver_intr_t, void *, - void **); + struct resource *, int, driver_filter_t, + driver_intr_t, void *, void **); static int hrowpic_teardown_intr(device_t, device_t, struct resource *, void *); static int hrowpic_release_intr(device_t dev, device_t, int, @@ -221,7 +221,8 @@ static int hrowpic_setup_intr(device_t picdev, device_t child, struct resource *res, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) { struct hrowpic_softc *sc; u_long start; @@ -240,7 +241,7 @@ if (error) return (error); - error = inthand_add(device_get_nameunit(child), start, intr, arg, + error = inthand_add(device_get_nameunit(child), start, filt, intr, arg, flags, cookiep); if (!error) { --- p4_head/sys/powerpc/powerpc/intr_machdep.c Sun Jan 21 15:20:39 2007 +++ p4_head_intr/sys/powerpc/powerpc/intr_machdep.c Fri Jan 26 13:54:09 2007 @@ -133,8 +133,8 @@ } int -inthand_add(const char *name, u_int irq, void (*handler)(void *), void *arg, - int flags, void **cookiep) +inthand_add(const char *name, u_int irq, driver_filter_t *filter, + void (*handler)(void *), void *arg, int flags, void **cookiep) { struct ppc_intr *i, *orphan; u_int idx; @@ -178,7 +178,7 @@ } } - error = intr_event_add_handler(i->event, name, handler, arg, + error = intr_event_add_handler(i->event, name, filter, handler, arg, intr_priority(flags), flags, cookiep); if (!error) intrcnt_setname(i->event->ie_fullname, i->cntidx); @@ -219,13 +219,13 @@ sched = 0; critical_enter(); TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) { + if (ih->ih_filter == NULL) { sched = 1; continue; } CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__, - ih->ih_handler, ih->ih_argument, ih->ih_name); - ih->ih_handler(ih->ih_argument); + ih->ih_filter, ih->ih_argument, ih->ih_name); + ih->ih_filter(ih->ih_argument); } critical_exit(); --- p4_head/sys/powerpc/powerpc/openpic.c Sun Jan 21 15:20:39 2007 +++ p4_head_intr/sys/powerpc/powerpc/openpic.c Fri Jan 26 13:54:09 2007 @@ -228,7 +228,8 @@ int openpic_setup_intr(device_t dev, device_t child, struct resource *res, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) { struct openpic_softc *sc; u_long start; @@ -253,7 +254,7 @@ if (error) return (error); - error = inthand_add(device_get_nameunit(child), start, intr, arg, + error = inthand_add(device_get_nameunit(child), start, filt, intr, arg, flags, cookiep); if (sc->sc_hwprobed) --- p4_head/sys/sparc64/fhc/fhc.c Sun Jan 21 15:20:43 2007 +++ p4_head_intr/sys/sparc64/fhc/fhc.c Fri Jan 26 13:54:09 2007 @@ -50,7 +50,7 @@ #include struct fhc_clr { - driver_intr_t *fc_func; + driver_filter_t *fc_func; void *fc_arg; void *fc_cookie; bus_space_tag_t fc_bt; @@ -62,7 +62,7 @@ struct resource_list fdi_rl; }; -static void fhc_intr_stub(void *); +static int fhc_intr_stub(void *); static void fhc_led_func(void *, int); static int fhc_print_res(struct fhc_devinfo *); @@ -206,7 +206,7 @@ int fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - driver_intr_t *func, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *func, void *arg, void **cookiep) { struct fhc_softc *sc; struct fhc_clr *fc; @@ -217,6 +217,9 @@ long vec; uint32_t inr; + if (filt != NULL && func != NULL) + return (EINVAL); + sc = device_get_softc(bus); vec = rman_get_start(r); @@ -238,7 +241,7 @@ fc = malloc(sizeof(*fc), M_DEVBUF, M_WAITOK | M_ZERO); if (fc == NULL) return (0); - fc->fc_func = func; + fc->fc_func = (filt != NULL) ? filt : (driver_filter_t *)func; fc->fc_arg = arg; fc->fc_bt = bt; fc->fc_bh = bh; @@ -246,8 +249,12 @@ bus_space_write_4(bt, bh, FHC_IMAP, inr); bus_space_read_4(bt, bh, FHC_IMAP); - error = bus_generic_setup_intr(bus, child, r, flags, fhc_intr_stub, - fc, cookiep); + if (filt != NULL) + error = bus_generic_setup_intr(bus, child, r, flags, + fhc_intr_stub, NULL, fc, cookiep); + else + error = bus_generic_setup_intr(bus, child, r, flags, + NULL, (driver_intr_t *)fhc_intr_stub, fc, cookiep); if (error != 0) { free(fc, M_DEVBUF); return (error); @@ -276,7 +283,7 @@ return (error); } -static void +static int fhc_intr_stub(void *arg) { struct fhc_clr *fc = arg; @@ -285,6 +292,7 @@ bus_space_write_4(fc->fc_bt, fc->fc_bh, FHC_ICLR, 0x0); bus_space_read_4(fc->fc_bt, fc->fc_bh, FHC_ICLR); + return (FILTER_HANDLED); } struct resource * --- p4_head/sys/sparc64/include/intr_machdep.h Sun Jan 21 15:20:43 2007 +++ p4_head_intr/sys/sparc64/include/intr_machdep.h Fri Jan 26 13:54:09 2007 @@ -81,8 +81,8 @@ void *iva); void intr_init1(void); void intr_init2(void); -int inthand_add(const char *name, int vec, void (*handler)(void *), - void *arg, int flags, void **cookiep); +int inthand_add(const char *name, int vec, int (*filt)(void *), + void (*handler)(void *), void *arg, int flags, void **cookiep); int inthand_remove(int vec, void *cookie); ih_func_t intr_fast; --- p4_head/sys/sparc64/isa/isa.c Sun Jan 21 15:20:44 2007 +++ p4_head_intr/sys/sparc64/isa/isa.c Fri Jan 26 13:54:09 2007 @@ -387,8 +387,8 @@ int isa_setup_intr(device_t dev, device_t child, - struct resource *irq, int flags, - driver_intr_t *intr, void *arg, void **cookiep) + struct resource *irq, int flags, driver_filter_t *filter, + driver_intr_t *intr, void *arg, void **cookiep) { /* @@ -397,8 +397,8 @@ * The interrupt had been routed before it was added to the * resource list of the child. */ - return (BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags, intr, - arg, cookiep)); + return (BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags, + filter, intr, arg, cookiep)); } int --- p4_head/sys/sparc64/pci/psycho.c Sun Jan 21 15:20:44 2007 +++ p4_head_intr/sys/sparc64/pci/psycho.c Fri Jan 26 13:54:09 2007 @@ -81,20 +81,20 @@ const char *); static const struct psycho_desc *psycho_get_desc(phandle_t, const char *); static void psycho_set_intr(struct psycho_softc *, int, bus_addr_t, int, - driver_intr_t); + driver_filter_t); static int psycho_find_intrmap(struct psycho_softc *, int, bus_addr_t *, bus_addr_t *, u_long *); -static void psycho_intr_stub(void *); +static int psycho_intr_stub(void *); static bus_space_tag_t psycho_alloc_bus_tag(struct psycho_softc *, int); /* Interrupt handlers */ -static void psycho_ue(void *); -static void psycho_ce(void *); -static void psycho_pci_bus(void *); -static void psycho_powerfail(void *); -static void psycho_overtemp(void *); +static int psycho_ue(void *); +static int psycho_ce(void *); +static int psycho_pci_bus(void *); +static int psycho_powerfail(void *); +static int psycho_overtemp(void *); #ifdef PSYCHO_MAP_WAKEUP -static void psycho_wakeup(void *); +static int psycho_wakeup(void *); #endif /* IOMMU support */ @@ -170,7 +170,7 @@ struct psycho_clr { struct psycho_softc *pci_sc; bus_addr_t pci_clr; /* clear register */ - driver_intr_t *pci_handler; /* handler to call */ + driver_filter_t *pci_handler; /* handler to call */ void *pci_arg; /* argument for the handler */ void *pci_cookie; /* parent bus int. cookie */ device_t pci_ppb; /* farest PCI-PCI bridge */ @@ -216,8 +216,11 @@ * On UltraII machines, there can be any number of "Psycho+" ICs, each * providing two PCI buses. */ + +#define FAST 0x66600000 + #ifdef DEBUGGER_ON_POWERFAIL -#define PSYCHO_PWRFAIL_INT_FLAGS INTR_FAST +#define PSYCHO_PWRFAIL_INT_FLAGS FAST #else #define PSYCHO_PWRFAIL_INT_FLAGS 0 #endif @@ -507,7 +510,7 @@ * interrupt but they are also only used for PCI bus A. */ psycho_set_intr(sc, 0, sc->sc_half == 0 ? PSR_PCIAERR_INT_MAP : - PSR_PCIBERR_INT_MAP, INTR_FAST, psycho_pci_bus); + PSR_PCIBERR_INT_MAP, FAST, psycho_pci_bus); /* * If we're a Hummingbird/Sabre or the first of a pair of Psycho's to @@ -523,7 +526,7 @@ * XXX Not all controllers have these, but installing them * is better than trying to sort through this mess. */ - psycho_set_intr(sc, 1, PSR_UE_INT_MAP, INTR_FAST, psycho_ue); + psycho_set_intr(sc, 1, PSR_UE_INT_MAP, FAST, psycho_ue); psycho_set_intr(sc, 2, PSR_CE_INT_MAP, 0, psycho_ce); psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, PSYCHO_PWRFAIL_INT_FLAGS, psycho_powerfail); @@ -538,7 +541,7 @@ * The spare hardware interrupt is used for the * over-temperature interrupt. */ - psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, INTR_FAST, + psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, FAST, psycho_overtemp); #ifdef PSYCHO_MAP_WAKEUP /* @@ -678,19 +681,30 @@ static void psycho_set_intr(struct psycho_softc *sc, int index, bus_addr_t map, int iflags, - driver_intr_t handler) + driver_filter_t handler) { - int rid, vec; + int rid, vec, res; uint64_t mr; + res = 0; rid = index; mr = PSYCHO_READ8(sc, map); vec = INTVEC(mr); sc->sc_irq_res[index] = bus_alloc_resource(sc->sc_dev, SYS_RES_IRQ, &rid, vec, vec, 1, RF_ACTIVE); - if (sc->sc_irq_res[index] == NULL || - bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC | - iflags, handler, sc, &sc->sc_ihand[index]) != 0) + if (sc->sc_irq_res[index] == NULL) { + if (iflags & FAST) { + iflags &= ~FAST; + res = bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], + INTR_TYPE_MISC | iflags, handler, NULL, sc, + &sc->sc_ihand[index]); + } else + res = bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], + INTR_TYPE_MISC | iflags, NULL, + (driver_intr_t *)handler, sc, + &sc->sc_ihand[index]); + } + if (res) panic("%s: failed to set up interrupt", __func__); PSYCHO_WRITE8(sc, map, INTMAP_ENABLE(mr, PCPU_GET(mid))); } @@ -749,7 +763,7 @@ /* * Interrupt handlers */ -static void +static int psycho_ue(void *arg) { struct psycho_softc *sc = arg; @@ -767,9 +781,10 @@ iommu_decode_fault(sc->sc_is, afar); panic("%s: uncorrectable DMA error AFAR %#lx AFSR %#lx", device_get_name(sc->sc_dev), (u_long)afar, (u_long)afsr); + return (FILTER_HANDLED); } -static void +static int psycho_ce(void *arg) { struct psycho_softc *sc = arg; @@ -782,9 +797,10 @@ /* Clear the error bits that we caught. */ PSYCHO_WRITE8(sc, PSR_CE_AFS, afsr & CEAFSR_ERRMASK); PSYCHO_WRITE8(sc, PSR_CE_INT_CLR, 0); + return (FILTER_HANDLED); } -static void +static int psycho_pci_bus(void *arg) { struct psycho_softc *sc = arg; @@ -795,9 +811,10 @@ panic("%s: PCI bus %c error AFAR %#lx AFSR %#lx", device_get_name(sc->sc_dev), 'A' + sc->sc_half, (u_long)afar, (u_long)afsr); + return (FILTER_HANDLED); } -static void +static int psycho_powerfail(void *arg) { @@ -810,18 +827,20 @@ printf("Power Failure Detected: Shutting down NOW.\n"); shutdown_nice(0); #endif + return (FILTER_HANDLED); } -static void +static int psycho_overtemp(void *arg) { printf("DANGER: OVER TEMPERATURE detected.\nShutting down NOW.\n"); shutdown_nice(RB_POWEROFF); + return (FILTER_HANDLED); } #ifdef PSYCHO_MAP_WAKEUP -static void +static int psycho_wakeup(void *arg) { struct psycho_softc *sc = arg; @@ -829,6 +848,7 @@ PSYCHO_WRITE8(sc, PSR_PWRMGT_INT_CLR, 0); /* Gee, we don't really have a framework to deal with this properly. */ device_printf(sc->sc_dev, "power management wakeup\n"); + return (FILTER_HANDLED); } #endif /* PSYCHO_MAP_WAKEUP */ @@ -988,7 +1008,7 @@ } /* Write to the correct clr register, and call the actual handler. */ -static void +static int psycho_intr_stub(void *arg) { struct psycho_clr *pc = arg; @@ -1000,11 +1020,13 @@ } pc->pci_handler(pc->pci_arg); PSYCHO_WRITE8(pc->pci_sc, pc->pci_clr, 0); + return (FILTER_HANDLED); } static int psycho_setup_intr(device_t dev, device_t child, struct resource *ires, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) { struct { int apb:1; @@ -1019,6 +1041,9 @@ uint64_t mr; int error, ino; + if (filt != NULL && intr != NULL) + return (EINVAL); + sc = device_get_softc(dev); pc = malloc(sizeof(*pc), M_DEVBUF, M_NOWAIT | M_ZERO); if (pc == NULL) @@ -1048,7 +1073,7 @@ pc->pci_sc = sc; pc->pci_arg = arg; - pc->pci_handler = intr; + pc->pci_handler = (filt != NULL) ? filt : (driver_filter_t *)intr; pc->pci_clr = intrclrptr; /* @@ -1104,8 +1129,12 @@ /* Disable the interrupt while we fiddle with it. */ mr = PSYCHO_READ8(sc, intrmapptr); PSYCHO_WRITE8(sc, intrmapptr, mr & ~INTMAP_V); - error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, - psycho_intr_stub, pc, cookiep); + if (filt != NULL) + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + psycho_intr_stub, NULL, pc, cookiep); + else + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + NULL, (driver_intr_t *)psycho_intr_stub, pc, cookiep); if (error != 0) { free(pc, M_DEVBUF); return (error); --- p4_head/sys/sparc64/sbus/sbus.c Sun Jan 21 15:20:45 2007 +++ p4_head_intr/sys/sparc64/sbus/sbus.c Fri Jan 26 13:54:09 2007 @@ -181,7 +181,7 @@ struct sbus_clr { struct sbus_softc *scl_sc; bus_addr_t scl_clr; /* clear register */ - driver_intr_t *scl_handler; /* handler to call */ + driver_filter_t *scl_handler; /* handler to call */ void *scl_arg; /* argument for the handler */ void *scl_cookie; /* parent bus int. cookie */ }; @@ -209,10 +209,10 @@ static struct sbus_devinfo * sbus_setup_dinfo(device_t, struct sbus_softc *, phandle_t); static void sbus_destroy_dinfo(struct sbus_devinfo *); -static void sbus_intr_stub(void *); +static int sbus_intr_stub(void *); static bus_space_tag_t sbus_alloc_bustag(struct sbus_softc *); -static void sbus_overtemp(void *); -static void sbus_pwrfail(void *); +static int sbus_overtemp(void *); +static int sbus_pwrfail(void *); static int sbus_print_res(struct sbus_devinfo *); static device_method_t sbus_methods[] = { @@ -433,8 +433,8 @@ sc->sc_ot_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, vec, vec, 1, RF_ACTIVE); if (sc->sc_ot_ires == NULL || - bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_FAST, - sbus_overtemp, sc, &sc->sc_ot_ihand) != 0) + bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC, + sbus_overtemp, NULL, sc, &sc->sc_ot_ihand) != 0) panic("%s: failed to set up temperature interrupt", __func__); SYSIO_WRITE8(sc, SBR_THERM_INT_MAP, INTMAP_ENABLE(mr, PCPU_GET(mid))); rid = 0; @@ -443,8 +443,8 @@ sc->sc_pf_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, vec, vec, 1, RF_ACTIVE); if (sc->sc_pf_ires == NULL || - bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_FAST, - sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0) + bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC, + sbus_pwrfail, NULL, sc, &sc->sc_pf_ihand) != 0) panic("%s: failed to set up power fail interrupt", __func__); SYSIO_WRITE8(sc, SBR_POWER_INT_MAP, INTMAP_ENABLE(mr, PCPU_GET(mid))); @@ -637,7 +637,7 @@ } /* Write to the correct clr register, and call the actual handler. */ -static void +static int sbus_intr_stub(void *arg) { struct sbus_clr *scl; @@ -645,11 +645,12 @@ scl = (struct sbus_clr *)arg; scl->scl_handler(scl->scl_arg); SYSIO_WRITE8(scl->scl_sc, scl->scl_clr, 0); + return (FILTER_HANDLED); } static int sbus_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, - driver_intr_t *intr, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { struct sbus_softc *sc; struct sbus_clr *scl; @@ -658,7 +659,9 @@ u_int32_t inr, slot; int error, i; long vec; - + + if (filt != NULL && intr != NULL) + return (EINVAL); sc = device_get_softc(dev); scl = (struct sbus_clr *)malloc(sizeof(*scl), M_DEVBUF, M_NOWAIT); if (scl == NULL) @@ -697,12 +700,16 @@ scl->scl_sc = sc; scl->scl_arg = arg; - scl->scl_handler = intr; + scl->scl_handler = (filt != NULL) ? filt : (driver_filter_t *)intr; scl->scl_clr = intrclrptr; /* Disable the interrupt while we fiddle with it */ SYSIO_WRITE8(sc, intrmapptr, intrmap & ~INTMAP_V); - error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, - sbus_intr_stub, scl, cookiep); + if (filt != NULL) + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + sbus_intr_stub, NULL, scl, cookiep); + else + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + NULL, (driver_intr_t *)sbus_intr_stub, scl, cookiep); if (error != 0) { free(scl, M_DEVBUF); return (error); @@ -913,21 +920,23 @@ * This handles the interrupt and powers off the machine. * The same needs to be done to PCI controller drivers. */ -static void +static int sbus_overtemp(void *arg) { printf("DANGER: OVER TEMPERATURE detected\nShutting down NOW.\n"); shutdown_nice(RB_POWEROFF); + return (FILTER_HANDLED); } /* Try to shut down in time in case of power failure. */ -static void +static int sbus_pwrfail(void *arg) { printf("Power failure detected\nShutting down NOW.\n"); shutdown_nice(0); + return (FILTER_HANDLED); } static bus_space_tag_t --- p4_head/sys/sparc64/sparc64/intr_machdep.c Sun Jan 21 15:20:45 2007 +++ p4_head_intr/sys/sparc64/sparc64/intr_machdep.c Fri Jan 26 13:54:09 2007 @@ -248,14 +248,14 @@ /* Execute fast interrupt handlers directly. */ thread = 0; TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) { + if (ih->ih_filter == NULL) { thread = 1; continue; } - MPASS(ih->ih_flags & IH_FAST && ih->ih_argument != NULL); + MPASS(ih->ih_filter != NULL && ih->ih_argument != NULL); CTR3(KTR_INTR, "%s: executing handler %p(%p)", __func__, - ih->ih_handler, ih->ih_argument); - ih->ih_handler(ih->ih_argument); + ih->ih_filter, ih->ih_argument); + ih->ih_filter(ih->ih_argument); } /* Schedule a heavyweight interrupt process. */ @@ -270,8 +270,8 @@ } int -inthand_add(const char *name, int vec, void (*handler)(void *), void *arg, - int flags, void **cookiep) +inthand_add(const char *name, int vec, driver_filter_t *filt, + void (*handler)(void *), void *arg, int flags, void **cookiep) { struct intr_vector *iv; struct intr_event *ie; /* descriptor for the IRQ */ @@ -303,12 +303,12 @@ } } - errcode = intr_event_add_handler(ie, name, handler, arg, + errcode = intr_event_add_handler(ie, name, filt, handler, arg, intr_priority(flags), flags, cookiep); if (errcode) return (errcode); - intr_setup(flags & INTR_FAST ? PIL_FAST : PIL_ITHREAD, intr_fast, vec, + intr_setup(filt != NULL ? PIL_FAST : PIL_ITHREAD, intr_fast, vec, intr_execute_handlers, iv); intr_stray_count[vec] = 0; --- p4_head/sys/sparc64/sparc64/nexus.c Sun Jan 21 15:20:46 2007 +++ p4_head_intr/sys/sparc64/sparc64/nexus.c Fri Jan 26 13:54:09 2007 @@ -313,7 +313,7 @@ static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_intr_t *intr, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { int error; @@ -329,7 +329,7 @@ return (error); error = inthand_add(device_get_nameunit(child), rman_get_start(res), - intr, arg, flags, cookiep); + filt, intr, arg, flags, cookiep); return (error); } --- p4_head/sys/sparc64/sparc64/upa.c Sun Jan 21 15:20:46 2007 +++ p4_head_intr/sys/sparc64/sparc64/upa.c Fri Jan 26 13:54:09 2007 @@ -401,7 +401,7 @@ static int upa_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, - driver_intr_t *func, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *func, void *arg, void **cookiep) { struct upa_softc *sc; uint64_t intrmap; @@ -427,7 +427,7 @@ UPA_WRITE(sc, imr, 0x0, intrmap & ~INTMAP_V); (void)UPA_READ(sc, imr, 0x0); - error = bus_generic_setup_intr(dev, child, ires, flags, func, arg, + error = bus_generic_setup_intr(dev, child, ires, flags, filt, func, arg, cookiep); if (error != 0) return (error); --- p4_head/sys/sun4v/include/intr_machdep.h Sun Jan 21 15:20:47 2007 +++ p4_head_intr/sys/sun4v/include/intr_machdep.h Fri Jan 26 13:54:09 2007 @@ -79,8 +79,8 @@ void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf, void *iva); -int inthand_add(const char *name, int vec, void (*handler)(void *), - void *arg, int flags, void **cookiep); +int inthand_add(const char *name, int vec, int (*filt)(void *), + void (*handler)(void *), void *arg, int flags, void **cookiep); int inthand_remove(int vec, void *cookie); void cpu_intrq_init(void); --- p4_head/sys/sun4v/sun4v/hvcons.c Sun Jan 21 15:20:49 2007 +++ p4_head_intr/sys/sun4v/sun4v/hvcons.c Fri Jan 26 13:54:09 2007 @@ -390,7 +390,7 @@ goto fail; } - error = bus_setup_intr(dev, hvcn_irq, INTR_TYPE_TTY, hvcn_intr, hvcn_tp, + error = bus_setup_intr(dev, hvcn_irq, INTR_TYPE_TTY, NULL, hvcn_intr, hvcn_tp, hvcn_intrhand); if (error) --- p4_head/sys/sun4v/sun4v/intr_machdep.c Sun Jan 21 15:20:49 2007 +++ p4_head_intr/sys/sun4v/sun4v/intr_machdep.c Fri Jan 26 13:54:09 2007 @@ -144,7 +144,7 @@ static void intr_execute_handlers(void *); static void intr_stray_level(struct trapframe *); -static void intr_stray_vector(void *); +static void intr_stray_vector(void *); static int intrcnt_setname(const char *, int); static void intrcnt_updatename(int, const char *, int); static void cpu_intrq_alloc(void); @@ -292,14 +292,14 @@ thread = 0; TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) { + if (ih->ih_filter == NULL) { thread = 1; continue; } - MPASS(ih->ih_flags & IH_FAST && ih->ih_argument != NULL); + MPASS(ih->ih_filter == NULL && ih->ih_argument != NULL); CTR3(KTR_INTR, "%s: executing handler %p(%p)", __func__, - ih->ih_handler, ih->ih_argument); - ih->ih_handler(ih->ih_argument); + ih->ih_filter, ih->ih_argument); + ih->ih_filter(ih->ih_argument); } /* Schedule a heavyweight interrupt process. */ @@ -313,7 +313,7 @@ } } -static void +static int ithread_wrapper(void *arg) { struct ithread_vector_handler *ivh = (struct ithread_vector_handler *)arg; @@ -321,12 +321,12 @@ ivh->ivh_handler(ivh->ivh_arg); /* re-enable interrupt */ hv_intr_setstate(ivh->ivh_vec, HV_INTR_IDLE_STATE); - + return (FILTER_HANDLED); } int -inthand_add(const char *name, int vec, void (*handler)(void *), void *arg, - int flags, void **cookiep) +inthand_add(const char *name, int vec, driver_filter_t *filt, + void (*handler)(void *), void *arg, int flags, void **cookiep) { struct intr_vector *iv; struct intr_event *ie; /* descriptor for the IRQ */ @@ -334,6 +334,8 @@ struct ithread_vector_handler *ivh; int errcode, pil; + if (filt != NULL && handler != NULL) + return (EINVAL); /* * Work around a race where more than one CPU may be registering * handlers on the same IRQ at the same time. @@ -359,17 +361,17 @@ } } - if (!(flags & INTR_FAST)) { + if (filt != NULL) { ivh = (struct ithread_vector_handler *) malloc(sizeof(struct ithread_vector_handler), M_DEVBUF, M_WAITOK); - ivh->ivh_handler = handler; + ivh->ivh_handler = (driver_intr_t *)filt; ivh->ivh_arg = arg; ivh->ivh_vec = vec; - errcode = intr_event_add_handler(ie, name, ithread_wrapper, ivh, + errcode = intr_event_add_handler(ie, name, ithread_wrapper, NULL, ivh, intr_priority(flags), flags, cookiep); } else { ivh = NULL; - errcode = intr_event_add_handler(ie, name, handler, arg, + errcode = intr_event_add_handler(ie, name, NULL, handler, arg, intr_priority(flags), flags, cookiep); } @@ -379,7 +381,7 @@ free(ivh, M_DEVBUF); return (errcode); } - pil = (flags & INTR_FAST) ? PIL_FAST : PIL_ITHREAD; + pil = (filt != NULL) ? PIL_FAST : PIL_ITHREAD; intr_setup(pil, intr_fast, vec, intr_execute_handlers, iv); --- p4_head/sys/sun4v/sun4v/nexus.c Sun Jan 21 15:20:49 2007 +++ p4_head_intr/sys/sun4v/sun4v/nexus.c Fri Jan 26 13:54:09 2007 @@ -306,7 +306,7 @@ static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_intr_t *intr, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { struct nexus_devinfo *ndi; device_t ichild; @@ -346,7 +346,7 @@ goto fail; error = inthand_add(device_get_nameunit(child), ihdl, - intr, arg, flags, cookiep); + filt, intr, arg, flags, cookiep); cpuid = 0; if (hv_intr_settarget(ihdl, cpuid) != H_EOK) { --- p4_head/sys/sun4v/sun4v/vnex.c Sun Jan 21 15:20:50 2007 +++ p4_head_intr/sys/sun4v/sun4v/vnex.c Fri Jan 26 13:54:09 2007 @@ -249,7 +249,7 @@ static int vnex_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_intr_t *intr, void *arg, void **cookiep) + driver_filter_t *filt,driver_intr_t *intr, void *arg, void **cookiep) { uint64_t reg, nreg; @@ -298,7 +298,7 @@ goto fail; error = inthand_add(device_get_nameunit(child), ihdl, - intr, arg, flags, cookiep); + filt, intr, arg, flags, cookiep); printf("inthandler added\n"); fail: --- p4_head/sys/sys/bus.h Sun Jan 21 15:20:50 2007 +++ p4_head_intr/sys/sys/bus.h Fri Jan 26 13:54:09 2007 @@ -122,8 +122,43 @@ #define device_method_t kobj_method_t /** - * @brief A driver interrupt service routine + * @brief Driver interrupt filter return values + * + * If a driver provides an interrupt filter routine it must return an + * integer consisting of oring together zero or more of the following + * flags: + * + * FILTER_STRAY - this device did not trigger the interrupt + * FILTER_HANDLED - the interrupt has been fully handled and can be EOId + * FILTER_SCHEDULE_THREAD - the threaded interrupt handler should be + * scheduled to execute + * + * If the driver does not provide a filter, then the interrupt code will + * act is if the filter had returned FILTER_SCHEDULE_THREAD. Note that it + * is illegal to specify any other flag with FILTER_STRAY and that it is + * illegal to not specify either of FILTER_HANDLED or FILTER_SCHEDULE_THREAD + * if FILTER_STRAY is not specified. */ +#define FILTER_STRAY 0x01 +#define FILTER_HANDLED 0x02 +#define FILTER_SCHEDULE_THREAD 0x04 + +/** + * @brief Driver interrupt service routines + * + * The filter routine is run in primary interrupt context and may not + * block or use regular mutexes. It may only use spin mutexes for + * synchronization. The filter may either completely handle the + * interrupt or it may perform some of the work and defer more + * expensive work to the regular interrupt handler. If a filter + * routine is not registered by the driver, then the regular interrupt + * handler is always used to handle interrupts from this device. + * + * The regular interrupt handler executes in its own thread context + * and may use regular mutexes. However, it is prohibited from + * sleeping on a sleep queue. + */ +typedef int driver_filter_t(void*); typedef void driver_intr_t(void*); /** @@ -272,7 +307,8 @@ int bus_generic_resume(device_t dev); int bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, - driver_intr_t *intr, void *arg, void **cookiep); + driver_filter_t *filter, driver_intr_t *intr, + void *arg, void **cookiep); struct resource * bus_generic_rl_alloc_resource (device_t, device_t, int, int *, @@ -318,7 +354,8 @@ struct resource *r); int bus_free_resource(device_t dev, int type, struct resource *r); int bus_setup_intr(device_t dev, struct resource *r, int flags, - driver_intr_t handler, void *arg, void **cookiep); + driver_filter_t filter, driver_intr_t handler, + void *arg, void **cookiep); int bus_teardown_intr(device_t dev, struct resource *r, void *cookie); int bus_set_resource(device_t dev, int type, int rid, u_long start, u_long count); --- p4_head/sys/sys/interrupt.h Sun Jan 21 15:20:52 2007 +++ p4_head_intr/sys/sys/interrupt.h Fri Jan 26 13:54:09 2007 @@ -34,6 +34,7 @@ struct intr_event; struct intr_thread; +struct trapframe; /* * Describe a hardware interrupt handler. @@ -42,6 +43,7 @@ * together. */ struct intr_handler { + driver_filter_t *ih_filter; /* Filter function. */ driver_intr_t *ih_handler; /* Handler function. */ void *ih_argument; /* Argument to pass to handler. */ int ih_flags; @@ -53,7 +55,6 @@ }; /* Interrupt handle flags kept in ih_flags */ -#define IH_FAST 0x00000001 /* Fast interrupt. */ #define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */ #define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */ #define IH_DEAD 0x00000008 /* Handler should be removed. */ @@ -111,10 +112,11 @@ #ifdef DDB void db_dump_intr_event(struct intr_event *ie, int handlers); #endif +int intr_event_handle(struct intr_event *ie, struct trapframe *frame); u_char intr_priority(enum intr_type flags); int intr_event_add_handler(struct intr_event *ie, const char *name, - driver_intr_t handler, void *arg, u_char pri, enum intr_type flags, - void **cookiep); + driver_filter_t filter, driver_intr_t handler, void *arg, + u_char pri, enum intr_type flags, void **cookiep); int intr_event_create(struct intr_event **event, void *source, int flags, void (*enable)(void *), const char *fmt, ...) __printflike(5, 6);