From a7721f46767dadd132c989fd4377522c2dfacfc4 Mon Sep 17 00:00:00 2001 From: marius Date: Tue, 4 Jan 2011 16:11:32 +0000 Subject: Reserve INTR_MD[1-4] similarly to what BUS_DMA_BUS[1-4] are intended for and switch sparc64 to use the first one for bus error filter handlers of bridge drivers instead of (ab)using INTR_FAST for that so we eventually can get rid of the latter. Reviewed by: jhb MFC after: 1 month --- sys/sparc64/include/intr_machdep.h | 4 +++- sys/sparc64/pci/fire.c | 2 +- sys/sparc64/pci/psycho.c | 2 +- sys/sparc64/pci/schizo.c | 2 +- sys/sparc64/sbus/sbus.c | 4 ++-- sys/sparc64/sparc64/intr_machdep.c | 8 ++++---- sys/sys/bus.h | 6 +++++- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/sys/sparc64/include/intr_machdep.h b/sys/sparc64/include/intr_machdep.h index 158b5b6..6e472f7 100644 --- a/sys/sparc64/include/intr_machdep.h +++ b/sys/sparc64/include/intr_machdep.h @@ -48,11 +48,13 @@ #define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ #define PIL_HARDCLOCK 7 /* hardclock broadcast */ #define PIL_FILTER 12 /* filter interrupts */ -#define PIL_FAST 13 /* fast interrupts */ +#define PIL_BRIDGE 13 /* bridge interrupts */ #define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE +#define INTR_BRIDGE INTR_MD1 + struct trapframe; typedef void ih_func_t(struct trapframe *); diff --git a/sys/sparc64/pci/fire.c b/sys/sparc64/pci/fire.c index e401a6c..70fc13e 100644 --- a/sys/sparc64/pci/fire.c +++ b/sys/sparc64/pci/fire.c @@ -836,7 +836,7 @@ fire_set_intr(struct fire_softc *sc, u_int index, u_int ino, INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &fire_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], - INTR_TYPE_MISC | INTR_FAST, handler, NULL, arg, + INTR_TYPE_MISC | INTR_BRIDGE, handler, NULL, arg, &sc->sc_ihand[index]) != 0) panic("%s: failed to set up interrupt %d", __func__, index); } diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c index f916be0..62f016e 100644 --- a/sys/sparc64/pci/psycho.c +++ b/sys/sparc64/pci/psycho.c @@ -716,7 +716,7 @@ psycho_set_intr(struct psycho_softc *sc, u_int index, bus_addr_t intrmap, INTVEC(PSYCHO_READ8(sc, intrmap)) != vec || intr_vectors[vec].iv_ic != &psycho_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], - INTR_TYPE_MISC | INTR_FAST, filt, intr, sc, + INTR_TYPE_MISC | INTR_BRIDGE, filt, intr, sc, &sc->sc_ihand[index]) != 0) panic("%s: failed to set up interrupt %d", __func__, index); } diff --git a/sys/sparc64/pci/schizo.c b/sys/sparc64/pci/schizo.c index d2e22bc..d6dd003 100644 --- a/sys/sparc64/pci/schizo.c +++ b/sys/sparc64/pci/schizo.c @@ -745,7 +745,7 @@ schizo_set_intr(struct schizo_softc *sc, u_int index, u_int ino, INTIGN(vec) != sc->sc_ign || intr_vectors[vec].iv_ic != &schizo_ic || bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], - INTR_TYPE_MISC | INTR_FAST, handler, NULL, sc, + INTR_TYPE_MISC | INTR_BRIDGE, handler, NULL, sc, &sc->sc_ihand[index]) != 0) panic("%s: failed to set up interrupt %d", __func__, index); } diff --git a/sys/sparc64/sbus/sbus.c b/sys/sparc64/sbus/sbus.c index 597d382..8423512 100644 --- a/sys/sparc64/sbus/sbus.c +++ b/sys/sparc64/sbus/sbus.c @@ -459,7 +459,7 @@ sbus_attach(device_t dev) INTIGN(vec = rman_get_start(sc->sc_ot_ires)) != sc->sc_ign || INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec || intr_vectors[vec].iv_ic != &sbus_ic || - bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_FAST, + bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_BRIDGE, NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0) panic("%s: failed to set up temperature interrupt", __func__); i = 3; @@ -469,7 +469,7 @@ sbus_attach(device_t dev) INTIGN(vec = rman_get_start(sc->sc_pf_ires)) != sc->sc_ign || INTVEC(SYSIO_READ8(sc, SBR_POWER_INT_MAP)) != vec || intr_vectors[vec].iv_ic != &sbus_ic || - bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_FAST, + bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_BRIDGE, NULL, sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0) panic("%s: failed to set up power fail interrupt", __func__); diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c index 8571286..f6ef9a7 100644 --- a/sys/sparc64/sparc64/intr_machdep.c +++ b/sys/sparc64/sparc64/intr_machdep.c @@ -99,7 +99,7 @@ static const char *const pil_names[] = { "hardclock", /* PIL_HARDCLOCK */ "stray", "stray", "stray", "stray", "filter", /* PIL_FILTER */ - "fast", /* PIL_FAST */ + "bridge", /* PIL_BRIDGE */ "tick", /* PIL_TICK */ }; @@ -328,10 +328,10 @@ inthand_add(const char *name, int vec, driver_filter_t *filt, if (vec < 0 || vec >= IV_MAX) return (EINVAL); /* - * INTR_FAST filters/handlers are special purpose only, allowing + * INTR_BRIDGE filters/handlers are special purpose only, allowing * them to be shared just would complicate things unnecessarily. */ - if ((flags & INTR_FAST) != 0 && (flags & INTR_EXCL) == 0) + if ((flags & INTR_BRIDGE) != 0 && (flags & INTR_EXCL) == 0) return (EINVAL); sx_xlock(&intr_table_lock); iv = &intr_vectors[vec]; @@ -349,7 +349,7 @@ inthand_add(const char *name, int vec, driver_filter_t *filt, ic->ic_disable(iv); iv->iv_refcnt++; if (iv->iv_refcnt == 1) - intr_setup((flags & INTR_FAST) != 0 ? PIL_FAST : + intr_setup((flags & INTR_BRIDGE) != 0 ? PIL_BRIDGE : filt != NULL ? PIL_FILTER : PIL_ITHREAD, intr_fast, vec, intr_execute_handlers, iv); else if (filt != NULL) { diff --git a/sys/sys/bus.h b/sys/sys/bus.h index ec3be64..1e15846 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -194,7 +194,11 @@ enum intr_type { INTR_FAST = 128, INTR_EXCL = 256, /* exclusive interrupt */ INTR_MPSAFE = 512, /* this interrupt is SMP safe */ - INTR_ENTROPY = 1024 /* this interrupt provides entropy */ + INTR_ENTROPY = 1024, /* this interrupt provides entropy */ + INTR_MD1 = 4096, /* flag reserved for MD use */ + INTR_MD2 = 8192, /* flag reserved for MD use */ + INTR_MD3 = 16384, /* flag reserved for MD use */ + INTR_MD4 = 32768 /* flag reserved for MD use */ }; enum intr_trigger { -- cgit v1.1