]> Git Repo - qemu.git/commitdiff
target-mips: Also apply the CP0.Status mask to MTTC0
authorMaciej W. Rozycki <[email protected]>
Thu, 20 Nov 2014 11:15:34 +0000 (11:15 +0000)
committerLeon Alrae <[email protected]>
Tue, 16 Dec 2014 12:45:20 +0000 (12:45 +0000)
Make CP0.Status writes made with the MTTC0 instruction respect this
register's mask just like all the other places.  Also preserve the
current values of masked out bits.

Signed-off-by: Maciej W. Rozycki <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
target-mips/op_helper.c

index 1267ef297cf7b181f794cc163f1f182a16c828bc..7e632f6875d461caf8510cef6e2d545a02c52022 100644 (file)
@@ -1413,9 +1413,10 @@ void helper_mtc0_status(CPUMIPSState *env, target_ulong arg1)
 void helper_mttc0_status(CPUMIPSState *env, target_ulong arg1)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
+    uint32_t mask = env->CP0_Status_rw_bitmask & ~0xf1000018;
     CPUMIPSState *other = mips_cpu_map_tc(env, &other_tc);
 
-    other->CP0_Status = arg1 & ~0xf1000018;
+    other->CP0_Status = (other->CP0_Status & ~mask) | (arg1 & mask);
     sync_c0_status(env, other, other_tc);
 }
 
This page took 0.030136 seconds and 4 git commands to generate.