From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHfx9-0002Qr-MN for qemu-devel@nongnu.org; Tue, 30 Dec 2008 09:52:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHfx8-0002QF-7d for qemu-devel@nongnu.org; Tue, 30 Dec 2008 09:52:14 -0500 Received: from [199.232.76.173] (port=36166 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHfx7-0002Py-0G for qemu-devel@nongnu.org; Tue, 30 Dec 2008 09:52:13 -0500 Received: from mx2.redhat.com ([66.187.237.31]:45584) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LHfx6-0004ye-E1 for qemu-devel@nongnu.org; Tue, 30 Dec 2008 09:52:12 -0500 From: Glauber Costa Date: Tue, 30 Dec 2008 09:52:05 -0500 Message-Id: <1230648726-17163-2-git-send-email-glommer@redhat.com> In-Reply-To: <1230648726-17163-1-git-send-email-glommer@redhat.com> References: <1230648726-17163-1-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] simplify cpu_x86_register Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ian.Jackson@eu.citrix.com, avi@redhat.com, kvm@vger.kernel.org, stefano.stabellini@eu.citrix.com We don't need to pass the model string by parameter, since it ough to be part of the CPUState anyway at the call time. Also, don't declare it as static, so kvm can call it in the future. Signed-off-by: Glauber Costa --- target-i386/cpu.h | 2 ++ target-i386/helper.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index ce9b3fe..5235919 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -643,6 +643,8 @@ typedef struct CPUX86State { } CPUX86State; CPUX86State *cpu_x86_init(const char *cpu_model); +int cpu_x86_register (CPUX86State *env); + int cpu_x86_exec(CPUX86State *s); void cpu_x86_close(CPUX86State *s); void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, diff --git a/target-i386/helper.c b/target-i386/helper.c index 7d3321a..1389a0a 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -368,9 +368,10 @@ void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)) (*cpu_fprintf)(f, "x86 %16s\n", x86_defs[i].name); } -static int cpu_x86_register (CPUX86State *env, const char *cpu_model) +int cpu_x86_register (CPUX86State *env) { x86_def_t def1, *def = &def1; + const char *cpu_model = env->cpu_model_str; if (cpu_x86_find_by_name(def, cpu_model) < 0) return -1; @@ -1626,7 +1627,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) cpu_set_debug_excp_handler(breakpoint_handler); #endif } - if (cpu_x86_register(env, cpu_model) < 0) { + if (cpu_x86_register(env) < 0) { cpu_x86_close(env); return NULL; } -- 1.5.6.5