diff options
Diffstat (limited to 'hw/ppc/ppc.c')
-rw-r--r-- | hw/ppc/ppc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 52a18eb..8dd982f 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -1495,15 +1495,20 @@ void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val) } } +int ppc_cpu_pir(PowerPCCPU *cpu) +{ + CPUPPCState *env = &cpu->env; + return env->spr_cb[SPR_PIR].default_value; +} + PowerPCCPU *ppc_get_vcpu_by_pir(int pir) { CPUState *cs; CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); - CPUPPCState *env = &cpu->env; - if (env->spr_cb[SPR_PIR].default_value == pir) { + if (ppc_cpu_pir(cpu) == pir) { return cpu; } } |