ppc_oldworld: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for ppc_heathrow_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
6680988c30
commit
72c33dd714
|
@ -80,6 +80,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
|
||||||
const char *cpu_model)
|
const char *cpu_model)
|
||||||
{
|
{
|
||||||
MemoryRegion *sysmem = get_system_memory();
|
MemoryRegion *sysmem = get_system_memory();
|
||||||
|
PowerPCCPU *cpu = NULL;
|
||||||
CPUPPCState *env = NULL;
|
CPUPPCState *env = NULL;
|
||||||
char *filename;
|
char *filename;
|
||||||
qemu_irq *pic, **heathrow_irqs;
|
qemu_irq *pic, **heathrow_irqs;
|
||||||
|
@ -104,11 +105,13 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
|
||||||
if (cpu_model == NULL)
|
if (cpu_model == NULL)
|
||||||
cpu_model = "G3";
|
cpu_model = "G3";
|
||||||
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 (!env) {
|
if (cpu == NULL) {
|
||||||
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 16.6 Mhz */
|
/* Set time-base frequency to 16.6 Mhz */
|
||||||
cpu_ppc_tb_init(env, 16600000UL);
|
cpu_ppc_tb_init(env, 16600000UL);
|
||||||
qemu_register_reset(ppc_heathrow_reset, env);
|
qemu_register_reset(ppc_heathrow_reset, env);
|
||||||
|
|
Loading…
Reference in a new issue