aboutsummaryrefslogtreecommitdiff
path: root/target-mips/cpu.c
diff options
context:
space:
mode:
authorYongbok Kim <yongbok.kim@imgtec.com>2016-02-03 12:31:07 +0000
committerLeon Alrae <leon.alrae@imgtec.com>2016-02-26 08:59:17 +0000
commit01bc435b44b8802cc4697faa07d908684afbce4e (patch)
treeeb377fa81c980fba2f2c08941e43ba526d395041 /target-mips/cpu.c
parentbee62662a312b99b4418b558a99b3963a4cbff07 (diff)
target-mips: implement R6 multi-threading
MIPS Release 6 provides multi-threading features which replace pre-R6 MT Module. CP0.Config3.MT is always 0 in R6, instead there is new CP0.Config5.VP (Virtual Processor) bit which indicates presence of multi-threading support which includes CP0.GlobalNumber register and DVP/EVP instructions. Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Diffstat (limited to 'target-mips/cpu.c')
-rw-r--r--target-mips/cpu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/target-mips/cpu.c b/target-mips/cpu.c
index 0b3f130cf2..7dc3a44a15 100644
--- a/target-mips/cpu.c
+++ b/target-mips/cpu.c
@@ -77,6 +77,15 @@ static bool mips_cpu_has_work(CPUState *cs)
has_work = false;
}
}
+ /* MIPS Release 6 has the ability to halt the CPU. */
+ if (env->CP0_Config5 & (1 << CP0C5_VP)) {
+ if (cs->interrupt_request & CPU_INTERRUPT_WAKE) {
+ has_work = true;
+ }
+ if (!mips_vp_active(env)) {
+ has_work = false;
+ }
+ }
return has_work;
}