From 5c6602c5468a1408686abce6cdb2617ee462a333 Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Wed, 5 Nov 2008 19:25:39 +0000 Subject: Use qemu_ram_alloc git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5630 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/sun4u.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'hw/sun4u.c') diff --git a/hw/sun4u.c b/hw/sun4u.c index 057e78fc49..48c1f2cf0f 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -344,7 +344,8 @@ static void sun4uv_init(ram_addr_t RAM_size, int vga_ram_size, m48t59_t *nvram; int ret, linux_boot; unsigned int i; - long prom_offset, initrd_size, kernel_size; + ram_addr_t ram_offset, prom_offset, vga_ram_offset; + long initrd_size, kernel_size; PCIBus *pci_bus; QEMUBH *bh; qemu_irq *irq; @@ -387,9 +388,10 @@ static void sun4uv_init(ram_addr_t RAM_size, int vga_ram_size, env->npc = env->pc + 4; /* allocate RAM */ - cpu_register_physical_memory(0, RAM_size, 0); + ram_offset = qemu_ram_alloc(RAM_size); + cpu_register_physical_memory(0, RAM_size, ram_offset); - prom_offset = RAM_size + vga_ram_size; + prom_offset = qemu_ram_alloc(PROM_SIZE_MAX); cpu_register_physical_memory(hwdef->prom_addr, (PROM_SIZE_MAX + TARGET_PAGE_SIZE) & TARGET_PAGE_MASK, @@ -451,8 +453,9 @@ static void sun4uv_init(ram_addr_t RAM_size, int vga_ram_size, } pci_bus = pci_apb_init(APB_SPECIAL_BASE, APB_MEM_BASE, NULL); isa_mem_base = VGA_BASE; - pci_cirrus_vga_init(pci_bus, ds, phys_ram_base + RAM_size, RAM_size, - vga_ram_size); + vga_ram_offset = qemu_ram_alloc(vga_ram_size); + pci_cirrus_vga_init(pci_bus, ds, phys_ram_base + vga_ram_offset, + vga_ram_offset, vga_ram_size); i = 0; if (hwdef->console_serial_base) { -- cgit v1.2.3