Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2011 05:58:52 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218184 - in head/sys/powerpc: include mpc85xx ofw powermac powerpc
Message-ID:  <201102020558.p125wqiT097664@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Wed Feb  2 05:58:51 2011
New Revision: 218184
URL: http://svn.freebsd.org/changeset/base/218184

Log:
  Rename INTR_VEC to MAP_IRQ. From the OFW or FDT we obtain a
  PIC handle with interrupt pin. This we map to the resource
  called SYS_RES_IRQ.

Modified:
  head/sys/powerpc/include/intr_machdep.h
  head/sys/powerpc/mpc85xx/pci_fdt.c
  head/sys/powerpc/ofw/ofw_pcib_pci.c
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/powerpc/powermac/cpcht.c
  head/sys/powerpc/powermac/grackle.c
  head/sys/powerpc/powermac/macgpio.c
  head/sys/powerpc/powermac/macio.c
  head/sys/powerpc/powermac/uninorth.c
  head/sys/powerpc/powermac/uninorthpci.c
  head/sys/powerpc/powerpc/intr_machdep.c

Modified: head/sys/powerpc/include/intr_machdep.h
==============================================================================
--- head/sys/powerpc/include/intr_machdep.h	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/include/intr_machdep.h	Wed Feb  2 05:58:51 2011	(r218184)
@@ -31,7 +31,7 @@
 #define	INTR_VECTORS	256
 
 #define	MAX_PICS		5
-#define	INTR_VEC(node, pin)	powerpc_get_irq(node, pin)
+#define	MAP_IRQ(node, pin)	powerpc_get_irq(node, pin)
 
 /*
  * Default base address for MSI messages on PowerPC

Modified: head/sys/powerpc/mpc85xx/pci_fdt.c
==============================================================================
--- head/sys/powerpc/mpc85xx/pci_fdt.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/mpc85xx/pci_fdt.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -554,11 +554,11 @@ fsl_pcib_route_int(struct fsl_pcib_softc
 
 	devfn = DEVFN(bus, slot, func);
 	if (devfn == sc->sc_devfn_via_ide)
-		intline = INTR_VEC(0, 14);
+		intline = MAP_IRQ(0, 14);
 	else if (devfn == sc->sc_devfn_via_ide + 1)
-		intline = INTR_VEC(0, 10);
+		intline = MAP_IRQ(0, 10);
 	else if (devfn == sc->sc_devfn_via_ide + 2)
-		intline = INTR_VEC(0, 10);
+		intline = MAP_IRQ(0, 10);
 	else {
 		if (intpin != 0)
 			err = fdt_pci_route_intr(bus, slot, func, intpin,

Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_pcib_pci.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/ofw/ofw_pcib_pci.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -171,7 +171,7 @@ ofw_pcib_pci_route_interrupt(device_t br
 			 * it again on higher levels - that causes problems
 			 * in some cases, and never seems to be required.
 			 */
