[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.1 23/27] target/sh4: Convert to TCGCPUOps::get_cpu_state()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.1 23/27] target/sh4: Convert to TCGCPUOps::get_cpu_state() |
Date: |
Tue, 19 Mar 2024 16:42:52 +0100 |
Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/sh4/cpu.h | 15 ---------------
target/sh4/cpu.c | 16 ++++++++++++++++
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h
index 9211da6bde..36aff035cf 100644
--- a/target/sh4/cpu.h
+++ b/target/sh4/cpu.h
@@ -370,19 +370,4 @@ static inline void cpu_write_sr(CPUSH4State *env,
target_ulong sr)
env->sr = sr & ~((1u << SR_M) | (1u << SR_Q) | (1u << SR_T));
}
-static inline void cpu_get_tb_cpu_state(CPUSH4State *env, vaddr *pc,
- uint64_t *cs_base, uint32_t *flags)
-{
- *pc = env->pc;
- /* For a gUSA region, notice the end of the region. */
- *cs_base = env->flags & TB_FLAG_GUSA_MASK ? env->gregs[0] : 0;
- *flags = env->flags
- | (env->fpscr & TB_FLAG_FPSCR_MASK)
- | (env->sr & TB_FLAG_SR_MASK)
- | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 3 */
-#ifdef CONFIG_USER_ONLY
- *flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus;
-#endif
-}
-
#endif /* SH4_CPU_H */
diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
index 4f5a4a3d98..9b2b377e29 100644
--- a/target/sh4/cpu.c
+++ b/target/sh4/cpu.c
@@ -67,6 +67,21 @@ static void superh_restore_state_to_opc(CPUState *cs,
*/
}
+static void sh4_get_cpu_state(CPUSH4State *env, vaddr *pc,
+ uint64_t *cs_base, uint32_t *flags)
+{
+ *pc = env->pc;
+ /* For a gUSA region, notice the end of the region. */
+ *cs_base = env->flags & TB_FLAG_GUSA_MASK ? env->gregs[0] : 0;
+ *flags = env->flags
+ | (env->fpscr & TB_FLAG_FPSCR_MASK)
+ | (env->sr & TB_FLAG_SR_MASK)
+ | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 3 */
+#ifdef CONFIG_USER_ONLY
+ *flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus;
+#endif
+}
+
#ifndef CONFIG_USER_ONLY
static bool superh_io_recompile_replay_branch(CPUState *cs,
const TranslationBlock *tb)
@@ -250,6 +265,7 @@ static const TCGCPUOps superh_tcg_ops = {
.initialize = sh4_translate_init,
.synchronize_from_tb = superh_cpu_synchronize_from_tb,
.restore_state_to_opc = superh_restore_state_to_opc,
+ .get_cpu_state = sh4_get_cpu_state,
#ifndef CONFIG_USER_ONLY
.tlb_fill = superh_cpu_tlb_fill,
--
2.41.0
- Re: [PATCH-for-9.1 18/27] target/ppc: Convert to TCGCPUOps::get_cpu_state(), (continued)
- [PATCH-for-9.1 23/27] target/sh4: Convert to TCGCPUOps::get_cpu_state(),
Philippe Mathieu-Daudé <=
- [PATCH-for-9.1 24/27] target/sparc: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 25/27] target/tricore: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 26/27] target/xtensa: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 27/27] accel/tcg: Remove check on TARGET_HAS_CPU_GET_TB_CPU_STATE, Philippe Mathieu-Daudé, 2024/03/19
- Re: [PATCH-for-9.1 00/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler, Philippe Mathieu-Daudé, 2024/03/19
- Re: [PATCH-for-9.1 00/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler, Richard Henderson, 2024/03/19