@@ -743,11 +743,13 @@ void helper_sdm (target_ulong addr, target_ulong reglist, uint32_t mem_idx)
#ifndef CONFIG_USER_ONLY
/* SMP helpers. */
-static int mips_vpe_is_wfi(CPUMIPSState *c)
+static bool mips_vpe_is_wfi(MIPSCPU *c)
{
+ CPUMIPSState *env = &c->env;
+
/* If the VPE is halted but otherwise active, it means it's waiting for
an interrupt. */
- return c->halted && mips_vpe_active(c);
+ return env->halted && mips_vpe_active(env);
}
static inline void mips_vpe_wake(CPUMIPSState *c)
@@ -771,7 +773,7 @@ static inline void mips_tc_wake(MIPSCPU *cpu, int tc)
CPUMIPSState *c = &cpu->env;
/* FIXME: TC reschedule. */
- if (mips_vpe_active(c) && !mips_vpe_is_wfi(c)) {
+ if (mips_vpe_active(c) && !mips_vpe_is_wfi(cpu)) {
mips_vpe_wake(c);
}
}
@@ -1921,12 +1923,14 @@ target_ulong helper_dvpe(void)
target_ulong helper_evpe(void)
{
CPUMIPSState *other_cpu = first_cpu;
+ MIPSCPU *cpu;
target_ulong prev = env->mvp->CP0_MVPControl;
do {
+ cpu = mips_env_get_cpu(other_cpu);
if (other_cpu != env
/* If the VPE is WFI, don't disturb its sleep. */
- && !mips_vpe_is_wfi(other_cpu)) {
+ && !mips_vpe_is_wfi(cpu)) {
/* Enable the VPE. */
other_cpu->mvp->CP0_MVPControl |= (1 << CP0MVPCo_EVP);
mips_vpe_wake(other_cpu); /* And wake it up. */
Needed for moving halted field to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de> --- target-mips/op_helper.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)