Received: from eggs.gnu.org ([208.118.235.92]:49776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwpFa-00074z-OK for qemu-devel@nongnu.org; Sun, 20 Jan 2013 02:23:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwpFZ-0006fv-Pc for qemu-devel@nongnu.org; Sun, 20 Jan 2013 02:23:30 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45284 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwpFZ-0006fo-JT for qemu-devel@nongnu.org; Sun, 20 Jan 2013 02:23:29 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 20 Jan 2013 08:22:48 +0100 Message-Id: <1358666571-1737-26-git-send-email-afaerber@suse.de> In-Reply-To: <1358666571-1737-1-git-send-email-afaerber@suse.de> References: <1358666571-1737-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC qom-cpu v2 25/28] target-sh4: Move TCG initialization to SuperHCPU initfn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Add a tcg_enabled() check to suppress it for qtest. Signed-off-by: Andreas F=C3=A4rber --- target-sh4/cpu.c | 4 ++++ target-sh4/cpu.h | 1 + target-sh4/translate.c | 3 +-- 3 Dateien ge=C3=A4ndert, 6 Zeilen hinzugef=C3=BCgt(+), 2 Zeilen entfernt= (-) diff --git a/target-sh4/cpu.c b/target-sh4/cpu.c index 839696c..223008a 100644 --- a/target-sh4/cpu.c +++ b/target-sh4/cpu.c @@ -72,6 +72,10 @@ static void superh_cpu_initfn(Object *obj) cpu_exec_init(env); =20 env->movcal_backup_tail =3D &(env->movcal_backup); + + if (tcg_enabled()) { + sh4_translate_init(); + } } =20 static void superh_cpu_class_init(ObjectClass *oc, void *data) diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index 34e9b0a..49dcd9e 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -191,6 +191,7 @@ typedef struct CPUSH4State { =20 #include "cpu-qom.h" =20 +void sh4_translate_init(void); SuperHCPU *cpu_sh4_init(const char *cpu_model); int cpu_sh4_exec(CPUSH4State * s); int cpu_sh4_signal_handler(int host_signum, void *pinfo, diff --git a/target-sh4/translate.c b/target-sh4/translate.c index 2409a10..c58d79a 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -71,7 +71,7 @@ static uint32_t gen_opc_hflags[OPC_BUF_SIZE]; =20 #include "exec/gen-icount.h" =20 -static void sh4_translate_init(void) +void sh4_translate_init(void) { int i; static int done_init =3D 0; @@ -251,7 +251,6 @@ SuperHCPU *cpu_sh4_init(const char *cpu_model) cpu =3D SUPERH_CPU(object_new(TYPE_SUPERH_CPU)); env =3D &cpu->env; env->features =3D def->features; - sh4_translate_init(); env->cpu_model_str =3D cpu_model; cpu_register(env, def); =20 --=20 1.7.10.4