Received: from eggs.gnu.org ([208.118.235.92]:36331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbiV6-0002sB-83 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:24:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbiV4-0008H9-Ch for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:23:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52709 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbiV4-0008Gi-2M for qemu-devel@nongnu.org; Mon, 04 Jun 2012 21:23:58 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 000248738D for ; Tue, 5 Jun 2012 03:23:56 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 5 Jun 2012 03:21:59 +0200 Message-Id: <1338859366-20689-28-git-send-email-afaerber@suse.de> In-Reply-To: <1338859366-20689-1-git-send-email-afaerber@suse.de> References: <1338859366-20689-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 27/74] target-i386: Let cpu_x86_init() return X86CPU 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?= Turn cpu_init macro into a static inline function returning CPUX86State for backwards compatibility. Signed-off-by: Andreas F=C3=A4rber Reviewed-by: Igor Mammedov --- target-i386/cpu.h | 12 ++++++++++-- target-i386/helper.c | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index aeff20b..bcf663e 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -787,7 +787,7 @@ typedef struct CPUX86State { =20 #include "cpu-qom.h" =20 -CPUX86State *cpu_x86_init(const char *cpu_model); +X86CPU *cpu_x86_init(const char *cpu_model); int cpu_x86_exec(CPUX86State *s); void x86_cpu_list (FILE *f, fprintf_function cpu_fprintf, const char *op= targ); void x86_cpudef_setup(void); @@ -960,7 +960,15 @@ uint64_t cpu_get_tsc(CPUX86State *env); #define TARGET_VIRT_ADDR_SPACE_BITS 32 #endif =20 -#define cpu_init cpu_x86_init +static inline CPUX86State *cpu_init(const char *cpu_model) +{ + X86CPU *cpu =3D cpu_x86_init(cpu_model); + if (cpu =3D=3D NULL) { + return NULL; + } + return &cpu->env; +} + #define cpu_exec cpu_x86_exec #define cpu_gen_code cpu_x86_gen_code #define cpu_signal_handler cpu_x86_signal_handler diff --git a/target-i386/helper.c b/target-i386/helper.c index e182025..8df109f 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1157,7 +1157,7 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsig= ned int selector, return 1; } =20 -CPUX86State *cpu_x86_init(const char *cpu_model) +X86CPU *cpu_x86_init(const char *cpu_model) { X86CPU *cpu; CPUX86State *env; @@ -1183,7 +1183,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) =20 x86_cpu_realize(OBJECT(cpu), NULL); =20 - return env; + return cpu; } =20 #if !defined(CONFIG_USER_ONLY) --=20 1.7.7