[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/19] target/mips: Extract cpu_supports*/cpu_set* translate.c
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 08/19] target/mips: Extract cpu_supports*/cpu_set* translate.c |
Date: |
Mon, 7 Dec 2020 00:39:38 +0100 |
Move cpu_supports*() and cpu_set_exception_base() from
translate.c to cpu.c.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/cpu.c | 18 ++++++++++++++++++
target/mips/translate.c | 18 ------------------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 76d50b00b42..8d9ef139f07 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -310,3 +310,21 @@ MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type,
Clock *cpu_refclk)
return MIPS_CPU(cpu);
}
+
+bool cpu_supports_cps_smp(const char *cpu_type)
+{
+ const MIPSCPUClass *mcc = MIPS_CPU_CLASS(object_class_by_name(cpu_type));
+ return (mcc->cpu_def->CP0_Config3 & (1 << CP0C3_CMGCR)) != 0;
+}
+
+bool cpu_supports_isa(const char *cpu_type, uint64_t isa)
+{
+ const MIPSCPUClass *mcc = MIPS_CPU_CLASS(object_class_by_name(cpu_type));
+ return (mcc->cpu_def->insn_flags & isa) != 0;
+}
+
+void cpu_set_exception_base(int vp_index, target_ulong address)
+{
+ MIPSCPU *vp = MIPS_CPU(qemu_get_cpu(vp_index));
+ vp->env.exception_base = address;
+}
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 346635370c4..dbb71fdaa5d 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -31766,24 +31766,6 @@ void cpu_mips_realize_env(CPUMIPSState *env)
mvp_init(env, env->cpu_model);
}
-bool cpu_supports_cps_smp(const char *cpu_type)
-{
- const MIPSCPUClass *mcc = MIPS_CPU_CLASS(object_class_by_name(cpu_type));
- return (mcc->cpu_def->CP0_Config3 & (1 << CP0C3_CMGCR)) != 0;
-}
-
-bool cpu_supports_isa(const char *cpu_type, uint64_t isa)
-{
- const MIPSCPUClass *mcc = MIPS_CPU_CLASS(object_class_by_name(cpu_type));
- return (mcc->cpu_def->insn_flags & isa) != 0;
-}
-
-void cpu_set_exception_base(int vp_index, target_ulong address)
-{
- MIPSCPU *vp = MIPS_CPU(qemu_get_cpu(vp_index));
- vp->env.exception_base = address;
-}
-
void cpu_state_reset(CPUMIPSState *env)
{
CPUState *cs = env_cpu(env);
--
2.26.2
- [PATCH 04/19] target/mips: Remove unused headers from cp0_helper.c, (continued)
- [PATCH 04/19] target/mips: Remove unused headers from cp0_helper.c, Philippe Mathieu-Daudé, 2020/12/06
- [PATCH 03/19] target/mips: Remove unused headers from fpu_helper.c, Philippe Mathieu-Daudé, 2020/12/06
- [PATCH 05/19] target/mips: Remove unused headers from op_helper.c, Philippe Mathieu-Daudé, 2020/12/06
- [PATCH 06/19] target/mips: Remove unused headers from kvm.c, Philippe Mathieu-Daudé, 2020/12/06
- [PATCH 07/19] target/mips: Include "exec/memattrs.h" in 'internal.h', Philippe Mathieu-Daudé, 2020/12/06
- [PATCH 08/19] target/mips: Extract cpu_supports*/cpu_set* translate.c,
Philippe Mathieu-Daudé <=
- [PATCH 10/19] target/mips: Add !CONFIG_USER_ONLY comment after #endif, Philippe Mathieu-Daudé, 2020/12/06
- [PATCH 09/19] target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c, Philippe Mathieu-Daudé, 2020/12/06
- [PATCH 11/19] target/mips: Extract common helpers from helper.c to common_helper.c, Philippe Mathieu-Daudé, 2020/12/06