[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/7] mips: split cpu_mips_realize_env() out of cpu_mi
From: |
Yongbok Kim |
Subject: |
[Qemu-devel] [PULL 3/7] mips: split cpu_mips_realize_env() out of cpu_mips_init() |
Date: |
Thu, 21 Sep 2017 14:38:07 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
so it can be used in mips_cpu_realizefn() in the next commit
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Igor Mammedov <address@hidden>
Tested-by: James Hogan <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Yongbok Kim <address@hidden>
---
target/mips/internal.h | 1 +
target/mips/translate.c | 19 ++++++++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/target/mips/internal.h b/target/mips/internal.h
index 91c2df4..cf4c9db 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -132,6 +132,7 @@ void mips_tcg_init(void);
/* TODO QOM'ify CPU reset and remove */
void cpu_state_reset(CPUMIPSState *s);
+void cpu_mips_realize_env(CPUMIPSState *env);
/* cp0_timer.c */
uint32_t cpu_mips_get_random(CPUMIPSState *env);
diff --git a/target/mips/translate.c b/target/mips/translate.c
index f0febaf..5fc7979 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -20512,6 +20512,17 @@ void mips_tcg_init(void)
#include "translate_init.c"
+void cpu_mips_realize_env(CPUMIPSState *env)
+{
+ env->exception_base = (int32_t)0xBFC00000;
+
+#ifndef CONFIG_USER_ONLY
+ mmu_init(env, env->cpu_model);
+#endif
+ fpu_init(env, env->cpu_model);
+ mvp_init(env, env->cpu_model);
+}
+
MIPSCPU *cpu_mips_init(const char *cpu_model)
{
MIPSCPU *cpu;
@@ -20524,13 +20535,7 @@ MIPSCPU *cpu_mips_init(const char *cpu_model)
cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU));
env = &cpu->env;
env->cpu_model = def;
- env->exception_base = (int32_t)0xBFC00000;
-
-#ifndef CONFIG_USER_ONLY
- mmu_init(env, def);
-#endif
- fpu_init(env, def);
- mvp_init(env, def);
+ cpu_mips_realize_env(env);
object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
--
2.7.4
- [Qemu-devel] [PULL 0/7] target-mips queue, Yongbok Kim, 2017/09/21
- [Qemu-devel] [PULL 5/7] mips: MIPSCPU model subclasses, Yongbok Kim, 2017/09/21
- [Qemu-devel] [PULL 2/7] mips: introduce internal.h and cleanup cpu.h, Yongbok Kim, 2017/09/21
- [Qemu-devel] [PULL 6/7] mips: replace cpu_mips_init() with cpu_generic_init(), Yongbok Kim, 2017/09/21
- [Qemu-devel] [PULL 3/7] mips: split cpu_mips_realize_env() out of cpu_mips_init(),
Yongbok Kim <=
- [Qemu-devel] [PULL 7/7] mips: Improve macro parenthesization, Yongbok Kim, 2017/09/21
- [Qemu-devel] [PULL 4/7] mips: call cpu_mips_realize_env() from mips_cpu_realizefn(), Yongbok Kim, 2017/09/21
- [Qemu-devel] [PULL 1/7] mips: move hw/mips/cputimer.c to target/mips/, Yongbok Kim, 2017/09/21
- Re: [Qemu-devel] [PULL 0/7] target-mips queue, no-reply, 2017/09/21
- Re: [Qemu-devel] [PULL 0/7] target-mips queue, Peter Maydell, 2017/09/21