[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 16/29] spapr: move spapr_create_phb() to core machine c
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 16/29] spapr: move spapr_create_phb() to core machine code |
Date: |
Wed, 9 Jan 2019 09:45:47 +1100 |
From: Greg Kurz <address@hidden>
This function is only used when creating the default PHB. Let's rename
it and move it to the core machine code for clarity.
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 13 ++++++++++++-
hw/ppc/spapr_pci.c | 11 -----------
include/hw/pci-host/spapr.h | 2 --
3 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7e61f1e5ff..f621032d40 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2552,6 +2552,17 @@ static void spapr_init_cpus(sPAPRMachineState *spapr)
}
}
+static PCIHostState *spapr_create_default_phb(void)
+{
+ DeviceState *dev;
+
+ dev = qdev_create(NULL, TYPE_SPAPR_PCI_HOST_BRIDGE);
+ qdev_prop_set_uint32(dev, "index", 0);
+ qdev_init_nofail(dev);
+
+ return PCI_HOST_BRIDGE(dev);
+}
+
/* pSeries LPAR / sPAPR hardware init */
static void spapr_machine_init(MachineState *machine)
{
@@ -2784,7 +2795,7 @@ static void spapr_machine_init(MachineState *machine)
/* Set up PCI */
spapr_pci_rtas_init();
- phb = spapr_create_phb(spapr, 0);
+ phb = spapr_create_default_phb();
for (i = 0; i < nb_nics; i++) {
NICInfo *nd = &nd_table[i];
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index bfb02ee96b..b74f2632ec 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1988,17 +1988,6 @@ static const TypeInfo spapr_phb_info = {
}
};
-PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index)
-{
- DeviceState *dev;
-
- dev = qdev_create(NULL, TYPE_SPAPR_PCI_HOST_BRIDGE);
- qdev_prop_set_uint32(dev, "index", index);
- qdev_init_nofail(dev);
-
- return PCI_HOST_BRIDGE(dev);
-}
-
typedef struct sPAPRFDT {
void *fdt;
int node_off;
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 7c66c3872f..a65cfef169 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -111,8 +111,6 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct
sPAPRPHBState *phb, int pin)
return spapr_qirq(spapr, phb->lsi_table[pin].irq);
}
-PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index);
-
int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt,
uint32_t nr_msis);
--
2.20.1
- [Qemu-ppc] [PULL 00/29] ppc-for-4.0 queue 20190109, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 01/29] spapr: Add H-Call H_HOME_NODE_ASSOCIATIVITY, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 04/29] MAINTAINERS: Add more files to sam460ex, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 05/29] target/ppc: fix typo in SIMM5 extraction helper, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 02/29] ppc/spapr: Receive and store device tree blob from SLOF, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 06/29] target/ppc: switch EXTRACT_HELPER macros over to use sextract32/extract32, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 08/29] target/ppc: introduce get_avr64() and set_avr64() helpers for VMX register access, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 03/29] ppc4xx: Disable debug logging by default, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 10/29] target/ppc: switch FPR, VMX and VSX helpers to access data directly from cpu_env, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 14/29] MAINTAINERS: Add some missing ppc-related files, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 16/29] spapr: move spapr_create_phb() to core machine code,
David Gibson <=
- [Qemu-ppc] [PULL 11/29] target/ppc: merge ppc_vsr_t and ppc_avr_t union types, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 18/29] spapr_pci: Define SPAPR_MAX_PHBS in hw/pci-host/spapr.h, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 13/29] target/ppc: replace AVR* macros with Vsr* macros, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 15/29] MAINTAINERS: add qemu_vga.ndrv file entry for Mac machines, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 09/29] target/ppc: introduce get_cpu_vsr{l, h}() and set_cpu_vsr{l, h}() helpers for VSR register access, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 17/29] pci: allow cleanup/unregistration of PCI root buses, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 07/29] target/ppc: introduce get_fpr() and set_fpr() helpers for FP register access, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 12/29] target/ppc: move FP and VMX registers into aligned vsr register array, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 27/29] ppc/xics: allow ICSState to have an offset 0, David Gibson, 2019/01/08
- [Qemu-ppc] [PULL 21/29] ppc/xive: introduce a XiveTCTX pointer under PowerPCCPU, David Gibson, 2019/01/08