Commit 6ef05b95462b46a1a885f390b55eaf632f52ec70

Authored by blueswir1
1 parent 460a09c1

Improved large memory support

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4292 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 19 additions and 19 deletions
hw/sun4m.c
... ... @@ -156,7 +156,7 @@ void DMA_register_channel (int nchan,
156 156 extern int nographic;
157 157  
158 158 static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
159   - const char *boot_devices, uint32_t RAM_size,
  159 + const char *boot_devices, ram_addr_t RAM_size,
160 160 uint32_t kernel_size,
161 161 int width, int height, int depth,
162 162 int machine_id, const char *arch)
... ... @@ -366,7 +366,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename,
366 366 return kernel_size;
367 367 }
368 368  
369   -static void sun4m_hw_init(const struct hwdef *hwdef, int RAM_size,
  369 +static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
370 370 const char *boot_device,
371 371 DisplayState *ds, const char *kernel_filename,
372 372 const char *kernel_cmdline,
... ... @@ -416,7 +416,7 @@ static void sun4m_hw_init(const struct hwdef *hwdef, int RAM_size,
416 416 /* allocate RAM */
417 417 if ((uint64_t)RAM_size > hwdef->max_mem) {
418 418 fprintf(stderr, "qemu: Too much memory for this machine: %d, maximum %d\n",
419   - (unsigned int)RAM_size / (1024 * 1024),
  419 + (unsigned int)(RAM_size / (1024 * 1024)),
420 420 (unsigned int)(hwdef->max_mem / (1024 * 1024)));
421 421 exit(1);
422 422 }
... ... @@ -545,7 +545,7 @@ static void sun4m_hw_init(const struct hwdef *hwdef, int RAM_size,
545 545 hwdef->ecc_version);
546 546 }
547 547  
548   -static void sun4c_hw_init(const struct hwdef *hwdef, int RAM_size,
  548 +static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
549 549 const char *boot_device,
550 550 DisplayState *ds, const char *kernel_filename,
551 551 const char *kernel_cmdline,
... ... @@ -583,8 +583,8 @@ static void sun4c_hw_init(const struct hwdef *hwdef, int RAM_size,
583 583 /* allocate RAM */
584 584 if ((uint64_t)RAM_size > hwdef->max_mem) {
585 585 fprintf(stderr, "qemu: Too much memory for this machine: %d, maximum %d\n",
586   - (unsigned int)RAM_size / (1024 * 1024),
587   - (unsigned int)hwdef->max_mem / (1024 * 1024));
  586 + (unsigned int)(RAM_size / (1024 * 1024)),
  587 + (unsigned int)(hwdef->max_mem / (1024 * 1024)));
588 588 exit(1);
589 589 }
590 590 cpu_register_physical_memory(0, RAM_size, 0);
... ... @@ -774,7 +774,7 @@ static const struct hwdef hwdefs[] = {
774 774 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
775 775 6, 0, 4, 10, 8, 0, 11, 0, 0, 0, 0, 0, 15, 0, 15, 0,
776 776 },
777   - .max_mem = 0xffffffff, // XXX actually first 62GB ok
  777 + .max_mem = 0xf00000000ULL,
778 778 .default_cpu_model = "TI SuperSparc II",
779 779 },
780 780 /* SS-600MP */
... ... @@ -818,7 +818,7 @@ static const struct hwdef hwdefs[] = {
818 818 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
819 819 6, 0, 4, 10, 8, 0, 11, 0, 0, 0, 0, 0, 15, 0, 15, 0,
820 820 },
821   - .max_mem = 0xffffffff, // XXX actually first 62GB ok
  821 + .max_mem = 0xf00000000ULL,
822 822 .default_cpu_model = "TI SuperSparc II",
823 823 },
824 824 /* SS-20 */
... ... @@ -862,7 +862,7 @@ static const struct hwdef hwdefs[] = {
862 862 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
863 863 6, 0, 4, 10, 8, 0, 11, 0, 0, 0, 0, 0, 15, 0, 15, 0,
864 864 },
865   - .max_mem = 0xffffffff, // XXX actually first 62GB ok
  865 + .max_mem = 0xf00000000ULL,
