From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Igor Mammedov <imammedo@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Aurelien Jarno <aurelien@aurel32.net>,
Yongbok Kim <yongbok.kim@imgtec.com>,
Marcel Apfelbaum <marcel@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, "Hervé Poussineau" <hpoussin@reactos.org>,
"James Hogan" <james.hogan@imgtec.com>,
"Thomas Huth" <thuth@redhat.com>
Subject: [Qemu-devel] [PATCH v3 3/6] mips: split cpu_mips_realize_env() out of cpu_mips_init()
Date: Sun, 17 Sep 2017 20:20:07 -0300 [thread overview]
Message-ID: <20170917232010.14183-4-f4bug@amsat.org> (raw)
In-Reply-To: <20170917232010.14183-1-f4bug@amsat.org>
so it can be used in mips_cpu_realizefn() in the next commit
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
---
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 91c2df4537..cf4c9db427 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 f0febaf1b2..5fc7979ac5 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.14.1
next prev parent reply other threads:[~2017-09-17 23:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-17 23:20 [Qemu-devel] [PATCH v3 0/6] QOMify MIPS cpu Philippe Mathieu-Daudé
2017-09-17 23:20 ` [Qemu-devel] [PATCH v3 1/6] mips: move hw/mips/cputimer.c to target/mips/ Philippe Mathieu-Daudé
2017-09-17 23:20 ` [Qemu-devel] [PATCH v3 2/6] mips: introduce internal.h and cleanup cpu.h Philippe Mathieu-Daudé
2017-09-17 23:20 ` Philippe Mathieu-Daudé [this message]
2017-09-17 23:20 ` [Qemu-devel] [PATCH v3 4/6] mips: call cpu_mips_realize_env() from mips_cpu_realizefn() Philippe Mathieu-Daudé
2017-09-17 23:20 ` [Qemu-devel] [PATCH v3 5/6] mips: MIPSCPU model subclasses Philippe Mathieu-Daudé
2017-09-17 23:20 ` [Qemu-devel] [PATCH v3 6/6] mips: replace cpu_mips_init() with cpu_generic_init() Philippe Mathieu-Daudé
2017-09-20 9:21 ` Igor Mammedov
2017-09-20 11:38 ` Philippe Mathieu-Daudé
2017-09-17 23:43 ` [Qemu-devel] [PATCH v3 0/6] QOMify MIPS cpu no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170917232010.14183-4-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=aurelien@aurel32.net \
--cc=ehabkost@redhat.com \
--cc=hpoussin@reactos.org \
--cc=imammedo@redhat.com \
--cc=james.hogan@imgtec.com \
--cc=marcel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=yongbok.kim@imgtec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).