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