svn commit: r216961 - in head/sys: sparc64/include sparc64/pci sparc64/sbus sparc64/sparc64 sys

Marius Strobl marius at FreeBSD.org
Tue Jan 4 16:11:33 UTC 2011


Author: marius
Date: Tue Jan  4 16:11:32 2011
New Revision: 216961
URL: http://svn.freebsd.org/changeset/base/216961

Log:
  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

Modified:
  head/sys/sparc64/include/intr_machdep.h
  head/sys/sparc64/pci/fire.c
  head/sys/sparc64/pci/psycho.c
  head/sys/sparc64/pci/schizo.c
  head/sys/sparc64/sbus/sbus.c
  head/sys/sparc64/sparc64/intr_machdep.c
  head/sys/sys/bus.h

Modified: head/sys/sparc64/include/intr_machdep.h
==============================================================================
--- head/sys/sparc64/include/intr_machdep.h	Tue Jan  4 15:55:15 2011	(r216960)
+++ head/sys/sparc64/include/intr_machdep.h	Tue Jan  4 16:11:32 2011	(r216961)
@@ -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 *);

Modified: head/sys/sparc64/pci/fire.c
==============================================================================
--- head/sys/sparc64/pci/fire.c	Tue Jan  4 15:55:15 2011	(r216960)
+++ head/sys/sparc64/pci/fire.c	Tue Jan  4 16:11:32 2011	(r216961)
@@ -836,7 +836,7 @@ fire_set_intr(struct fire_softc *sc, u_i
 	    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);
 }

Modified: head/sys/sparc64/pci/psycho.c
==============================================================================
--- head/sys/sparc64/pci/psycho.c	Tue Jan  4 15:55:15 2011	(r216960)
+++ head/sys/sparc64/pci/psycho.c	Tue Jan  4 16:11:32 2011	(r216961)
@@ -716,7 +716,7 @@ psycho_set_intr(struct psycho_softc *sc,
 	    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);
 }

Modified: head/sys/sparc64/pci/schizo.c
==============================================================================
--- head/sys/sparc64/pci/schizo.c	Tue Jan  4 15:55:15 2011	(r216960)
+++ head/sys/sparc64/pci/schizo.c	Tue Jan  4 16:11:32 2011	(r216961)
@@ -745,7 +745,7 @@ schizo_set_intr(struct schizo_softc *sc,
 	    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);
 }

Modified: head/sys/sparc64/sbus/sbus.c
==============================================================================
--- head/sys/sparc64/sbus/sbus.c	Tue Jan  4 15:55:15 2011	(r216960)
+++ head/sys/sparc64/sbus/sbus.c	Tue Jan  4 16:11:32 2011	(r216961)
@@ -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__);
 

Modified: head/sys/sparc64/sparc64/intr_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/intr_machdep.c	Tue Jan  4 15:55:15 2011	(r216960)
+++ head/sys/sparc64/sparc64/intr_machdep.c	Tue Jan  4 16:11:32 2011	(r216961)
@@ -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, d
 	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, d
 	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) {

Modified: head/sys/sys/bus.h
==============================================================================
--- head/sys/sys/bus.h	Tue Jan  4 15:55:15 2011	(r216960)
+++ head/sys/sys/bus.h	Tue Jan  4 16:11:32 2011	(r216961)
@@ -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 {


More information about the svn-src-all mailing list