diff options
author | Cédric Le Goater | 2018-09-13 07:16:05 +0200 |
---|---|---|
committer | David Gibson | 2018-09-25 03:12:25 +0200 |
commit | 0976efd51bbfb28292704a248cb9454fc12f911d (patch) | |
tree | 79d8e5ca2612c43d863071fdfb0898ab5ec377a4 /hw/ppc/spapr_pci.c | |
parent | spapr: increase the size of the IRQ number space (diff) | |
download | qemu-0976efd51bbfb28292704a248cb9454fc12f911d.tar.gz qemu-0976efd51bbfb28292704a248cb9454fc12f911d.tar.xz qemu-0976efd51bbfb28292704a248cb9454fc12f911d.zip |
spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt
So that we don't have to call qdev_get_machine() to get the machine
class and the sPAPRIrq backend holding the number of MSIs.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r-- | hw/ppc/spapr_pci.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index bb736177e7..c2271e6ed4 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -2069,9 +2069,8 @@ static void spapr_phb_pci_enumerate(sPAPRPHBState *phb) } -int spapr_populate_pci_dt(sPAPRPHBState *phb, - uint32_t xics_phandle, - void *fdt) +int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt, + uint32_t nr_msis) { int bus_off, i, j, ret; gchar *nodename; @@ -2121,7 +2120,6 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, sPAPRTCETable *tcet; PCIBus *bus = PCI_HOST_BRIDGE(phb)->bus; sPAPRFDT s_fdt; - sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(qdev_get_machine()); /* Start populating the FDT */ nodename = g_strdup_printf("pci@%" PRIx64, phb->buid); @@ -2139,8 +2137,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, _FDT(fdt_setprop(fdt, bus_off, "ranges", &ranges, sizeof_ranges)); _FDT(fdt_setprop(fdt, bus_off, "reg", &bus_reg, sizeof(bus_reg))); _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pci-config-space-type", 0x1)); - _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", - smc->irq->nr_msis)); + _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", nr_msis)); /* Dynamic DMA window */ if (phb->ddw_enabled) { |