]> Git Repo - qemu.git/commitdiff
target-mips: Fix RDHWR on CP0.Count
authorAlex Smith <[email protected]>
Tue, 8 Sep 2015 10:34:11 +0000 (11:34 +0100)
committerLeon Alrae <[email protected]>
Fri, 18 Sep 2015 08:20:48 +0000 (09:20 +0100)
For RDHWR on the CP0.Count register, env->CP0_Count was being returned.
This value is a delta against the QEMU_CLOCK_VIRTUAL clock, not the
correct current value of CP0.Count. Use cpu_mips_get_count() instead.

Signed-off-by: Alex Smith <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Leon Alrae <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Reviewed-by: Aurelien Jarno <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
target-mips/op_helper.c

index 1aa9e3c9e491c94e0226a94e8052eeb064d15004..94de1087efe9fa7ca1efa1678d7d9c730e1040f1 100644 (file)
@@ -2184,10 +2184,15 @@ target_ulong helper_rdhwr_synci_step(CPUMIPSState *env)
 target_ulong helper_rdhwr_cc(CPUMIPSState *env)
 {
     if ((env->hflags & MIPS_HFLAG_CP0) ||
-        (env->CP0_HWREna & (1 << 2)))
+        (env->CP0_HWREna & (1 << 2))) {
+#ifdef CONFIG_USER_ONLY
         return env->CP0_Count;
-    else
+#else
+        return (int32_t)cpu_mips_get_count(env);
+#endif
+    } else {
         helper_raise_exception(env, EXCP_RI);
+    }
 
     return 0;
 }
This page took 0.029383 seconds and 4 git commands to generate.