Revision 182735ef hw/ppc/spapr.c

b/hw/ppc/spapr.c
131 131
static int spapr_fixup_cpu_dt(void *fdt, sPAPREnvironment *spapr)
132 132
{
133 133
    int ret = 0, offset;
134
    CPUPPCState *env;
135 134
    CPUState *cpu;
136 135
    char cpu_model[32];
137 136
    int smt = kvmppc_smt_threads();
......
139 138

  
140 139
    assert(spapr->cpu_model);
141 140

  
142
    for (env = first_cpu; env != NULL; env = env->next_cpu) {
143
        cpu = CPU(ppc_env_get_cpu(env));
141
    for (cpu = first_cpu; cpu != NULL; cpu = cpu->next_cpu) {
144 142
        uint32_t associativity[] = {cpu_to_be32(0x5),
145 143
                                    cpu_to_be32(0x0),
146 144
                                    cpu_to_be32(0x0),
......
231 229
                                   uint32_t epow_irq)
232 230
{
233 231
    void *fdt;
234
    CPUPPCState *env;
232
    CPUState *cs;
235 233
    uint32_t start_prop = cpu_to_be32(initrd_base);
236 234
    uint32_t end_prop = cpu_to_be32(initrd_base + initrd_size);
237 235
    char hypertas_prop[] = "hcall-pft\0hcall-term\0hcall-dabr\0hcall-interrupt"
......
304 302
    /* This is needed during FDT finalization */
305 303
    spapr->cpu_model = g_strdup(modelname);
306 304

  
307
    for (env = first_cpu; env != NULL; env = env->next_cpu) {
308
        CPUState *cpu = CPU(ppc_env_get_cpu(env));
309
        PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
310
        int index = cpu->cpu_index;
305
    for (cs = first_cpu; cs != NULL; cs = cs->next_cpu) {
306
        PowerPCCPU *cpu = POWERPC_CPU(cs);
307
        CPUPPCState *env = &cpu->env;
308
        PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs);
309
        int index = cs->cpu_index;
311 310
        uint32_t servers_prop[smp_threads];
312 311
        uint32_t gservers_prop[smp_threads * 2];
313 312
        char *nodename;
......
632 631

  
633 632
static void ppc_spapr_reset(void)
634 633
{
635
    CPUState *first_cpu_cpu;
634
    PowerPCCPU *first_ppc_cpu;
636 635

  
637 636
    /* Reset the hash table & recalc the RMA */
638 637
    spapr_reset_htab(spapr);
......
644 643
                       spapr->rtas_size);
645 644

  
646 645
    /* Set up the entry state */
647
    first_cpu_cpu = ENV_GET_CPU(first_cpu);
648
    first_cpu->gpr[3] = spapr->fdt_addr;
649
    first_cpu->gpr[5] = 0;
650
    first_cpu_cpu->halted = 0;
651
    first_cpu->nip = spapr->entry_point;
646
    first_ppc_cpu = POWERPC_CPU(first_cpu);
647
    first_ppc_cpu->env.gpr[3] = spapr->fdt_addr;
648
    first_ppc_cpu->env.gpr[5] = 0;
649
    first_cpu->halted = 0;
650
    first_ppc_cpu->env.nip = spapr->entry_point;
652 651

  
653 652
}
654 653

  

Also available in: Unified diff