[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.1 15/27] target/nios2: Convert to TCGCPUOps::get_cpu_state(
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.1 15/27] target/nios2: Convert to TCGCPUOps::get_cpu_state() |
Date: |
Tue, 19 Mar 2024 16:42:44 +0100 |
Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/nios2/cpu.h | 14 --------------
target/nios2/cpu.c | 13 +++++++++++++
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index 32002b819a..d0616723fe 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -286,18 +286,4 @@ FIELD(TBFLAGS, CRS0, 0, 1) /* Set if CRS == 0. */
FIELD(TBFLAGS, U, 1, 1) /* Overlaps CR_STATUS_U */
FIELD(TBFLAGS, R0_0, 2, 1) /* Set if R0 == 0. */
-#define TARGET_HAS_CPU_GET_TB_CPU_STATE
-
-static inline void cpu_get_tb_cpu_state(CPUNios2State *env, vaddr *pc,
- uint64_t *cs_base, uint32_t *flags)
-{
- unsigned crs = FIELD_EX32(env->ctrl[CR_STATUS], CR_STATUS, CRS);
-
- *pc = env->pc;
- *cs_base = 0;
- *flags = (env->ctrl[CR_STATUS] & CR_STATUS_U)
- | (crs ? 0 : R_TBFLAGS_CRS0_MASK)
- | (env->regs[0] ? 0 : R_TBFLAGS_R0_0_MASK);
-}
-
#endif /* NIOS2_CPU_H */
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
index 679aff5730..d1a98c47ad 100644
--- a/target/nios2/cpu.c
+++ b/target/nios2/cpu.c
@@ -43,6 +43,18 @@ static void nios2_restore_state_to_opc(CPUState *cs,
cpu_env(cs)->pc = data[0];
}
+static void nios2_get_cpu_state(CPUNios2State *env, vaddr *pc,
+ uint64_t *cs_base, uint32_t *flags)
+{
+ unsigned crs = FIELD_EX32(env->ctrl[CR_STATUS], CR_STATUS, CRS);
+
+ *pc = env->pc;
+ *cs_base = 0;
+ *flags = (env->ctrl[CR_STATUS] & CR_STATUS_U)
+ | (crs ? 0 : R_TBFLAGS_CRS0_MASK)
+ | (env->regs[0] ? 0 : R_TBFLAGS_R0_0_MASK);
+}
+
static bool nios2_cpu_has_work(CPUState *cs)
{
return cs->interrupt_request & CPU_INTERRUPT_HARD;
@@ -354,6 +366,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops = {
static const TCGCPUOps nios2_tcg_ops = {
.initialize = nios2_tcg_init,
.restore_state_to_opc = nios2_restore_state_to_opc,
+ .get_cpu_state = nios2_get_cpu_state,
#ifndef CONFIG_USER_ONLY
.tlb_fill = nios2_cpu_tlb_fill,
--
2.41.0
- [PATCH-for-9.1 04/27] target/arm: Restrict TCG-specific declarations, (continued)
- [PATCH-for-9.1 04/27] target/arm: Restrict TCG-specific declarations, Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 05/27] target/arm: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 06/27] target/avr: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 07/27] target/cris: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 08/27] target/hexagon: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 09/27] target/hppa: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 11/27] target/loongarch: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 12/27] target/m68k: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 14/27] target/mips: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 15/27] target/nios2: Convert to TCGCPUOps::get_cpu_state(),
Philippe Mathieu-Daudé <=
- [PATCH-for-9.1 13/27] target/microblaze: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 10/27] target/i386: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 16/27] target/openrisc: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 17/27] target/ppc: Indent ppc_tcg_ops[] with 4 spaces, Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 18/27] target/ppc: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19
- [PATCH-for-9.1 19/27] target/riscv: Convert to TCGCPUOps::get_cpu_state(), Philippe Mathieu-Daudé, 2024/03/19