From: Matthew Dillon Date: Thu, 10 Jun 2010 00:13:57 +0000 (-0700) Subject: kernel - remove INTR_FAST X-Git-Url: https://gitweb.dragonflybsd.org/~mneumann/dragonfly.git/commitdiff_plain/f8a09be1e61a815288209b41b6a39ee4cdbd2f1a kernel - remove INTR_FAST Rename INTR_FAST to INTR_CLOCK. Fast interrupts are now only supported for clock interrupts and may no longer be used by drivers. * Rename INTR_FAST to INTR_CLOCK * Adjust clocks to use INTR_CLOCK and remove INTR_FAST from the few drivers that specified it (if_em is the only one of note). --- diff --git a/sys/bus/isa/i386/isa_compat.h b/sys/bus/isa/i386/isa_compat.h index 327fe5d009..4add593e77 100644 --- a/sys/bus/isa/i386/isa_compat.h +++ b/sys/bus/isa/i386/isa_compat.h @@ -89,7 +89,7 @@ static struct old_isa_driver old_drivers[] = { { 0, &gscdriver }, #endif #if NCY > 0 - { INTR_FAST, &cydriver }, + { 0, &cydriver }, #endif #if NDGB > 0 { 0, &dgbdriver }, diff --git a/sys/bus/isa/x86_64/isa_compat.h b/sys/bus/isa/x86_64/isa_compat.h index 148502ee8f..135f1740c6 100644 --- a/sys/bus/isa/x86_64/isa_compat.h +++ b/sys/bus/isa/x86_64/isa_compat.h @@ -88,7 +88,7 @@ static struct old_isa_driver old_drivers[] = { { 0, &gscdriver }, #endif #if NCY > 0 - { INTR_FAST, &cydriver }, + { 0, &cydriver }, #endif #if NDGB > 0 { 0, &dgbdriver }, diff --git a/sys/bus/pci/pci_compat.c b/sys/bus/pci/pci_compat.c index c66eb09736..adba37727c 100644 --- a/sys/bus/pci/pci_compat.c +++ b/sys/bus/pci/pci_compat.c @@ -129,8 +129,8 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg, u_int intflags int resflags = RF_SHAREABLE|RF_ACTIVE; void *ih; - if (intflags & INTR_FAST) - flags |= INTR_FAST; + if (intflags & INTR_CLOCK) + flags |= INTR_CLOCK; if (intflags & INTR_EXCL) resflags &= ~RF_SHAREABLE; diff --git a/sys/dev/misc/puc/puc.c b/sys/dev/misc/puc/puc.c index fb1f7bd918..b507bca9b7 100644 --- a/sys/dev/misc/puc/puc.c +++ b/sys/dev/misc/puc/puc.c @@ -236,17 +236,9 @@ puc_pci_attach(device_t dev) sc->irqres = res; sc->irqrid = rid; -#ifdef PUC_FASTINTR irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, - INTR_FAST, puc_intr, sc, + 0, puc_intr, sc, &sc->intr_cookie, NULL); -#else - irq_setup = ENXIO; -#endif - if (irq_setup != 0) - irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, - 0, puc_intr, sc, - &sc->intr_cookie, NULL); if (irq_setup != 0) return (ENXIO); diff --git a/sys/dev/netif/e1000/if_em.c b/sys/dev/netif/e1000/if_em.c index 2a16194beb..cbdb4a9866 100644 --- a/sys/dev/netif/e1000/if_em.c +++ b/sys/dev/netif/e1000/if_em.c @@ -2798,7 +2798,7 @@ em_allocate_legacy(struct adapter *adapter) taskqueue_start_threads(&adapter->tq, 1, TDPRI_KERN_DAEMON /*PI_NET*/, -1, "%s taskq", device_get_nameunit(adapter->dev)); if ((error = bus_setup_intr(dev, adapter->res[0], - /*INTR_TYPE_NET |*/ INTR_FAST, em_irq_fast, adapter, + /*INTR_TYPE_NET |*/ 0, em_irq_fast, adapter, &adapter->tag[0], NULL)) != 0) { device_printf(dev, "Failed to register fast interrupt " "handler: %d\n", error); diff --git a/sys/dev/pccard/pccbb/pccbb.c b/sys/dev/pccard/pccbb/pccbb.c index 074b324033..c5e5d3b442 100644 --- a/sys/dev/pccard/pccbb/pccbb.c +++ b/sys/dev/pccard/pccbb/pccbb.c @@ -350,14 +350,6 @@ cbb_setup_intr(device_t dev, device_t child, struct resource *irq, struct cbb_softc *sc = device_get_softc(dev); int err; - /* - * Well, this is no longer strictly true. You can have multiple - * FAST ISRs, but can't mix fast and slow, so we have to assume - * least common denominator until the base system supports mixing - * and matching better. - */ - if ((flags & INTR_FAST) != 0) - return (EINVAL); ih = kmalloc(sizeof(struct cbb_intrhand), M_DEVBUF, M_NOWAIT); if (ih == NULL) return (ENOMEM); diff --git a/sys/dev/raid/aac/aac.c b/sys/dev/raid/aac/aac.c index 4e4e259184..09bd875108 100644 --- a/sys/dev/raid/aac/aac.c +++ b/sys/dev/raid/aac/aac.c @@ -317,9 +317,8 @@ aac_attach(struct aac_softc *sc) return (EINVAL); } } else { - if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_FAST, aac_fast_intr, - sc, &sc->aac_intr, NULL)) { + if (bus_setup_intr(sc->aac_dev, sc->aac_irq, 0, + aac_fast_intr, sc, &sc->aac_intr, NULL)) { device_printf(sc->aac_dev, "can't set up FAST interrupt\n"); if (bus_setup_intr(sc->aac_dev, sc->aac_irq, diff --git a/sys/dev/serial/cy/cy_pci.c b/sys/dev/serial/cy/cy_pci.c index 02f2fcd067..0efc6a921b 100644 --- a/sys/dev/serial/cy/cy_pci.c +++ b/sys/dev/serial/cy/cy_pci.c @@ -45,10 +45,6 @@ #include "cy_pcireg.h" -#ifdef CY_PCI_FASTINTR -#include -#endif - static const char *cy_probe (pcici_t, pcidi_t); static void cy_attach (pcici_t, int); @@ -112,13 +108,7 @@ cy_attach(pcici_t config_id, int unit) * since the ISA driver must handle the interrupt anyway, we use * the unit number as the token even for PCI. */ - if ( -#ifdef CY_PCI_FASTINTR - !pci_map_int_right(config_id, (pci_inthand_t *)cyintr, - (void *)adapter, - INTR_EXCL | INTR_FAST) && -#endif - !pci_map_int_right(config_id, (pci_inthand_t *)cyintr, + if (!pci_map_int_right(config_id, (pci_inthand_t *)cyintr, (void *)adapter, 0)) { kprintf("cy%d: couldn't map interrupt\n", unit); goto fail; diff --git a/sys/dev/serial/sio/sio.c b/sys/dev/serial/sio/sio.c index ef2b9c88d1..a40c01efbd 100644 --- a/sys/dev/serial/sio/sio.c +++ b/sys/dev/serial/sio/sio.c @@ -1198,16 +1198,9 @@ determined_type: ; com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, RF_ACTIVE); if (com->irqres) { - ret = BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, - INTR_FAST, siointr, com, + ret = BUS_SETUP_INTR(device_get_parent(dev), dev, + com->irqres, 0, siointr, com, &com->cookie, NULL); - if (ret) { - ret = BUS_SETUP_INTR(device_get_parent(dev), dev, - com->irqres, 0, siointr, com, - &com->cookie, NULL); - if (ret == 0) - device_printf(dev, "unable to activate interrupt in fast mode - using normal mode\n"); - } if (ret) device_printf(dev, "could not activate interrupt\n"); #if defined(DDB) && (defined(BREAK_TO_DEBUGGER) || \ diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index c615fade23..5bc5b59f90 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -270,7 +270,7 @@ register_int(int intr, inthand2_t *handler, void *arg, const char *name, */ if ((intr_flags & INTR_MPSAFE) == 0) info->i_mplock_required = 1; - if (intr_flags & INTR_FAST) + if (intr_flags & INTR_CLOCK) ++info->i_fast; else ++info->i_slow; @@ -363,7 +363,7 @@ unregister_int(void *id) intrec_t rec0; *list = rec->next; - if (rec->intr_flags & INTR_FAST) + if (rec->intr_flags & INTR_CLOCK) --info->i_fast; else --info->i_slow; @@ -672,7 +672,7 @@ ithread_fast_handler(struct intrframe *frame) for (rec = *list; rec; rec = next_rec) { next_rec = rec->next; /* rec may be invalid after call */ - if (rec->intr_flags & INTR_FAST) { + if (rec->intr_flags & INTR_CLOCK) { #ifdef SMP if ((rec->intr_flags & INTR_MPSAFE) == 0 && got_mplock == 0) { if (try_mplock() == 0) { diff --git a/sys/platform/pc32/isa/clock.c b/sys/platform/pc32/isa/clock.c index 913fb721de..ea0cee2a4b 100644 --- a/sys/platform/pc32/isa/clock.c +++ b/sys/platform/pc32/isa/clock.c @@ -1057,7 +1057,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) clkdesc = register_int(apic_8254_intr, clkintr, NULL, "clk", NULL, - INTR_EXCL | INTR_FAST | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_MPSAFE | INTR_NOENTROPY); machintr_intren(apic_8254_intr); @@ -1065,7 +1065,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) #else /* APIC_IO */ register_int(0, clkintr, NULL, "clk", NULL, - INTR_EXCL | INTR_FAST | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_MPSAFE | INTR_NOENTROPY); machintr_intren(ICU_IRQ0); @@ -1087,7 +1087,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) #endif /* APIC_IO */ register_int(8, (inthand2_t *)rtcintr, NULL, "rtc", NULL, - INTR_EXCL | INTR_FAST | INTR_NOPOLL | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_NOENTROPY); machintr_intren(8); @@ -1146,7 +1146,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) setup_8254_mixed_mode(); register_int(apic_8254_intr, clkintr, NULL, "clk", NULL, - INTR_EXCL | INTR_FAST | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_MPSAFE | INTR_NOENTROPY); machintr_intren(apic_8254_intr); diff --git a/sys/platform/pc64/isa/clock.c b/sys/platform/pc64/isa/clock.c index 235fccffe7..41941d3591 100644 --- a/sys/platform/pc64/isa/clock.c +++ b/sys/platform/pc64/isa/clock.c @@ -1060,7 +1060,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) clkdesc = register_int(apic_8254_intr, clkintr, NULL, "clk", NULL, - INTR_EXCL | INTR_FAST | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_MPSAFE | INTR_NOENTROPY); machintr_intren(apic_8254_intr); @@ -1068,7 +1068,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) #else /* APIC_IO */ register_int(0, clkintr, NULL, "clk", NULL, - INTR_EXCL | INTR_FAST | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_MPSAFE | INTR_NOENTROPY); machintr_intren(ICU_IRQ0); @@ -1090,7 +1090,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) #endif /* APIC_IO */ register_int(8, (inthand2_t *)rtcintr, NULL, "rtc", NULL, - INTR_EXCL | INTR_FAST | INTR_NOPOLL | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_NOENTROPY); machintr_intren(8); @@ -1149,7 +1149,7 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected) setup_8254_mixed_mode(); register_int(apic_8254_intr, clkintr, NULL, "clk", NULL, - INTR_EXCL | INTR_FAST | + INTR_EXCL | INTR_CLOCK | INTR_NOPOLL | INTR_MPSAFE | INTR_NOENTROPY); machintr_intren(apic_8254_intr); diff --git a/sys/sys/bus.h b/sys/sys/bus.h index cbf4722740..4fb84ef866 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -103,8 +103,11 @@ struct u_device { /* * Interrupt features mask. Note that DragonFly no longer implements * INTR_TYPE_* flags. + * + * NOTE: INTR_FAST is no longer supported, all device interrupts are threaded + * now. Only clock interrupts are 'fast'. */ -#define INTR_FAST 0x0080 +#define INTR_CLOCK 0x0080 /* (was INTR_FAST) */ #define INTR_EXCL 0x0100 #define INTR_MPSAFE 0x0200 #define INTR_NOENTROPY 0x0400