leon3: Use cpu_sparc_init() to obtain SPARCCPU
Needed for main_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
403d7a2d73
commit
60ad073356
|
@ -101,6 +101,7 @@ static void leon3_generic_hw_init(ram_addr_t ram_size,
|
||||||
const char *initrd_filename,
|
const char *initrd_filename,
|
||||||
const char *cpu_model)
|
const char *cpu_model)
|
||||||
{
|
{
|
||||||
|
SPARCCPU *cpu;
|
||||||
CPUSPARCState *env;
|
CPUSPARCState *env;
|
||||||
MemoryRegion *address_space_mem = get_system_memory();
|
MemoryRegion *address_space_mem = get_system_memory();
|
||||||
MemoryRegion *ram = g_new(MemoryRegion, 1);
|
MemoryRegion *ram = g_new(MemoryRegion, 1);
|
||||||
|
@ -117,11 +118,12 @@ static void leon3_generic_hw_init(ram_addr_t ram_size,
|
||||||
cpu_model = "LEON3";
|
cpu_model = "LEON3";
|
||||||
}
|
}
|
||||||
|
|
||||||
env = cpu_init(cpu_model);
|
cpu = cpu_sparc_init(cpu_model);
|
||||||
if (!env) {
|
if (cpu == NULL) {
|
||||||
fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
|
fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
env = &cpu->env;
|
||||||
|
|
||||||
cpu_sparc_set_id(env, 0);
|
cpu_sparc_set_id(env, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue