kernel - remove INTR_FAST
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 10 Jun 2010 00:13:57 +0000 (17:13 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 10 Jun 2010 00:13:57 +0000 (17:13 -0700)
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).

13 files changed:
sys/bus/isa/i386/isa_compat.h
sys/bus/isa/x86_64/isa_compat.h
sys/bus/pci/pci_compat.c
sys/dev/misc/puc/puc.c
sys/dev/netif/e1000/if_em.c
sys/dev/pccard/pccbb/pccbb.c
sys/dev/raid/aac/aac.c
sys/dev/serial/cy/cy_pci.c
sys/dev/serial/sio/sio.c
sys/kern/kern_intr.c
sys/platform/pc32/isa/clock.c
sys/platform/pc64/isa/clock.c
sys/sys/bus.h

index 327fe5d..4add593 100644 (file)
@@ -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 },
index 148502e..135f174 100644 (file)
@@ -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 },
index c66eb09..adba377 100644 (file)
@@ -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;
 
index fb1f7bd..b507bca 100644 (file)
@@ -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);
 
index 2a16194..cbdb4a9 100644 (file)
@@ -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);
index 074b324..c5e5d3b 100644 (file)
@@ -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);
index 4e4e259..09bd875 100644 (file)
@@ -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,
index 02f2fcd..0efc6a9 100644 (file)
 
 #include "cy_pcireg.h"
 
-#ifdef CY_PCI_FASTINTR
-#include <machine_base/isa/intr_machdep.h>
-#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;
index ef2b9c8..a40c01e 100644 (file)
@@ -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) || \
index c615fad..5bc5b59 100644 (file)
@@ -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) {
index 913fb72..ea0cee2 100644 (file)
@@ -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);
index 235fccf..41941d3 100644 (file)
@@ -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);
index cbf4722..4fb84ef 100644 (file)
@@ -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