diff options
author | Andreas Färber <afaerber@suse.de> | 2012-08-20 19:08:09 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-08-22 10:47:17 -0500 |
commit | 67c332fd12326a6ef572f07b9d71370ada6a287f (patch) | |
tree | 7080117aafe4c4728d86c251a602615f8bc17b43 /hw/unin_pci.c | |
parent | 8558d942b665a9ff0847851615e107308f6386a5 (diff) |
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/unin_pci.c')
-rw-r--r-- | hw/unin_pci.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/unin_pci.c b/hw/unin_pci.c index 0db7c1f52b..d1cc68062b 100644 --- a/hw/unin_pci.c +++ b/hw/unin_pci.c @@ -53,7 +53,7 @@ static const int unin_irq_line[] = { 0x1b, 0x1c, 0x1d, 0x1e }; OBJECT_CHECK(UNINState, (obj), TYPE_U3_AGP_HOST_BRIDGE) typedef struct UNINState { - PCIHostState host_state; + PCIHostState parent_obj; MemoryRegion pci_mmio; MemoryRegion pci_hole; @@ -115,10 +115,11 @@ static void unin_data_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned len) { UNINState *s = opaque; + PCIHostState *phb = PCI_HOST_BRIDGE(s); UNIN_DPRINTF("write addr %" TARGET_FMT_plx " len %d val %"PRIx64"\n", addr, len, val); - pci_data_write(s->host_state.bus, - unin_get_config_reg(s->host_state.config_reg, addr), + pci_data_write(phb->bus, + unin_get_config_reg(phb->config_reg, addr), val, len); } @@ -126,10 +127,11 @@ static uint64_t unin_data_read(void *opaque, target_phys_addr_t addr, unsigned len) { UNINState *s = opaque; + PCIHostState *phb = PCI_HOST_BRIDGE(s); uint32_t val; - val = pci_data_read(s->host_state.bus, - unin_get_config_reg(s->host_state.config_reg, addr), + val = pci_data_read(phb->bus, + unin_get_config_reg(phb->config_reg, addr), len); UNIN_DPRINTF("read addr %" TARGET_FMT_plx " len %d val %x\n", addr, len, val); |