We will shortly call it from more places. Signed-off-by: Alex Bennée --- target/arm/internals.h | 19 +++++++++++++++++++ target/arm/tcg/op_helper.c | 9 +-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index dc593f1fec8..089f679ac0a 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -682,6 +682,25 @@ bool arm_is_psci_call(ARMCPU *cpu, int excp_type); /* Actually handle a PSCI call */ void arm_handle_psci_call(ARMCPU *cpu); +/** + * arm_broadcast_event: set the event_register for all PEs + * + * This kicks all PEs which will up which are waiting on the event + * register. + */ +static inline void arm_broadcast_event(void) +{ + CPUState *cs; + + CPU_FOREACH(cs) { + ARMCPU *target_cpu = ARM_CPU(cs); + target_cpu->env.event_register = true; + if (!qemu_cpu_is_self(cs)) { + qemu_cpu_kick(cs); + } + } +} + /** * arm_clear_exclusive: clear the exclusive monitor * @env: CPU env diff --git a/target/arm/tcg/op_helper.c b/target/arm/tcg/op_helper.c index 655e3f96e78..6a2be85fcaa 100644 --- a/target/arm/tcg/op_helper.c +++ b/target/arm/tcg/op_helper.c @@ -474,14 +474,7 @@ void HELPER(wfit)(CPUARMState *env, uint32_t rd) void HELPER(sev)(CPUARMState *env) { - CPUState *cs = env_cpu(env); - CPU_FOREACH(cs) { - ARMCPU *target_cpu = ARM_CPU(cs); - target_cpu->env.event_register = true; - if (!qemu_cpu_is_self(cs)) { - qemu_cpu_kick(cs); - } - } + arm_broadcast_event(); } void HELPER(wfe)(CPUARMState *env) -- 2.47.3