Received: from eggs.gnu.org ([208.118.235.92]:34330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThVsd-0004BO-Jq for qemu-devel@nongnu.org; Sat, 08 Dec 2012 20:40:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ThVsa-0003XK-PO for qemu-devel@nongnu.org; Sat, 08 Dec 2012 20:40:31 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55565 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThVsa-0003X9-Fl for qemu-devel@nongnu.org; Sat, 08 Dec 2012 20:40:28 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 9 Dec 2012 02:40:12 +0100 Message-Id: <1355017216-22962-2-git-send-email-afaerber@suse.de> In-Reply-To: <1355017216-22962-1-git-send-email-afaerber@suse.de> References: <1355017216-22962-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] [FYI qom-cpu v2 1/5] 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 Acked-by: Richard Henderson --- 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 34221fb..853ea8e 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_exec cpu_alpha_exec #define cpu_gen_code cpu_alpha_gen_code #define cpu_signal_handler cpu_alpha_signal_handler @@ -434,7 +433,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; +} + int cpu_alpha_exec(CPUAlphaState *s); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 4045f78..638a4a2 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -3517,7 +3517,7 @@ static const struct cpu_def_t cpu_defs[] =3D { | AMASK_MVI | AMASK_TRAP | AMASK_PREFETCH), } }; =20 -CPUAlphaState * cpu_alpha_init (const char *cpu_model) +AlphaCPU *cpu_alpha_init(const char *cpu_model) { AlphaCPU *cpu; CPUAlphaState *env; @@ -3546,7 +3546,7 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_mod= el) 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