1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

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
This commit is contained in:
Marius Strobl 2011-01-04 16:11:32 +00:00
parent aa829cef6a
commit f4ff513c4b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216961
7 changed files with 17 additions and 11 deletions

View File

@ -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 *);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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__);

View File

@ -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) {

View File

@ -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 {