]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target/mips: Add reset state for PWSize and PWField registers
authorYongbok Kim <yongbok.kim@mips.com>
Fri, 12 Oct 2018 12:05:25 +0000 (14:05 +0200)
committerAleksandar Markovic <amarkovic@wavecomp.com>
Thu, 18 Oct 2018 18:37:20 +0000 (20:37 +0200)
Add reset state for PWSize and PWField registers. The reset state
is different for pre-R6 and R6 (and post-R6) ISAa.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Yongbok Kim <yongbok.kim@mips.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
target/mips/translate.c

index 29a631aa83931fcca737dc9ee7d729ef8930bc6f..159671cbb1cd1defa5a20ddfd435f86c62ebf2b9 100644 (file)
@@ -26444,6 +26444,24 @@ void cpu_state_reset(CPUMIPSState *env)
         env->CP0_Status |= (1 << CP0St_FR);
     }
 
+    if (env->insn_flags & ISA_MIPS32R6) {
+        /* PTW  =  1 */
+        env->CP0_PWSize = 0x40;
+        /* GDI  = 12 */
+        /* UDI  = 12 */
+        /* MDI  = 12 */
+        /* PRI  = 12 */
+        /* PTEI =  2 */
+        env->CP0_PWField = 0x0C30C302;
+    } else {
+        /* GDI  =  0 */
+        /* UDI  =  0 */
+        /* MDI  =  0 */
+        /* PRI  =  0 */
+        /* PTEI =  2 */
+        env->CP0_PWField = 0x02;
+    }
+
     if (env->CP0_Config3 & (1 << CP0C3_ISA) & (1 << (CP0C3_ISA + 1))) {
         /*  microMIPS on reset when Config3.ISA is 3 */
         env->hflags |= MIPS_HFLAG_M16;