summary refs log tree commit diff stats
path: root/hw/realview.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-09 17:15:18 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-09 17:15:18 +0000
commit7ffab4d78cdc202fc4ef7f9cb6677756b5c8b3a1 (patch)
tree8cf9d674f6b40739ac7546db4867fa02694cac6a /hw/realview.c
parent088ab16c6b04007e5ae34d57256286b0c6607685 (diff)
downloadfocaccia-qemu-7ffab4d78cdc202fc4ef7f9cb6677756b5c8b3a1.tar.gz
focaccia-qemu-7ffab4d78cdc202fc4ef7f9cb6677756b5c8b3a1.zip
Use qemu_ram_alloc.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7052 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/realview.c')
-rw-r--r--hw/realview.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/hw/realview.c b/hw/realview.c
index aae4b86c25..a930a46b10 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -29,6 +29,7 @@ static void realview_init(ram_addr_t ram_size, int vga_ram_size,
                      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 @@ static void realview_init(ram_addr_t ram_size, int vga_ram_size,
         }
     }
 
+    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 @@ static void realview_init(ram_addr_t ram_size, int vga_ram_size,
     /* 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 = {