mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user