From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVAiO-0001jC-If for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:20:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVAiN-0001iW-Ds for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:20:47 -0500 Received: from [199.232.76.173] (port=41807 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVAiN-0001iE-4x for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:20:47 -0500 Received: from savannah.gnu.org ([199.232.41.3]:54032 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVAiM-0005Gr-FV for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:20:46 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LVAiF-0002XH-Nk for qemu-devel@nongnu.org; Thu, 05 Feb 2009 20:20:40 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LVAiB-0002XA-5p for qemu-devel@nongnu.org; Thu, 05 Feb 2009 20:20:36 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Thu, 05 Feb 2009 20:20:35 +0000 Subject: [Qemu-devel] [6520] Use qemu_ram_alloc Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6520 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6520 Author: blueswir1 Date: 2009-02-05 20:20:29 +0000 (Thu, 05 Feb 2009) Log Message: ----------- Use qemu_ram_alloc Modified Paths: -------------- trunk/hw/ppc_chrp.c Modified: trunk/hw/ppc_chrp.c =================================================================== --- trunk/hw/ppc_chrp.c 2009-02-05 13:42:57 UTC (rev 6519) +++ trunk/hw/ppc_chrp.c 2009-02-05 20:20:29 UTC (rev 6520) @@ -35,6 +35,7 @@ #include "escc.h" #define MAX_IDE_BUS 2 +#define VGA_BIOS_SIZE 65536 /* UniN device */ static void unin_writel (void *opaque, target_phys_addr_t addr, uint32_t value) @@ -71,7 +72,7 @@ qemu_irq *pic, **openpic_irqs; int unin_memory; int linux_boot, i; - unsigned long bios_offset, vga_bios_offset; + ram_addr_t ram_offset, vga_ram_offset, bios_offset, vga_bios_offset; uint32_t kernel_base, kernel_size, initrd_base, initrd_size; PCIBus *pci_bus; nvram_t nvram; @@ -117,10 +118,14 @@ } /* allocate RAM */ - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); + ram_offset = qemu_ram_alloc(ram_size); + cpu_register_physical_memory(0, ram_size, ram_offset); + /* allocate VGA RAM */ + vga_ram_offset = qemu_ram_alloc(vga_ram_size); + /* allocate and load BIOS */ - bios_offset = ram_size + vga_ram_size; + bios_offset = qemu_ram_alloc(BIOS_SIZE); if (bios_name == NULL) bios_name = BIOS_FILENAME; snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); @@ -138,7 +143,7 @@ bios_size, bios_offset | IO_MEM_ROM); /* allocate and load VGA BIOS */ - vga_bios_offset = bios_offset + bios_size; + vga_bios_offset = qemu_ram_alloc(VGA_BIOS_SIZE); snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME); vga_bios_size = load_image(buf, phys_ram_base + vga_bios_offset + 8); if (vga_bios_size < 0) { @@ -156,7 +161,6 @@ vga_bios_size); vga_bios_size += 8; } - vga_bios_size = (vga_bios_size + 0xfff) & ~0xfff; if (linux_boot) { kernel_base = KERNEL_LOAD_ADDR; @@ -337,6 +341,6 @@ .name = "mac99", .desc = "Mac99 based PowerMAC", .init = ppc_core99_init, - .ram_require = BIOS_SIZE + VGA_RAM_SIZE, + .ram_require = BIOS_SIZE + VGA_BIOS_SIZE + VGA_RAM_SIZE, .max_cpus = MAX_CPUS, };