[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/24] target/mips: Move has_work() from CPUClass to SysemuCPU
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 13/24] target/mips: Move has_work() from CPUClass to SysemuCPUOps |
Date: |
Sat, 25 Jan 2025 17:05:41 +0100 |
Move has_work() from CPUClass to SysemuCPUOps and
cpu_mips_hw_interrupts_enabled() to system.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/mips/internal.h | 4 ++--
target/mips/cpu.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/target/mips/internal.h b/target/mips/internal.h
index 91c786cff8a..28eb28936ba 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -162,8 +162,6 @@ void cpu_mips_store_cause(CPUMIPSState *env, target_ulong
val);
extern const VMStateDescription vmstate_mips_cpu;
-#endif /* !CONFIG_USER_ONLY */
-
static inline bool cpu_mips_hw_interrupts_enabled(CPUMIPSState *env)
{
return (env->CP0_Status & (1 << CP0St_IE)) &&
@@ -206,6 +204,8 @@ static inline bool
cpu_mips_hw_interrupts_pending(CPUMIPSState *env)
return r;
}
+#endif /* !CONFIG_USER_ONLY */
+
void msa_reset(CPUMIPSState *env);
/* cp0_timer.c */
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 47cd7cfdcef..0b3ac4e60a3 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -132,6 +132,7 @@ static vaddr mips_cpu_get_pc(CPUState *cs)
return cpu->env.active_tc.PC;
}
+#if !defined(CONFIG_USER_ONLY)
static bool mips_cpu_has_work(CPUState *cs)
{
CPUMIPSState *env = cpu_env(cs);
@@ -177,6 +178,7 @@ static bool mips_cpu_has_work(CPUState *cs)
}
return has_work;
}
+#endif /* !CONFIG_USER_ONLY */
static int mips_cpu_mmu_index(CPUState *cs, bool ifunc)
{
@@ -534,6 +536,7 @@ static ObjectClass *mips_cpu_class_by_name(const char
*cpu_model)
#include "hw/core/sysemu-cpu-ops.h"
static const struct SysemuCPUOps mips_sysemu_ops = {
+ .has_work = mips_cpu_has_work,
.get_phys_page_debug = mips_cpu_get_phys_page_debug,
.legacy_vmsd = &vmstate_mips_cpu,
};
@@ -577,7 +580,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data)
&mcc->parent_phases);
cc->class_by_name = mips_cpu_class_by_name;
- cc->has_work = mips_cpu_has_work;
cc->mmu_index = mips_cpu_mmu_index;
cc->dump_state = mips_cpu_dump_state;
cc->set_pc = mips_cpu_set_pc;
--
2.47.1
- [PATCH v2 11/24] target/m68k: Move has_work() from CPUClass to SysemuCPUOps, (continued)
- [PATCH v2 11/24] target/m68k: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 12/24] target/microblaze: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 16/24] target/riscv: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 22/24] target/tricore: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 20/24] target/sh4: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 15/24] target/ppc: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 24/24] cpus: Remove CPUClass::has_work() handler, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 18/24] target/s390x: Restrict I/O handler installers to system emulation, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 13/24] target/mips: Move has_work() from CPUClass to SysemuCPUOps,
Philippe Mathieu-Daudé <=
- [PATCH v2 14/24] target/openrisc: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 21/24] target/sparc: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 23/24] target/xtensa: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 17/24] target/rx: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 19/24] target/s390x: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25