mirror of https://github.com/xqemu/xqemu.git
spapr: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for spapr_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
38f92da6e7
commit
05769733e0
|
@ -518,6 +518,7 @@ static void ppc_spapr_init(ram_addr_t ram_size,
|
||||||
const char *initrd_filename,
|
const char *initrd_filename,
|
||||||
const char *cpu_model)
|
const char *cpu_model)
|
||||||
{
|
{
|
||||||
|
PowerPCCPU *cpu;
|
||||||
CPUPPCState *env;
|
CPUPPCState *env;
|
||||||
int i;
|
int i;
|
||||||
MemoryRegion *sysmem = get_system_memory();
|
MemoryRegion *sysmem = get_system_memory();
|
||||||
|
@ -560,12 +561,13 @@ static void ppc_spapr_init(ram_addr_t ram_size,
|
||||||
cpu_model = kvm_enabled() ? "host" : "POWER7";
|
cpu_model = kvm_enabled() ? "host" : "POWER7";
|
||||||
}
|
}
|
||||||
for (i = 0; i < smp_cpus; i++) {
|
for (i = 0; i < smp_cpus; i++) {
|
||||||
env = cpu_init(cpu_model);
|
cpu = cpu_ppc_init(cpu_model);
|
||||||
|
if (cpu == NULL) {
|
||||||
if (!env) {
|
|
||||||
fprintf(stderr, "Unable to find PowerPC CPU definition\n");
|
fprintf(stderr, "Unable to find PowerPC CPU definition\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
env = &cpu->env;
|
||||||
|
|
||||||
/* Set time-base frequency to 512 MHz */
|
/* Set time-base frequency to 512 MHz */
|
||||||
cpu_ppc_tb_init(env, TIMEBASE_FREQ);
|
cpu_ppc_tb_init(env, TIMEBASE_FREQ);
|
||||||
qemu_register_reset(spapr_cpu_reset, env);
|
qemu_register_reset(spapr_cpu_reset, env);
|
||||||
|
|
Loading…
Reference in New Issue