From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH2M-0001BH-7k for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSH2J-0005a6-Sk for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35581 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSH2J-0005ZC-Jq for qemu-devel@nongnu.org; Wed, 09 May 2012 20:15:15 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 10 May 2012 02:14:16 +0200 Message-Id: <1336608892-30501-39-git-send-email-afaerber@suse.de> In-Reply-To: <1336608892-30501-1-git-send-email-afaerber@suse.de> References: <1336608892-30501-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] [PATCH next v2 38/74] target-sh4: Let cpu_sh4_init() return SuperHCPU 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 Turn cpu_init macro into a static inline function returning CPUSH4State for backwards compatibility. Signed-off-by: Andreas F=C3=A4rber --- target-sh4/cpu.h | 12 ++++++++++-- target-sh4/translate.c | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index b6768f1..bf59222 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -191,7 +191,7 @@ typedef struct CPUSH4State { =20 #include "cpu-qom.h" =20 -CPUSH4State *cpu_sh4_init(const char *cpu_model); +SuperHCPU *cpu_sh4_init(const char *cpu_model); int cpu_sh4_exec(CPUSH4State * s); int cpu_sh4_signal_handler(int host_signum, void *pinfo, void *puc); @@ -232,7 +232,15 @@ void cpu_load_tlb(CPUSH4State * env); =20 #include "softfloat.h" =20 -#define cpu_init cpu_sh4_init +static inline CPUSH4State *cpu_init(const char *cpu_model) +{ + SuperHCPU *cpu =3D cpu_sh4_init(cpu_model); + if (cpu =3D=3D NULL) { + return NULL; + } + return &cpu->env; +} + #define cpu_exec cpu_sh4_exec #define cpu_gen_code cpu_sh4_gen_code #define cpu_signal_handler cpu_sh4_signal_handler diff --git a/target-sh4/translate.c b/target-sh4/translate.c index d25f0c5..7d35b84 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -247,7 +247,7 @@ static void cpu_register(CPUSH4State *env, const sh4_= def_t *def) env->id =3D def->id; } =20 -CPUSH4State *cpu_sh4_init(const char *cpu_model) +SuperHCPU *cpu_sh4_init(const char *cpu_model) { SuperHCPU *cpu; CPUSH4State *env; @@ -264,7 +264,7 @@ CPUSH4State *cpu_sh4_init(const char *cpu_model) cpu_reset(CPU(cpu)); cpu_register(env, def); qemu_init_vcpu(env); - return env; + return cpu; } =20 static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest) --=20 1.7.7