summary refs log tree commit diff stats
path: root/target/sh4/cpu.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-08-28 18:58:20 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-10-04 12:33:05 -0700
commitab419fd8a035a65942de4e63effcd55ccbf1a9fe (patch)
tree55d0319dbdd6b945fce99fe70f06fd1694b32cbd /target/sh4/cpu.c
parent20add588296a8a24374004e9dbf6219f28665d34 (diff)
downloadfocaccia-qemu-ab419fd8a035a65942de4e63effcd55ccbf1a9fe.tar.gz
focaccia-qemu-ab419fd8a035a65942de4e63effcd55ccbf1a9fe.zip
target/sh4: Fix TB_FLAG_UNALIGN
The value previously chosen overlaps GUSA_MASK.

Rename all DELAY_SLOT_* and GUSA_* defines to emphasize
that they are included in TB_FLAGs.  Add aliases for the
FPSCR and SR bits that are included in TB_FLAGS, so that
we don't accidentally reassign those bits.

Fixes: 4da06fb3062 ("target/sh4: Implement prctl_unalign_sigbus")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/856
Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/sh4/cpu.c')
-rw-r--r--target/sh4/cpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
index a65a66de43..56c50530da 100644
--- a/target/sh4/cpu.c
+++ b/target/sh4/cpu.c
@@ -47,7 +47,7 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs,
     SuperHCPU *cpu = SUPERH_CPU(cs);
 
     cpu->env.pc = tb_pc(tb);
-    cpu->env.flags = tb->flags & TB_FLAG_ENVFLAGS_MASK;
+    cpu->env.flags = tb->flags;
 }
 
 #ifndef CONFIG_USER_ONLY
@@ -57,10 +57,10 @@ static bool superh_io_recompile_replay_branch(CPUState *cs,
     SuperHCPU *cpu = SUPERH_CPU(cs);
     CPUSH4State *env = &cpu->env;
 
-    if ((env->flags & ((DELAY_SLOT | DELAY_SLOT_CONDITIONAL))) != 0
+    if ((env->flags & (TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND))
         && env->pc != tb_pc(tb)) {
         env->pc -= 2;
-        env->flags &= ~(DELAY_SLOT | DELAY_SLOT_CONDITIONAL);
+        env->flags &= ~(TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND);
         return true;
     }
     return false;