Signed-off-by: Andreas Färber <afaer...@suse.de> --- target-ppc/excp_helper.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c index 4a0fc6d..b09aafc 100644 --- a/target-ppc/excp_helper.c +++ b/target-ppc/excp_helper.c @@ -982,21 +982,28 @@ void helper_msgclr(CPUPPCState *env, target_ulong rb) env->pending_interrupts &= ~(1 << irq); } +static void helper_msgsnd_one(CPUState *cs, void *data) +{ + target_ulong *rb = data; + int irq = dbell2irq(*rb); + int pir = *rb & DBELL_PIRTAG_MASK; + PowerPCCPU *cpu = POWERPC_CPU(cs); + CPUPPCState *env = &cpu->env; + + if ((*rb & DBELL_BRDCAST) || (env->spr[SPR_BOOKE_PIR] == pir)) { + env->pending_interrupts |= 1 << irq; + cpu_interrupt(cs, CPU_INTERRUPT_HARD); + } +} + void helper_msgsnd(target_ulong rb) { int irq = dbell2irq(rb); - int pir = rb & DBELL_PIRTAG_MASK; - CPUPPCState *cenv; if (irq < 0) { return; } - for (cenv = first_cpu; cenv != NULL; cenv = cenv->next_cpu) { - if ((rb & DBELL_BRDCAST) || (cenv->spr[SPR_BOOKE_PIR] == pir)) { - cenv->pending_interrupts |= 1 << irq; - cpu_interrupt(CPU(ppc_env_get_cpu(cenv)), CPU_INTERRUPT_HARD); - } - } + qemu_for_each_cpu(helper_msgsnd_one, &rb); } #endif -- 1.8.1.4