xtensa_lx60: Use cpu_xtensa_init() to obtain XtensaCPU

Allows us to use cpu_reset() in place of cpu_state_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
Andreas Färber 2012-05-04 19:31:25 +02:00
parent 11e7bfd7e0
commit adbb0f75f0

View file

@ -164,6 +164,7 @@ static void lx_init(const LxBoardDesc *board,
int be = 0; int be = 0;
#endif #endif
MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_memory = get_system_memory();
XtensaCPU *cpu = NULL;
CPUXtensaState *env = NULL; CPUXtensaState *env = NULL;
MemoryRegion *ram, *rom, *system_io; MemoryRegion *ram, *rom, *system_io;
DriveInfo *dinfo; DriveInfo *dinfo;
@ -175,17 +176,19 @@ static void lx_init(const LxBoardDesc *board,
} }
for (n = 0; n < smp_cpus; n++) { for (n = 0; n < smp_cpus; n++) {
env = cpu_init(cpu_model); cpu = cpu_xtensa_init(cpu_model);
if (!env) { if (cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n"); fprintf(stderr, "Unable to find CPU definition\n");
exit(1); exit(1);
} }
env = &cpu->env;
env->sregs[PRID] = n; env->sregs[PRID] = n;
qemu_register_reset(lx60_reset, env); qemu_register_reset(lx60_reset, env);
/* Need MMU initialized prior to ELF loading, /* Need MMU initialized prior to ELF loading,
* so that ELF gets loaded into virtual addresses * so that ELF gets loaded into virtual addresses
*/ */
cpu_state_reset(env); cpu_reset(CPU(cpu));
} }
ram = g_malloc(sizeof(*ram)); ram = g_malloc(sizeof(*ram));