diff options
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c index 34088ad185..a959261209 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -281,17 +281,19 @@ static void dummy_cpu_set_irq(void *opaque, int irq, int level) static void main_cpu_reset(void *opaque) { - CPUSPARCState *env = opaque; + SPARCCPU *cpu = opaque; + CPUSPARCState *env = &cpu->env; - cpu_state_reset(env); + cpu_reset(CPU(cpu)); env->halted = 0; } static void secondary_cpu_reset(void *opaque) { - CPUSPARCState *env = opaque; + SPARCCPU *cpu = opaque; + CPUSPARCState *env = &cpu->env; - cpu_state_reset(env); + cpu_reset(CPU(cpu)); env->halted = 1; } @@ -809,19 +811,21 @@ static TypeInfo ram_info = { static void cpu_devinit(const char *cpu_model, unsigned int id, uint64_t prom_addr, qemu_irq **cpu_irqs) { + SPARCCPU *cpu; CPUSPARCState *env; - env = cpu_init(cpu_model); - if (!env) { + cpu = cpu_sparc_init(cpu_model); + if (cpu == NULL) { fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n"); exit(1); } + env = &cpu->env; cpu_sparc_set_id(env, id); if (id == 0) { - qemu_register_reset(main_cpu_reset, env); + qemu_register_reset(main_cpu_reset, cpu); } else { - qemu_register_reset(secondary_cpu_reset, env); + qemu_register_reset(secondary_cpu_reset, cpu); env->halted = 1; } *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, env, MAX_PILS); |