--- 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/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/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/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);