1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

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.
This commit is contained in:
Nathan Whitehorn 2015-01-05 18:15:16 +00:00
parent 1d67d16647
commit efabbd4c02
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276713

View File

@ -128,6 +128,8 @@ vdevice_attach(device_t dev)
{ {
phandle_t root, child; phandle_t root, child;
device_t cdev; device_t cdev;
int icells, i, nintr, *intr;
phandle_t iparent;
struct vdevice_devinfo *dinfo; struct vdevice_devinfo *dinfo;
root = ofw_bus_get_node(dev); root = ofw_bus_get_node(dev);
@ -142,7 +144,25 @@ vdevice_attach(device_t dev)
} }
resource_list_init(&dinfo->mdi_resources); 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); cdev = device_add_child(dev, NULL, -1);
if (cdev == NULL) { if (cdev == NULL) {