diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-24 18:03:41 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-24 18:03:41 +0000 |
commit | 0bf46a40a1fe22e35df344af1a8825f3b47a91e0 (patch) | |
tree | 5cefcbe56a2bfa622edf6831f465a9a232e5cf2b | |
parent | 43b968580736ebd564a5d20b8a9a78b72c86fe57 (diff) | |
download | qemu-0bf46a40a1fe22e35df344af1a8825f3b47a91e0.zip qemu-0bf46a40a1fe22e35df344af1a8825f3b47a91e0.tar.gz qemu-0bf46a40a1fe22e35df344af1a8825f3b47a91e0.tar.bz2 |
qemu: introduce qemu_init_vcpu (Marcelo Tosatti)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7242 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | qemu-common.h | 6 | ||||
-rw-r--r-- | target-alpha/translate.c | 1 | ||||
-rw-r--r-- | target-arm/helper.c | 1 | ||||
-rw-r--r-- | target-cris/translate.c | 1 | ||||
-rw-r--r-- | target-i386/helper.c | 5 | ||||
-rw-r--r-- | target-m68k/helper.c | 1 | ||||
-rw-r--r-- | target-mips/translate.c | 1 | ||||
-rw-r--r-- | target-ppc/helper.c | 3 | ||||
-rw-r--r-- | target-sh4/translate.c | 1 | ||||
-rw-r--r-- | target-sparc/helper.c | 1 | ||||
-rw-r--r-- | vl.c | 9 |
11 files changed, 26 insertions, 4 deletions
diff --git a/qemu-common.h b/qemu-common.h index ee963c1..e6a555e 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -189,6 +189,12 @@ void qemu_service_io(void); /* Force QEMU to process pending events */ void qemu_notify_event(void); +#ifdef CONFIG_USER_ONLY +#define qemu_init_vcpu(env) do { } while (0) +#else +void qemu_init_vcpu(void *env); +#endif + typedef struct QEMUIOVector { struct iovec *iov; int niov; diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 00751f5..4cd24d8 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -2505,6 +2505,7 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model) env->ipr[IPR_SISR] = 0; env->ipr[IPR_VIRBND] = -1ULL; + qemu_init_vcpu(env); return env; } diff --git a/target-arm/helper.c b/target-arm/helper.c index 3464142..701629a 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -267,6 +267,7 @@ CPUARMState *cpu_arm_init(const char *cpu_model) gdb_register_coprocessor(env, vfp_gdb_get_reg, vfp_gdb_set_reg, 19, "arm-vfp.xml", 0); } + qemu_init_vcpu(env); return env; } diff --git a/target-cris/translate.c b/target-cris/translate.c index d9256ca..e12be4e 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -3405,6 +3405,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model) cpu_exec_init(env); cpu_reset(env); + qemu_init_vcpu(env); if (tcg_initialized) return env; diff --git a/target-i386/helper.c b/target-i386/helper.c index f107d50..a070e08 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1692,7 +1692,8 @@ CPUX86State *cpu_x86_init(const char *cpu_model) #ifdef CONFIG_KQEMU kqemu_init(env); #endif - if (kvm_enabled()) - kvm_init_vcpu(env); + + qemu_init_vcpu(env); + return env; } diff --git a/target-m68k/helper.c b/target-m68k/helper.c index 493498e..ad28322 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -180,6 +180,7 @@ CPUM68KState *cpu_m68k_init(const char *cpu_model) } cpu_reset(env); + qemu_init_vcpu(env); return env; } diff --git a/target-mips/translate.c b/target-mips/translate.c index e8ecb6e..e96fe60 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -8551,6 +8551,7 @@ CPUMIPSState *cpu_mips_init (const char *cpu_model) env->cpu_model_str = cpu_model; mips_tcg_init(); cpu_reset(env); + qemu_init_vcpu(env); return env; } diff --git a/target-ppc/helper.c b/target-ppc/helper.c index a0d884e..f1663ce 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -2831,8 +2831,7 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model) cpu_ppc_register_internal(env, def); cpu_ppc_reset(env); - if (kvm_enabled()) - kvm_init_vcpu(env); + qemu_init_vcpu(env); return env; } diff --git a/target-sh4/translate.c b/target-sh4/translate.c index aa3b9d4..fc3633a 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -290,6 +290,7 @@ CPUSH4State *cpu_sh4_init(const char *cpu_model) cpu_sh4_reset(env); cpu_sh4_register(env, def); tlb_flush(env, 1); + qemu_init_vcpu(env); return env; } diff --git a/target-sparc/helper.c b/target-sparc/helper.c index b39b162..428f97d 100644 --- a/target-sparc/helper.c +++ b/target-sparc/helper.c @@ -723,6 +723,7 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model) return NULL; } cpu_reset(env); + qemu_init_vcpu(env); return env; } @@ -3731,6 +3731,15 @@ static int qemu_init_main_loop(void) return qemu_event_init(); } +void qemu_init_vcpu(void *_env) +{ + CPUState *env = _env; + + if (kvm_enabled()) + kvm_init_vcpu(env); + return; +} + #ifdef _WIN32 static void host_main_loop_wait(int *timeout) { |