Patchwork [qom-next,54/59] target-mips: Pass MIPSCPU to mips_tc_sleep()

login
register
mail settings
Submitter Andreas Färber
Date May 23, 2012, 3:08 a.m.
Message ID <1337742502-28565-55-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/160800/
State New
Headers show

Comments

Andreas Färber - May 23, 2012, 3:08 a.m.
Needed for mips_vpe_sleep().

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-mips/op_helper.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index af62c8b..bfced36 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -778,8 +778,10 @@  static inline void mips_tc_wake(MIPSCPU *cpu, int tc)
     }
 }
 
-static inline void mips_tc_sleep(CPUMIPSState *c, int tc)
+static inline void mips_tc_sleep(MIPSCPU *cpu, int tc)
 {
+    CPUMIPSState *c = &cpu->env;
+
     /* FIXME: TC reschedule.  */
     if (!mips_vpe_active(c)) {
         mips_vpe_sleep(c);
@@ -1378,7 +1380,7 @@  void helper_mtc0_tchalt (target_ulong arg1)
 
     // TODO: Halt TC / Restart (if allocated+active) TC.
     if (env->active_tc.CP0_TCHalt & 1) {
-        mips_tc_sleep(env, env->current_tc);
+        mips_tc_sleep(mips_env_get_cpu(env), env->current_tc);
     } else {
         mips_tc_wake(mips_env_get_cpu(env), env->current_tc);
     }
@@ -1397,7 +1399,7 @@  void helper_mttc0_tchalt (target_ulong arg1)
         other->tcs[other_tc].CP0_TCHalt = arg1;
 
     if (arg1 & 1) {
-        mips_tc_sleep(other, other_tc);
+        mips_tc_sleep(mips_env_get_cpu(other), other_tc);
     } else {
         mips_tc_wake(mips_env_get_cpu(other), other_tc);
     }