aboutsummaryrefslogtreecommitdiff
path: root/hw/grackle_pci.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-07-24 17:47:18 +0300
committerAvi Kivity <avi@redhat.com>2011-09-04 17:46:50 +0300
commitd0ed8076cbdc26138a7e33fed5e45a35d019a103 (patch)
tree5d63c2c4796d4ba51e7f4c2f8b44f22f9c19904f /hw/grackle_pci.c
parent2b985d9c29efdd0a8394ad6b2edd2ba1acdb3536 (diff)
pci_host: convert conf index and data ports to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/grackle_pci.c')
-rw-r--r--hw/grackle_pci.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/hw/grackle_pci.c b/hw/grackle_pci.c
index 9a823e1c06..9d3ff7d555 100644
--- a/hw/grackle_pci.c
+++ b/hw/grackle_pci.c
@@ -92,16 +92,15 @@ PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic,
static int pci_grackle_init_device(SysBusDevice *dev)
{
GrackleState *s;
- int pci_mem_config, pci_mem_data;
s = FROM_SYSBUS(GrackleState, dev);
- pci_mem_config = pci_host_conf_register_mmio(&s->host_state,
- DEVICE_LITTLE_ENDIAN);
- pci_mem_data = pci_host_data_register_mmio(&s->host_state,
- DEVICE_LITTLE_ENDIAN);
- sysbus_init_mmio(dev, 0x1000, pci_mem_config);
- sysbus_init_mmio(dev, 0x1000, pci_mem_data);
+ memory_region_init_io(&s->host_state.conf_mem, &pci_host_conf_le_ops,
+ &s->host_state, "pci-conf-idx", 0x1000);
+ memory_region_init_io(&s->host_state.data_mem, &pci_host_data_le_ops,
+ &s->host_state, "pci-data-idx", 0x1000);
+ sysbus_init_mmio_region(dev, &s->host_state.conf_mem);
+ sysbus_init_mmio_region(dev, &s->host_state.data_mem);
qemu_register_reset(pci_grackle_reset, &s->host_state);
return 0;