aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-25 07:55:52 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-25 07:55:52 +0000
commit62724a3773b5553a696ebc5cdd212908f7572c6a (patch)
tree49f7c34e86996fe5eccbfd105335923080818dec /hw
parent34ee2edebb992b5d3f7c383a3d0c34f3e75880c8 (diff)
Sparc32/64 CPU selection
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2534 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/sun4m.c9
-rw-r--r--hw/sun4u.c10
2 files changed, 19 insertions, 0 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c
index c5f6ddda8b..bc49c73c6b 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -219,12 +219,21 @@ static void sun4m_init(int ram_size, int vga_ram_size, int boot_device,
unsigned int i;
long vram_size = 0x100000, prom_offset, initrd_size, kernel_size;
void *iommu, *dma, *main_esp, *main_lance = NULL;
+ const sparc_def_t *def;
linux_boot = (kernel_filename != NULL);
/* init CPUs */
+ if (cpu_model == NULL)
+ cpu_model = "Fujitsu MB86904";
+ sparc_find_by_name(cpu_model, &def);
+ if (def == NULL) {
+ fprintf(stderr, "Unable to find Sparc CPU definition\n");
+ exit(1);
+ }
for(i = 0; i < smp_cpus; i++) {
env = cpu_init();
+ cpu_sparc_register(env, def);
envs[i] = env;
if (i != 0)
env->halted = 1;
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 2357dc974a..906695690f 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -266,10 +266,20 @@ static void sun4u_init(int ram_size, int vga_ram_size, int boot_device,
unsigned int i;
long prom_offset, initrd_size, kernel_size;
PCIBus *pci_bus;
+ const sparc_def_t *def;
linux_boot = (kernel_filename != NULL);
+ /* init CPUs */
+ if (cpu_model == NULL)
+ cpu_model = "TI UltraSparc II";
+ sparc_find_by_name(cpu_model, &def);
+ if (def == NULL) {
+ fprintf(stderr, "Unable to find Sparc CPU definition\n");
+ exit(1);
+ }
env = cpu_init();
+ cpu_sparc_register(env, def);
register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
qemu_register_reset(main_cpu_reset, env);