summaryrefslogtreecommitdiff
path: root/target-mips
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-12-17 03:27:07 +0100
committerAndreas Färber <afaerber@suse.de>2013-01-15 04:09:13 +0100
commitce3960ebe57d0601a3628b64adac6fd23c901f70 (patch)
tree0f3cbd92e527d7164bcdd88c6d624d2d6834498c /target-mips
parentcf7c3f0cb5a7129f57fa9e69d410d6a05031988c (diff)
cpu: Move nr_{cores,threads} fields to CPUState
To facilitate the field movements, pass MIPSCPU to malta_mips_config(); avoid that for mips_cpu_map_tc() since callers only access MIPS Thread Contexts, inside TCG helpers. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-mips')
-rw-r--r--target-mips/op_helper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index d5c61e8a8..fb63d9e40 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -581,8 +581,9 @@ static inline void mips_tc_sleep(MIPSCPU *cpu, int tc)
walking the list of CPUMIPSStates. */
static CPUMIPSState *mips_cpu_map_tc(CPUMIPSState *env, int *tc)
{
+ CPUState *cs;
CPUMIPSState *other;
- int vpe_idx, nr_threads = env->nr_threads;
+ int vpe_idx;
int tc_idx = *tc;
if (!(env->CP0_VPEConf0 & (1 << CP0VPEC0_MVP))) {
@@ -591,8 +592,9 @@ static CPUMIPSState *mips_cpu_map_tc(CPUMIPSState *env, int *tc)
return env;
}
- vpe_idx = tc_idx / nr_threads;
- *tc = tc_idx % nr_threads;
+ cs = CPU(mips_env_get_cpu(env));
+ vpe_idx = tc_idx / cs->nr_threads;
+ *tc = tc_idx % cs->nr_threads;
other = qemu_get_cpu(vpe_idx);
return other ? other : env;
}