Commit cf9c147c6878e1eb54ac5b525194ae1e4c63214e

Authored by blueswir1
1 parent 6f338c34

Use qemu_ram_alloc

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6611 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 9 additions and 5 deletions
hw/ppc_prep.c
... ... @@ -543,7 +543,7 @@ static void ppc_prep_init (ram_addr_t ram_size, int vga_ram_size,
543 543 m48t59_t *m48t59;
544 544 int PPC_io_memory;
545 545 int linux_boot, i, nb_nics1, bios_size;
546   - unsigned long bios_offset;
  546 + ram_addr_t ram_offset, vga_ram_offset, bios_offset;
547 547 uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
548 548 PCIBus *pci_bus;
549 549 qemu_irq *i8259;
... ... @@ -577,10 +577,14 @@ static void ppc_prep_init (ram_addr_t ram_size, int vga_ram_size,
577 577 }
578 578  
579 579 /* allocate RAM */
580   - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
  580 + ram_offset = qemu_ram_alloc(ram_size);
  581 + cpu_register_physical_memory(0, ram_size, ram_offset);
  582 +
  583 + /* allocate VGA RAM */
  584 + vga_ram_offset = qemu_ram_alloc(vga_ram_size);
581 585  
582 586 /* allocate and load BIOS */
583   - bios_offset = ram_size + vga_ram_size;
  587 + bios_offset = qemu_ram_alloc(BIOS_SIZE);
584 588 if (bios_name == NULL)
585 589 bios_name = BIOS_FILENAME;
586 590 snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
... ... @@ -653,8 +657,8 @@ static void ppc_prep_init (ram_addr_t ram_size, int vga_ram_size,
653 657 cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
654 658  
655 659 /* init basic PC hardware */
656   - pci_vga_init(pci_bus, phys_ram_base + ram_size, ram_size,
657   - vga_ram_size, 0, 0);
  660 + pci_vga_init(pci_bus, phys_ram_base + vga_ram_offset,
  661 + vga_ram_offset, vga_ram_size, 0, 0);
658 662 // openpic = openpic_init(0x00000000, 0xF0000000, 1);
659 663 // pit = pit_init(0x40, i8259[0]);
660 664 rtc_init(0x70, i8259[8], 2000);
... ...