From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KszDN-0006vM-3o for qemu-devel@nongnu.org; Thu, 23 Oct 2008 08:22:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KszDL-0006uQ-2y for qemu-devel@nongnu.org; Thu, 23 Oct 2008 08:22:56 -0400 Received: from [199.232.76.173] (port=51691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KszDK-0006uC-KI for qemu-devel@nongnu.org; Thu, 23 Oct 2008 08:22:54 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54620) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KszDI-0006B8-FD for qemu-devel@nongnu.org; Thu, 23 Oct 2008 08:22:54 -0400 From: Glauber Costa Date: Thu, 23 Oct 2008 12:18:52 -0200 Message-Id: <1224771556-11146-9-git-send-email-glommer@redhat.com> In-Reply-To: <1224771556-11146-1-git-send-email-glommer@redhat.com> References: <1224771556-11146-1-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 08/32] init env made accel driver 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: aliguori@us.ibm.com, jan.kiszka@siemens.com, jes@sgi.com, avi@qumranet.com, Glauber Costa , dmitry.baryshkov@siemens.com From: Glauber Costa Yet another accel field: init_env Signed-off-by: Glauber Costa --- accel.c | 1 + accel.h | 7 +++++++ kqemu.c | 3 ++- target-i386/helper.c | 6 +++--- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/accel.c b/accel.c index d30460d..3a17dc5 100644 --- a/accel.c +++ b/accel.c @@ -13,5 +13,6 @@ int _accel_nop(void) /* Accelerator wrapper for the no-accel (raw qemu) case */ QEMUAccel noaccel = { .cpu_interrupt = accel_nop, + .init_env = accel_nop, }; diff --git a/accel.h b/accel.h index 8e5ddc6..0d916dc 100644 --- a/accel.h +++ b/accel.h @@ -3,6 +3,7 @@ typedef struct QEMUAccel { void (*cpu_interrupt)(CPUState *env); + void (*init_env)(CPUState *env); } QEMUAccel; extern QEMUAccel *current_accel; @@ -17,4 +18,10 @@ static inline void accel_cpu_interrupt(CPUState *env) { current_accel->cpu_interrupt(env); } + +static inline void accel_init_env(CPUState *env) +{ + current_accel->init_env(env); +} + #endif diff --git a/kqemu.c b/kqemu.c index dc989a3..8c228f4 100644 --- a/kqemu.c +++ b/kqemu.c @@ -242,7 +242,7 @@ int kqemu_start(void) return 0; } -void kqemu_init_env(CPUState *env) +static void kqemu_init_env(CPUState *env) { kqemu_update_cpuid(env); env->kqemu_enabled = kqemu_allowed; @@ -1049,6 +1049,7 @@ static void qpi_init(void) QEMUAccel kqemu_accel = { .cpu_interrupt = kqemu_cpu_interrupt, + .init_env = kqemu_init_env, }; #endif diff --git a/target-i386/helper.c b/target-i386/helper.c index b36e391..b981b92 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -30,6 +30,8 @@ #include "svm.h" #include "qemu-common.h" +#include "accel.h" + //#define DEBUG_MMU static int cpu_x86_register (CPUX86State *env, const char *cpu_model); @@ -112,9 +114,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) return NULL; } cpu_reset(env); -#ifdef USE_KQEMU - kqemu_init_env(env); -#endif + accel_init_env(env); return env; } -- 1.5.5.1