diff options
author | Avi Kivity <avi@redhat.com> | 2011-08-24 21:37:05 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-08-25 10:49:46 +0300 |
commit | 5b15f27516ce3249c80bd2e0458d8d61f20da415 (patch) | |
tree | b15ba9991c16043a62d649a3a161690416ee3460 /hw/ppc_newworld.c | |
parent | 89da90b1b4acf24a9a3f2fd197b1bdf69ab24e72 (diff) |
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 <avi@redhat.com>
Diffstat (limited to 'hw/ppc_newworld.c')
-rw-r--r-- | hw/ppc_newworld.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c index 4727e0790c..fbd443d90f 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -146,6 +146,7 @@ static void ppc_core99_init (ram_addr_t ram_size, MacIONVRAMState *nvr; int bios_size; MemoryRegion *pic_mem, *dbdma_mem, *cuda_mem, *escc_mem; + MemoryRegion *escc_bar = g_new(MemoryRegion, 1); MemoryRegion *ide_mem[3]; int ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; @@ -328,6 +329,8 @@ static void ppc_core99_init (ram_addr_t ram_size, escc_mem = escc_init(0x80013000, pic[0x25], pic[0x24], 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); @@ -350,7 +353,7 @@ static void ppc_core99_init (ram_addr_t ram_size, adb_mouse_init(&adb_bus); macio_init(pci_bus, PCI_DEVICE_ID_APPLE_UNI_N_KEYL, 0, pic_mem, - dbdma_mem, cuda_mem, NULL, 3, ide_mem, escc_mem); + dbdma_mem, cuda_mem, NULL, 3, ide_mem, escc_bar); if (usb_enabled) { usb_ohci_init_pci(pci_bus, -1); |