866 866 .default_cpu_model = "TI SuperSparc II",
867 867 },
868 868 /* SS-2 */
... ... @@ -1163,7 +1163,7 @@ static void ss2_init(ram_addr_t RAM_size, int vga_ram_size,
1163 1163 }
1164 1164  
1165 1165 /* SPARCstation Voyager hardware initialisation */
1166   -static void vger_init(int RAM_size, int vga_ram_size,
  1166 +static void vger_init(ram_addr_t RAM_size, int vga_ram_size,
1167 1167 const char *boot_device, DisplayState *ds,
1168 1168 const char *kernel_filename, const char *kernel_cmdline,
1169 1169 const char *initrd_filename, const char *cpu_model)
... ... @@ -1173,7 +1173,7 @@ static void vger_init(int RAM_size, int vga_ram_size,
1173 1173 }
1174 1174  
1175 1175 /* SPARCstation LX hardware initialisation */
1176   -static void ss_lx_init(int RAM_size, int vga_ram_size,
  1176 +static void ss_lx_init(ram_addr_t RAM_size, int vga_ram_size,
1177 1177 const char *boot_device, DisplayState *ds,
1178 1178 const char *kernel_filename, const char *kernel_cmdline,
1179 1179 const char *initrd_filename, const char *cpu_model)
... ... @@ -1183,7 +1183,7 @@ static void ss_lx_init(int RAM_size, int vga_ram_size,
1183 1183 }
1184 1184  
1185 1185 /* SPARCstation 4 hardware initialisation */
1186   -static void ss4_init(int RAM_size, int vga_ram_size,
  1186 +static void ss4_init(ram_addr_t RAM_size, int vga_ram_size,
1187 1187 const char *boot_device, DisplayState *ds,
1188 1188 const char *kernel_filename, const char *kernel_cmdline,
1189 1189 const char *initrd_filename, const char *cpu_model)
... ... @@ -1193,7 +1193,7 @@ static void ss4_init(int RAM_size, int vga_ram_size,
1193 1193 }
1194 1194  
1195 1195 /* SPARCClassic hardware initialisation */
1196   -static void scls_init(int RAM_size, int vga_ram_size,
  1196 +static void scls_init(ram_addr_t RAM_size, int vga_ram_size,
1197 1197 const char *boot_device, DisplayState *ds,
1198 1198 const char *kernel_filename, const char *kernel_cmdline,
1199 1199 const char *initrd_filename, const char *cpu_model)
... ... @@ -1203,7 +1203,7 @@ static void scls_init(int RAM_size, int vga_ram_size,
1203 1203 }
1204 1204  
1205 1205 /* SPARCbook hardware initialisation */
1206   -static void sbook_init(int RAM_size, int vga_ram_size,
  1206 +static void sbook_init(ram_addr_t RAM_size, int vga_ram_size,
1207 1207 const char *boot_device, DisplayState *ds,
1208 1208 const char *kernel_filename, const char *kernel_cmdline,
1209 1209 const char *initrd_filename, const char *cpu_model)
... ... @@ -1313,7 +1313,7 @@ static const struct sun4d_hwdef sun4d_hwdefs[] = {
1313 1313 .ser_irq = 12,
1314 1314 .machine_id = 0x80,
1315 1315 .iounit_version = 0x03000000,
1316   - .max_mem = 0xffffffff, // XXX actually first 62GB ok
  1316 + .max_mem = 0xf00000000ULL,
1317 1317 .default_cpu_model = "TI SuperSparc II",
1318 1318 },
1319 1319 /* SS-2000 */
... ... @@ -1346,12 +1346,12 @@ static const struct sun4d_hwdef sun4d_hwdefs[] = {
1346 1346 .ser_irq = 12,
1347 1347 .machine_id = 0x80,
1348 1348 .iounit_version = 0x03000000,
1349   - .max_mem = 0xffffffff, // XXX actually first 62GB ok
  1349 + .max_mem = 0xf00000000ULL,
1350 1350 .default_cpu_model = "TI SuperSparc II",
1351 1351 },
1352 1352 };
1353 1353  
1354   -static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, int RAM_size,
  1354 +static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
1355 1355 const char *boot_device,
1356 1356 DisplayState *ds, const char *kernel_filename,
1357 1357 const char *kernel_cmdline,
... ... @@ -1397,7 +1397,7 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, int RAM_size,
1397 1397 /* allocate RAM */
1398 1398 if ((uint64_t)RAM_size > hwdef->max_mem) {
1399 1399 fprintf(stderr, "qemu: Too much memory for this machine: %d, maximum %d\n",
1400   - (unsigned int)RAM_size / (1024 * 1024),
  1400 + (unsigned int)(RAM_size / (1024 * 1024)),
1401 1401 (unsigned int)(hwdef->max_mem / (1024 * 1024)));
1402 1402 exit(1);
1403 1403 }
... ...
hw/sun4u.c
... ... @@ -79,7 +79,7 @@ extern int nographic;
79 79  
80 80 static int sun4u_NVRAM_set_params (m48t59_t *nvram, uint16_t NVRAM_size,
81 81 const unsigned char *arch,
82   - uint32_t RAM_size, const char *boot_devices,
  82 + ram_addr_t RAM_size, const char *boot_devices,
83 83 uint32_t kernel_image, uint32_t kernel_size,
84 84 const char *cmdline,
85 85 uint32_t initrd_image, uint32_t initrd_size,
... ...