]> Git Repo - qemu.git/commitdiff
Use qemu_ram_alloc.
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 9 Apr 2009 17:15:18 +0000 (17:15 +0000)
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 9 Apr 2009 17:15:18 +0000 (17:15 +0000)
Signed-off-by: Paul Brook <[email protected]>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7052 c046a42c-6fe2-441c-8c8c-71466251a162

hw/arm-misc.h
hw/integratorcp.c
hw/realview.c
hw/versatilepb.c

index a6991975fcda3165fcd92244d79d5072ba6a92c6..5daac4fabf8a20e72e2de2c9fbde70893c97ac9b 100644 (file)
@@ -27,6 +27,7 @@ struct arm_boot_info {
     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);
index f990afed7a25c78190f4392110d2f8d8b992ea64..8f2ff2da60a32b3985e75c8a72f2efde41f91556 100644 (file)
@@ -457,7 +457,7 @@ static void integratorcp_init(ram_addr_t ram_size, int vga_ram_size,
                      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;
index aae4b86c25df8d59e5c1bb35c4b2fcfc7689d7ab..a930a46b10607aa2cf792e4ba65493db0976ca10 100644 (file)
@@ -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 = {
index d80e2f2741986bd392962ba1e121fc44244982c6..c018a06f8a406e20d95aa0e499577c4a147607b9 100644 (file)
@@ -160,6 +160,7 @@ static void versatile_init(ram_addr_t ram_size, int vga_ram_size,
                      int board_id)
 {
     CPUState *env;
+    ram_addr_t ram_offset;
     qemu_irq *pic;
     qemu_irq *sic;
     void *scsi_hba;
@@ -176,9 +177,10 @@ static void versatile_init(ram_addr_t ram_size, int vga_ram_size,
         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);
This page took 0.032083 seconds and 4 git commands to generate.