summaryrefslogtreecommitdiffstats
path: root/hw/prep_pci.c
diff options
context:
space:
mode:
authorAndreas Färber2012-08-20 19:08:09 +0200
committerAnthony Liguori2012-08-22 17:47:17 +0200
commit67c332fd12326a6ef572f07b9d71370ada6a287f (patch)
tree7080117aafe4c4728d86c251a602615f8bc17b43 /hw/prep_pci.c
parentpci: Derive PCI host bridges from TYPE_PCI_HOST_BRIDGE (diff)
downloadqemu-67c332fd12326a6ef572f07b9d71370ada6a287f.tar.gz
qemu-67c332fd12326a6ef572f07b9d71370ada6a287f.tar.xz
qemu-67c332fd12326a6ef572f07b9d71370ada6a287f.zip
pci: Tidy up PCI host bridges
Adopt the QOM parent field name and enforce QOM-style access via casts. Don't just typedef PCIHostState, either use it directly or embed it. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/prep_pci.c')
-rw-r--r--hw/prep_pci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/prep_pci.c b/hw/prep_pci.c
index 35cb9b297c..cc44e61987 100644
--- a/hw/prep_pci.c
+++ b/hw/prep_pci.c
@@ -34,7 +34,7 @@
OBJECT_CHECK(PREPPCIState, (obj), TYPE_RAVEN_PCI_HOST_BRIDGE)
typedef struct PRePPCIState {
- PCIHostState host_state;
+ PCIHostState parent_obj;
MemoryRegion intack;
qemu_irq irq[4];
@@ -60,14 +60,16 @@ static void ppc_pci_io_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned int size)
{
PREPPCIState *s = opaque;
- pci_data_write(s->host_state.bus, PPC_PCIIO_config(addr), val, size);
+ PCIHostState *phb = PCI_HOST_BRIDGE(s);
+ pci_data_write(phb->bus, PPC_PCIIO_config(addr), val, size);
}
static uint64_t ppc_pci_io_read(void *opaque, target_phys_addr_t addr,
unsigned int size)
{
PREPPCIState *s = opaque;
- return pci_data_read(s->host_state.bus, PPC_PCIIO_config(addr), size);
+ PCIHostState *phb = PCI_HOST_BRIDGE(s);
+ return pci_data_read(phb->bus, PPC_PCIIO_config(addr), size);
}
static const MemoryRegionOps PPC_PCIIO_ops = {