Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jan 2015 18:15:17 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276713 - head/sys/powerpc/pseries
Message-ID:  <201501051815.t05IFHBT058793@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Mon Jan  5 18:15:16 2015
New Revision: 276713
URL: https://svnweb.freebsd.org/changeset/base/276713

Log:
  Revert r272109 locally, which is not quite equivalent in how it deals with
  missing interrupt-parent properties. A better solution will come later,
  but this restores pseries in QEMU for the time being.

Modified:
  head/sys/powerpc/pseries/vdevice.c

Modified: head/sys/powerpc/pseries/vdevice.c
==============================================================================
--- head/sys/powerpc/pseries/vdevice.c	Mon Jan  5 17:23:02 2015	(r276712)
+++ head/sys/powerpc/pseries/vdevice.c	Mon Jan  5 18:15:16 2015	(r276713)
@@ -128,6 +128,8 @@ vdevice_attach(device_t dev) 
 {
 	phandle_t root, child;
 	device_t cdev;
+	int icells, i, nintr, *intr;
+	phandle_t iparent;
 	struct vdevice_devinfo *dinfo;
 
 	root = ofw_bus_get_node(dev);
@@ -142,7 +144,25 @@ vdevice_attach(device_t dev) 
                 }
 		resource_list_init(&dinfo->mdi_resources);
 
-		ofw_bus_intr_to_rl(dev, child, &dinfo->mdi_resources);
+		if (OF_searchprop(child, "#interrupt-cells", &icells,
+		    sizeof(icells)) <= 0)
+			icells = 2;
+		if (OF_getprop(child, "interrupt-parent", &iparent,
+		    sizeof(iparent)) <= 0)
+			iparent = -1;
+		nintr = OF_getprop_alloc(child, "interrupts", sizeof(*intr),
+		    (void **)&intr);
+		if (nintr > 0) {
+			for (i = 0; i < nintr; i += icells) {
+				u_int irq = intr[i];
+				if (iparent != -1)
+					irq = ofw_bus_map_intr(dev, iparent,
+					    icells, &intr[i]);
+
+				resource_list_add(&dinfo->mdi_resources,
+				    SYS_RES_IRQ, i, irq, irq, i);
+			}
+		}
 
                 cdev = device_add_child(dev, NULL, -1);
                 if (cdev == NULL) {



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