Received: from eggs.gnu.org ([208.118.235.92]:59034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTObI-00082m-E9 for qemu-devel@nongnu.org; Tue, 30 Oct 2012 23:04:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTObH-0004Np-Dp for qemu-devel@nongnu.org; Tue, 30 Oct 2012 23:04:16 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55005 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTObH-0004Ne-2y for qemu-devel@nongnu.org; Tue, 30 Oct 2012 23:04:15 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 31 Oct 2012 04:04:01 +0100 Message-Id: <1351652644-18687-5-git-send-email-afaerber@suse.de> In-Reply-To: <1351652644-18687-1-git-send-email-afaerber@suse.de> References: <1351652644-18687-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 4/7] target-alpha: Let cpu_alpha_init() return AlphaCPU 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?= , rth@twiddle.net Replace cpu_init() macro with inline function for backwards compatibility. Signed-off-by: Andreas F=C3=A4rber --- target-alpha/cpu.h | 13 +++++++++++-- target-alpha/translate.c | 4 ++-- 2 Dateien ge=C3=A4ndert, 13 Zeilen hinzugef=C3=BCgt(+), 4 Zeilen entfern= t(-) diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index 28999ab..2bbde9c 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -297,7 +297,6 @@ struct CPUAlphaState { int implver; }; =20 -#define cpu_init cpu_alpha_init #define cpu_list alpha_cpu_list #define cpu_exec cpu_alpha_exec #define cpu_gen_code cpu_alpha_gen_code @@ -435,7 +434,17 @@ enum { IR_ZERO =3D 31, }; =20 -CPUAlphaState *cpu_alpha_init(const char *cpu_model); +AlphaCPU *cpu_alpha_init(const char *cpu_model); + +static inline CPUAlphaState *cpu_init(const char *cpu_model) +{ + AlphaCPU *cpu =3D cpu_alpha_init(cpu_model); + if (cpu =3D=3D NULL) { + return NULL; + } + return &cpu->env; +} + void alpha_cpu_list(FILE *f, fprintf_function cpu_fprintf); int cpu_alpha_exec(CPUAlphaState *s); /* you can call this signal handler from your SIGBUS and SIGSEGV diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 6ee031d..5419df1 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -3493,7 +3493,7 @@ void gen_intermediate_code_pc (CPUAlphaState *env, = struct TranslationBlock *tb) gen_intermediate_code_internal(env, tb, 1); } =20 -CPUAlphaState *cpu_alpha_init(const char *cpu_model) +AlphaCPU *cpu_alpha_init(const char *cpu_model) { AlphaCPU *cpu; CPUAlphaState *env; @@ -3511,7 +3511,7 @@ CPUAlphaState *cpu_alpha_init(const char *cpu_model= ) env->cpu_model_str =3D cpu_model; =20 qemu_init_vcpu(env); - return env; + return cpu; } =20 void restore_state_to_opc(CPUAlphaState *env, TranslationBlock *tb, int = pc_pos) --=20 1.7.10.4