diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-09-21 20:49:29 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-09-23 10:55:33 -0500 |
commit | 4463aee630685a6ac595b1acc777536f0a41d02d (patch) | |
tree | c9b04bde9b8424b92eeb56abf555d862e806b0ef /hw/pc_piix.c | |
parent | dd8e93799f13ef82d83c185b8e71e049452f7d40 (diff) |
pc: Unbreak ROM mapping for ISA machine
This is based on the original fix by Hervé Poussineau: pc_memory_init
actually takes a memory region for mapping BIOS and extension ROMs. That
equals the PCI memory region if PCI is available, but must be system
memory in the ISA case.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pc_piix.c')
-rw-r--r-- | hw/pc_piix.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 75d96d97c6..52939f535d 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -97,6 +97,7 @@ static void pc_init1(MemoryRegion *system_memory, ISADevice *rtc_state; MemoryRegion *ram_memory; MemoryRegion *pci_memory; + MemoryRegion *rom_memory; pc_cpus_init(cpu_model); @@ -112,15 +113,21 @@ static void pc_init1(MemoryRegion *system_memory, below_4g_mem_size = ram_size; } - pci_memory = g_new(MemoryRegion, 1); - memory_region_init(pci_memory, "pci", INT64_MAX); + if (pci_enabled) { + pci_memory = g_new(MemoryRegion, 1); + memory_region_init(pci_memory, "pci", INT64_MAX); + rom_memory = pci_memory; + } else { + pci_memory = NULL; + rom_memory = system_memory; + } /* allocate ram and load rom/bios */ if (!xen_enabled()) { pc_memory_init(system_memory, kernel_filename, kernel_cmdline, initrd_filename, below_4g_mem_size, above_4g_mem_size, - pci_memory, &ram_memory); + rom_memory, &ram_memory); } if (!xen_enabled()) { |