mirror of https://github.com/xqemu/xqemu.git
ppc_oldworld: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
cfce6d8934
commit
c92bb2c725
|
@ -73,11 +73,13 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
|
||||||
const char *initrd_filename,
|
const char *initrd_filename,
|
||||||
const char *cpu_model)
|
const char *cpu_model)
|
||||||
{
|
{
|
||||||
|
MemoryRegion *sysmem = get_system_memory();
|
||||||
CPUState *env = NULL;
|
CPUState *env = NULL;
|
||||||
char *filename;
|
char *filename;
|
||||||
qemu_irq *pic, **heathrow_irqs;
|
qemu_irq *pic, **heathrow_irqs;
|
||||||
int linux_boot, i;
|
int linux_boot, i;
|
||||||
ram_addr_t ram_offset, bios_offset;
|
MemoryRegion *ram = g_new(MemoryRegion, 1);
|
||||||
|
MemoryRegion *bios = g_new(MemoryRegion, 1);
|
||||||
uint32_t kernel_base, initrd_base, cmdline_base = 0;
|
uint32_t kernel_base, initrd_base, cmdline_base = 0;
|
||||||
int32_t kernel_size, initrd_size;
|
int32_t kernel_size, initrd_size;
|
||||||
PCIBus *pci_bus;
|
PCIBus *pci_bus;
|
||||||
|
@ -114,15 +116,16 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ram_offset = qemu_ram_alloc(NULL, "ppc_heathrow.ram", ram_size);
|
memory_region_init_ram(ram, NULL, "ppc_heathrow.ram", ram_size);
|
||||||
cpu_register_physical_memory(0, ram_size, ram_offset);
|
memory_region_add_subregion(sysmem, 0, ram);
|
||||||
|
|
||||||
/* allocate and load BIOS */
|
/* allocate and load BIOS */
|
||||||
bios_offset = qemu_ram_alloc(NULL, "ppc_heathrow.bios", BIOS_SIZE);
|
memory_region_init_ram(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE);
|
||||||
if (bios_name == NULL)
|
if (bios_name == NULL)
|
||||||
bios_name = PROM_FILENAME;
|
bios_name = PROM_FILENAME;
|
||||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
|
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
|
||||||
cpu_register_physical_memory(PROM_ADDR, BIOS_SIZE, bios_offset | IO_MEM_ROM);
|
memory_region_set_readonly(bios, true);
|
||||||
|
memory_region_add_subregion(sysmem, PROM_ADDR, bios);
|
||||||
|
|
||||||
/* Load OpenBIOS (ELF) */
|
/* Load OpenBIOS (ELF) */
|
||||||
if (filename) {
|
if (filename) {
|
||||||
|
|
Loading…
Reference in New Issue