-			return (INTR_VEC(iparent, mintr));
+			return (MAP_IRQ(iparent, mintr));
 		}
 	} else if (intpin >= 1 && intpin <= 4) {
 		/*

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_pcibus.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/ofw/ofw_pcibus.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -213,7 +213,7 @@ ofw_pcibus_enum_devtree(device_t dev, u_
 				    sizeof(icells));
 
 				if (iparent != 0)
-					intr[0] = INTR_VEC(iparent, intr[0]);
+					intr[0] = MAP_IRQ(iparent, intr[0]);
 
 				if (iparent != 0 && icells > 1) {
 					powerpc_config_intr(intr[0],
@@ -348,12 +348,12 @@ ofw_pcibus_assign_interrupt(device_t dev
 
 	isz = OF_getprop(node, "AAPL,interrupts", &intr, sizeof(intr));
 	if (isz == sizeof(intr))
-		return ((iparent == -1) ? intr : INTR_VEC(iparent, intr));
+		return ((iparent == -1) ? intr : MAP_IRQ(iparent, intr));
 
 	isz = OF_getprop(node, "interrupts", &intr, sizeof(intr));
 	if (isz == sizeof(intr)) {
 		if (iparent != -1)
-			intr = INTR_VEC(iparent, intr);
+			intr = MAP_IRQ(iparent, intr);
 	} else {
 		/* No property: our best guess is the intpin. */
 		intr = pci_get_intpin(child);

Modified: head/sys/powerpc/powermac/cpcht.c
==============================================================================
--- head/sys/powerpc/powermac/cpcht.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/powermac/cpcht.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -655,7 +655,7 @@ cpcht_alloc_msi(device_t dev, device_t c
 	}
 
 	for (j = 0; j < count; j++) {
-		irqs[j] = INTR_VEC(cpcht_msipic, i+j);
+		irqs[j] = MAP_IRQ(cpcht_msipic, i+j);
 		sc->htirq_map[i+j].irq_type = IRQ_MSI;
 	}
 	mtx_unlock(&sc->htirq_mtx);
@@ -695,7 +695,7 @@ cpcht_alloc_msix(device_t dev, device_t 
 	for (i = 8; i < 124; i++) {
 		if (sc->htirq_map[i].irq_type == IRQ_NONE) {
 			sc->htirq_map[i].irq_type = IRQ_MSI;
-			*irq = INTR_VEC(cpcht_msipic, i);
+			*irq = MAP_IRQ(cpcht_msipic, i);
 
 			mtx_unlock(&sc->htirq_mtx);
 			return (0);

Modified: head/sys/powerpc/powermac/grackle.c
==============================================================================
--- head/sys/powerpc/powermac/grackle.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/powermac/grackle.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -353,7 +353,7 @@ grackle_route_interrupt(device_t bus, de
 	if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, &reg,
 	    sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
 	    &iparent, maskbuf))
-		return (INTR_VEC(iparent, mintr));
+		return (MAP_IRQ(iparent, mintr));
 
 	/* Maybe it's a real interrupt, not an intpin */
 	if (pin > 4)

Modified: head/sys/powerpc/powermac/macgpio.c
==============================================================================
--- head/sys/powerpc/powermac/macgpio.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/powermac/macgpio.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -191,7 +191,7 @@ macgpio_attach(device_t dev)
 			OF_searchprop(child, "interrupt-parent", &iparent,
 			    sizeof(iparent));
 			resource_list_add(&dinfo->mdi_resources, SYS_RES_IRQ,
-			    0, INTR_VEC(iparent, irq), INTR_VEC(iparent, irq),
+			    0, MAP_IRQ(iparent, irq), MAP_IRQ(iparent, irq),
 			    1);
 		}
 

Modified: head/sys/powerpc/powermac/macio.c
==============================================================================
--- head/sys/powerpc/powermac/macio.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/powermac/macio.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -218,12 +218,12 @@ macio_add_intr(phandle_t devnode, struct
 		panic("Interrupt but no interrupt parent!\n");
 
 	for (i = 0; i < nintr; i+=icells) {
+		u_int irq = MAP_IRQ(iparent, intr[i]);
+
 		resource_list_add(&dinfo->mdi_resources, SYS_RES_IRQ,
-		    dinfo->mdi_ninterrupts, INTR_VEC(iparent, intr[i]),
-		    INTR_VEC(iparent, intr[i]), 1);
+		    dinfo->mdi_ninterrupts, irq, irq, 1);
 
-		dinfo->mdi_interrupts[dinfo->mdi_ninterrupts] =
-		    INTR_VEC(iparent, intr[i]);
+		dinfo->mdi_interrupts[dinfo->mdi_ninterrupts] = irq;
 		dinfo->mdi_ninterrupts++;
 	}
 }

Modified: head/sys/powerpc/powermac/uninorth.c
==============================================================================
--- head/sys/powerpc/powermac/uninorth.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/powermac/uninorth.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -175,18 +175,18 @@ unin_chip_add_intr(phandle_t devnode, st
 		icells = 1;
 
 	for (i = 0; i < nintr; i+=icells) {
+		u_int irq = MAP_IRQ(iparent, intr[i]);
+
 		resource_list_add(&dinfo->udi_resources, SYS_RES_IRQ,
-		    dinfo->udi_ninterrupts, INTR_VEC(iparent, intr[i]),
-		    INTR_VEC(iparent, intr[i]), 1);
+		    dinfo->udi_ninterrupts, irq, irq, 1);
 
 		if (icells > 1) {
-			powerpc_config_intr(INTR_VEC(iparent, intr[i]),
+			powerpc_config_intr(irq,
 			    (intr[i+1] & 1) ? INTR_TRIGGER_LEVEL :
 			    INTR_TRIGGER_EDGE, INTR_POLARITY_LOW);
 		}
 
-		dinfo->udi_interrupts[dinfo->udi_ninterrupts] =
-		    INTR_VEC(iparent, intr[i]);
+		dinfo->udi_interrupts[dinfo->udi_ninterrupts] = irq;
 		dinfo->udi_ninterrupts++;
 	}
 }

Modified: head/sys/powerpc/powermac/uninorthpci.c
==============================================================================
--- head/sys/powerpc/powermac/uninorthpci.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/powermac/uninorthpci.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -367,7 +367,7 @@ uninorth_route_interrupt(device_t bus, d
 	if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, &reg,
 	    sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
 	    &iparent, maskbuf))
-		return (INTR_VEC(iparent, mintr));
+		return (MAP_IRQ(iparent, mintr));
 
 	/* Maybe it's a real interrupt, not an intpin */
 	if (pin > 4)

Modified: head/sys/powerpc/powerpc/intr_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/intr_machdep.c	Wed Feb  2 03:55:34 2011	(r218183)
+++ head/sys/powerpc/powerpc/intr_machdep.c	Wed Feb  2 05:58:51 2011	(r218184)
@@ -403,7 +403,7 @@ powerpc_enable_intr(void)
 
 		KASSERT(piclist[n].ipis != 0, ("%s", __func__));
 		error = powerpc_setup_intr("IPI",
-		    INTR_VEC(piclist[n].node, piclist[n].irqs),
+		    MAP_IRQ(piclist[n].node, piclist[n].irqs),
 		    powerpc_ipi_handler, NULL, NULL,
 		    INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie);
 		if (error) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102020558.p125wqiT097664>