From 5b15f27516ce3249c80bd2e0458d8d61f20da415 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 24 Aug 2011 21:37:05 +0300 Subject: ppc_oldworld, ppc_newworld: fix escc BAR related crash ppc maps the escc mmio region both at a fixed offset (as a sysbus area) and as part of a PCI BAR. This crashes, since a MemoryRegion may have only one parent. Use an alias so we have a separate MemoryRegion for the BAR. Signed-off-by: Avi Kivity --- hw/ppc_oldworld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hw/ppc_oldworld.c') diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c index 0071fc950e..235d2efc7b 100644 --- a/hw/ppc_oldworld.c +++ b/hw/ppc_oldworld.c @@ -83,7 +83,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, MacIONVRAMState *nvr; int bios_size; MemoryRegion *pic_mem, *dbdma_mem, *cuda_mem; - MemoryRegion *escc_mem, *ide_mem[2]; + MemoryRegion *escc_mem, *escc_bar = g_new(MemoryRegion, 1), *ide_mem[2]; uint16_t ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; @@ -241,6 +241,8 @@ static void ppc_heathrow_init (ram_addr_t ram_size, escc_mem = escc_init(0x80013000, pic[0x0f], pic[0x10], serial_hds[0], serial_hds[1], ESCC_CLOCK, 4); + memory_region_init_alias(escc_bar, "escc-bar", + escc_mem, 0, memory_region_size(escc_mem)); for(i = 0; i < nb_nics; i++) pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL); @@ -269,7 +271,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, pmac_format_nvram_partition(nvr, 0x2000); macio_init(pci_bus, PCI_DEVICE_ID_APPLE_343S1201, 1, pic_mem, - dbdma_mem, cuda_mem, nvr, 2, ide_mem, escc_mem); + dbdma_mem, cuda_mem, nvr, 2, ide_mem, escc_bar); if (usb_enabled) { usb_ohci_init_pci(pci_bus, -1); -- cgit v1.2.3