static inline int mips_vp_active(CPUMIPSState *env)
{
- CPUState *other_cs = first_cpu;
+ CPUState *cs = first_cpu;
/* Check if the VP disabled other VPs (which means the VP is enabled) */
if ((env->CP0_VPControl >> CP0VPCtl_DIS) & 1) {
}
/* Check if the virtual processor is disabled due to a DVP */
- CPU_FOREACH(other_cs) {
- MIPSCPU *other_cpu = MIPS_CPU(other_cs);
- if ((&other_cpu->env != env) &&
- ((other_cpu->env.CP0_VPControl >> CP0VPCtl_DIS) & 1)) {
+ CPU_FOREACH(cs) {
+ CPUMIPSState *other_env = cpu_env(cs);
+
+ if ((other_env != env) &&
+ ((other_env->CP0_VPControl >> CP0VPCtl_DIS) & 1)) {
return 0;
}
}
target_ulong helper_dvpe(CPUMIPSState *env)
{
- CPUState *other_cs = first_cpu;
MIPSCPU *cpu = env_archcpu(env);
target_ulong prev = cpu->mvp->CP0_MVPControl;
if (env->CP0_VPEConf0 & (1 << CP0VPEC0_MVP)) {
- CPU_FOREACH(other_cs) {
- MIPSCPU *other_cpu = MIPS_CPU(other_cs);
+ CPUState *cs = first_cpu;
+
+ CPU_FOREACH(cs) {
+ MIPSCPU *other_cpu = MIPS_CPU(cs);
/* Turn off all VPEs except the one executing the dvpe. */
if (&other_cpu->env != env) {
other_cpu->mvp->CP0_MVPControl &= ~(1 << CP0MVPCo_EVP);
target_ulong helper_evpe(CPUMIPSState *env)
{
- CPUState *other_cs = first_cpu;
MIPSCPU *cpu = env_archcpu(env);
target_ulong prev = cpu->mvp->CP0_MVPControl;
if (env->CP0_VPEConf0 & (1 << CP0VPEC0_MVP)) {
- CPU_FOREACH(other_cs) {
- MIPSCPU *other_cpu = MIPS_CPU(other_cs);
+ CPUState *cs = first_cpu;
+
+ CPU_FOREACH(cs) {
+ MIPSCPU *other_cpu = MIPS_CPU(cs);
if (&other_cpu->env != env
/* If the VPE is WFI, don't disturb its sleep. */
/* R6 Multi-threading */
target_ulong helper_dvp(CPUMIPSState *env)
{
- CPUState *other_cs = first_cpu;
target_ulong prev = env->CP0_VPControl;
if (!((env->CP0_VPControl >> CP0VPCtl_DIS) & 1)) {
- CPU_FOREACH(other_cs) {
- MIPSCPU *other_cpu = MIPS_CPU(other_cs);
+ CPUState *cpu = first_cpu;
+
+ CPU_FOREACH(cpu) {
+ MIPSCPU *other_cpu = MIPS_CPU(cpu);
/* Turn off all VPs except the one executing the dvp. */
if (&other_cpu->env != env) {
mips_vpe_sleep(other_cpu);
target_ulong helper_evp(CPUMIPSState *env)
{
- CPUState *other_cs = first_cpu;
target_ulong prev = env->CP0_VPControl;
if ((env->CP0_VPControl >> CP0VPCtl_DIS) & 1) {
- CPU_FOREACH(other_cs) {
- MIPSCPU *other_cpu = MIPS_CPU(other_cs);
+ CPUState *cpu = first_cpu;
+
+ CPU_FOREACH(cpu) {
+ MIPSCPU *other_cpu = MIPS_CPU(cpu);
if ((&other_cpu->env != env) && !mips_vp_is_wfi(other_cpu)) {
/*
* If the VP is WFI, don't disturb its sleep.
uint32_t invMsgVPN2 = arg & (TARGET_PAGE_MASK << 1);
uint8_t invMsgR = 0;
uint32_t invMsgMMid = env->CP0_MemoryMapID;
- CPUState *other_cs = first_cpu;
+ CPUState *cpu = first_cpu;
#ifdef TARGET_MIPS64
invMsgR = extract64(arg, 62, 2);
#endif
- CPU_FOREACH(other_cs) {
- MIPSCPU *other_cpu = MIPS_CPU(other_cs);
- global_invalidate_tlb(&other_cpu->env, invMsgVPN2, invMsgR, invMsgMMid,
+ CPU_FOREACH(cpu) {
+ global_invalidate_tlb(cpu_env(cpu), invMsgVPN2, invMsgR, invMsgMMid,
invAll, invVAMMid, invMMid, invVA);
}
}