Commit 7ffab4d78cdc202fc4ef7f9cb6677756b5c8b3a1

Authored by pbrook
1 parent 088ab16c

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
hw/arm-misc.h
... ... @@ -27,6 +27,7 @@ struct arm_boot_info {
27 27 const char *kernel_cmdline;
28 28 const char *initrd_filename;
29 29 target_phys_addr_t loader_start;
  30 + target_phys_addr_t smp_loader_start;
30 31 int nb_cpus;
31 32 int board_id;
32 33 int (*atag_board)(struct arm_boot_info *info, void *p);
... ...
hw/integratorcp.c
... ... @@ -457,7 +457,7 @@ static void integratorcp_init(ram_addr_t ram_size, int vga_ram_size,
457 457 const char *initrd_filename, const char *cpu_model)
458 458 {
459 459 CPUState *env;
460   - uint32_t ram_offset;
  460 + ram_addr_t ram_offset;
461 461 qemu_irq *pic;
462 462 qemu_irq *cpu_pic;
463 463 int sd;
... ...
hw/realview.c
... ... @@ -29,6 +29,7 @@ static void realview_init(ram_addr_t ram_size, int vga_ram_size,
29 29 const char *initrd_filename, const char *cpu_model)
30 30 {
31 31 CPUState *env;
  32 + ram_addr_t ram_offset;
32 33 qemu_irq *pic;
33 34 void *scsi_hba;
34 35 PCIBus *pci_bus;
... ... @@ -64,9 +65,10 @@ static void realview_init(ram_addr_t ram_size, int vga_ram_size,
64 65 }
65 66 }
66 67  
  68 + ram_offset = qemu_ram_alloc(ram_size);
67 69 /* ??? RAM should repeat to fill physical memory space. */
68 70 /* SDRAM at address zero. */
69   - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
  71 + cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM);
70 72  
71 73 arm_sysctl_init(0x10000000, 0xc1400400);
72 74  
... ... @@ -182,18 +184,19 @@ static void realview_init(ram_addr_t ram_size, int vga_ram_size,
182 184 /* 0x68000000 PCI mem 1. */
183 185 /* 0x6c000000 PCI mem 2. */
184 186  
  187 + /* ??? Hack to map an additional page of ram for the secondary CPU
  188 + startup code. I guess this works on real hardware because the
  189 + BootROM happens to be in ROM/flash or in memory that isn't clobbered
  190 + until after Linux boots the secondary CPUs. */
  191 + ram_offset = qemu_ram_alloc(0x1000);
  192 + cpu_register_physical_memory(0x80000000, 0x1000, ram_offset | IO_MEM_RAM);
  193 +
185 194 realview_binfo.ram_size = ram_size;
186 195 realview_binfo.kernel_filename = kernel_filename;
187 196 realview_binfo.kernel_cmdline = kernel_cmdline;
188 197 realview_binfo.initrd_filename = initrd_filename;
189 198 realview_binfo.nb_cpus = ncpu;
190 199 arm_load_kernel(first_cpu, &realview_binfo);
191   -
192   - /* ??? Hack to map an additional page of ram for the secondary CPU
193   - startup code. I guess this works on real hardware because the
194   - BootROM happens to be in ROM/flash or in memory that isn't clobbered
195   - until after Linux boots the secondary CPUs. */
196   - cpu_register_physical_memory(0x80000000, 0x1000, IO_MEM_RAM + ram_size);
197 200 }
198 201  
199 202 QEMUMachine realview_machine = {
... ...
hw/versatilepb.c
... ... @@ -160,6 +160,7 @@ static void versatile_init(ram_addr_t ram_size, int vga_ram_size,
160 160 int board_id)
161 161 {
162 162 CPUState *env;
  163 + ram_addr_t ram_offset;
163 164 qemu_irq *pic;
164 165 qemu_irq *sic;
165 166 void *scsi_hba;
... ... @@ -176,9 +177,10 @@ static void versatile_init(ram_addr_t ram_size, int vga_ram_size,
176 177 fprintf(stderr, "Unable to find CPU definition\n");
177 178 exit(1);
178 179 }
  180 + ram_offset = qemu_ram_alloc(ram_size);
179 181 /* ??? RAM should repeat to fill physical memory space. */
180 182 /* SDRAM at address zero. */
181   - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
  183 + cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM);
182 184  
183 185 arm_sysctl_init(0x10000000, 0x41007004);
184 186 pic = arm_pic_init_cpu(env);
... ...