]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target-sh4: MMU: fix mem_idx computation
authorAurelien Jarno <aurelien@aurel32.net>
Mon, 1 Feb 2010 18:58:46 +0000 (19:58 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 9 Apr 2010 16:21:51 +0000 (18:21 +0200)
The mem_idx is wrongly computed. As written in target-sh4/cpu.h, mode 0
corresponds to kernel mode (SR_MD = 1), while mode 1 corresponds to user
mode (SR_MD = 0).

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 33b8f5546cc16eaa3d89fe133a9843c794b65d6c)

target-sh4/translate.c

index 895b978d38757a4509879dae9129fd977de30191..7f9527a8347eead50275dec68613b7a111151919 100644 (file)
@@ -1905,7 +1905,7 @@ gen_intermediate_code_internal(CPUState * env, TranslationBlock * tb,
     ctx.bstate = BS_NONE;
     ctx.sr = env->sr;
     ctx.fpscr = env->fpscr;
-    ctx.memidx = (env->sr & SR_MD) ? 1 : 0;
+    ctx.memidx = (env->sr & SR_MD) == 0 ? 1 : 0;
     /* We don't know if the delayed pc came from a dynamic or static branch,
        so assume it is a dynamic branch.  */
     ctx.delayed_pc = -1; /* use delayed pc from env pointer */