From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrxqY-0004u0-3w for qemu-devel@nongnu.org; Thu, 09 Apr 2009 13:15:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrxqW-0004tP-Cc for qemu-devel@nongnu.org; Thu, 09 Apr 2009 13:15:25 -0400 Received: from [199.232.76.173] (port=44665 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrxqW-0004tD-1m for qemu-devel@nongnu.org; Thu, 09 Apr 2009 13:15:24 -0400 Received: from savannah.gnu.org ([199.232.41.3]:59192 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 1LrxqV-0001rv-P6 for qemu-devel@nongnu.org; Thu, 09 Apr 2009 13:15:23 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LrxqU-0004GE-E1 for qemu-devel@nongnu.org; Thu, 09 Apr 2009 17:15:22 +0000 Received: from pbrook by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LrxqS-0004GA-ON for qemu-devel@nongnu.org; Thu, 09 Apr 2009 17:15:21 +0000 MIME-Version: 1.0 Errors-To: pbrook Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Paul Brook Message-Id: Date: Thu, 09 Apr 2009 17:15:20 +0000 Subject: [Qemu-devel] [7052] 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: 7052 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7052 Author: pbrook Date: 2009-04-09 17:15:18 +0000 (Thu, 09 Apr 2009) Log Message: ----------- Use qemu_ram_alloc. Signed-off-by: Paul Brook Modified Paths: -------------- trunk/hw/arm-misc.h trunk/hw/integratorcp.c trunk/hw/realview.c trunk/hw/versatilepb.c Modified: trunk/hw/arm-misc.h =================================================================== --- trunk/hw/arm-misc.h 2009-04-09 15:20:50 UTC (rev 7051) +++ trunk/hw/arm-misc.h 2009-04-09 17:15:18 UTC (rev 7052) @@ -27,6 +27,7 @@ const char *kernel_cmdline; const char *initrd_filename; target_phys_addr_t loader_start; + target_phys_addr_t smp_loader_start; int nb_cpus; int board_id; int (*atag_board)(struct arm_boot_info *info, void *p); Modified: trunk/hw/integratorcp.c =================================================================== --- trunk/hw/integratorcp.c 2009-04-09 15:20:50 UTC (rev 7051) +++ trunk/hw/integratorcp.c 2009-04-09 17:15:18 UTC (rev 7052) @@ -457,7 +457,7 @@ const char *initrd_filename, const char *cpu_model) { CPUState *env; - uint32_t ram_offset; + ram_addr_t ram_offset; qemu_irq *pic; qemu_irq *cpu_pic; int sd; Modified: trunk/hw/realview.c =================================================================== --- trunk/hw/realview.c 2009-04-09 15:20:50 UTC (rev 7051) +++ trunk/hw/realview.c 2009-04-09 17:15:18 UTC (rev 7052) @@ -29,6 +29,7 @@ const char *initrd_filename, const char *cpu_model) { CPUState *env; + ram_addr_t ram_offset; qemu_irq *pic; void *scsi_hba; PCIBus *pci_bus; @@ -64,9 +65,10 @@ } } + ram_offset = qemu_ram_alloc(ram_size); /* ??? RAM should repeat to fill physical memory space. */ /* SDRAM at address zero. */ - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); + cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM); arm_sysctl_init(0x10000000, 0xc1400400); @@ -182,18 +184,19 @@ /* 0x68000000 PCI mem 1. */ /* 0x6c000000 PCI mem 2. */ + /* ??? Hack to map an additional page of ram for the secondary CPU + startup code. I guess this works on real hardware because the + BootROM happens to be in ROM/flash or in memory that isn't clobbered + until after Linux boots the secondary CPUs. */ + ram_offset = qemu_ram_alloc(0x1000); + cpu_register_physical_memory(0x80000000, 0x1000, ram_offset | IO_MEM_RAM); + realview_binfo.ram_size = ram_size; realview_binfo.kernel_filename = kernel_filename; realview_binfo.kernel_cmdline = kernel_cmdline; realview_binfo.initrd_filename = initrd_filename; realview_binfo.nb_cpus = ncpu; arm_load_kernel(first_cpu, &realview_binfo); - - /* ??? Hack to map an additional page of ram for the secondary CPU - startup code. I guess this works on real hardware because the - BootROM happens to be in ROM/flash or in memory that isn't clobbered - until after Linux boots the secondary CPUs. */ - cpu_register_physical_memory(0x80000000, 0x1000, IO_MEM_RAM + ram_size); } QEMUMachine realview_machine = { Modified: trunk/hw/versatilepb.c =================================================================== --- trunk/hw/versatilepb.c 2009-04-09 15:20:50 UTC (rev 7051) +++ trunk/hw/versatilepb.c 2009-04-09 17:15:18 UTC (rev 7052) @@ -160,6 +160,7 @@ int board_id) { CPUState *env; + ram_addr_t ram_offset; qemu_irq *pic; qemu_irq *sic; void *scsi_hba; @@ -176,9 +177,10 @@ fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } + ram_offset = qemu_ram_alloc(ram_size); /* ??? RAM should repeat to fill physical memory space. */ /* SDRAM at address zero. */ - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); + cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM); arm_sysctl_init(0x10000000, 0x41007004); pic = arm_pic_init_cpu(env);