diff options
author | Andreas Färber <afaerber@suse.de> | 2012-04-02 13:56:29 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-04-04 17:35:31 +0200 |
commit | 8f22e0df803697c11e8b10c90cc2e67df6e42884 (patch) | |
tree | 184b596095a127af1b6934bcfd4a63d4d8056c8c /target-s390x/helper.c | |
parent | 1ac1a7499bcb44174735780e0bd0421a1ac7a323 (diff) |
target-s390x: QOM'ify CPU init
Move code from cpu_s390x_init() into an initfn.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x/helper.c')
-rw-r--r-- | target-s390x/helper.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/target-s390x/helper.c b/target-s390x/helper.c index cd3e8f5b46..6233f9ac3e 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -51,7 +51,7 @@ #endif #ifndef CONFIG_USER_ONLY -static void s390x_tod_timer(void *opaque) +void s390x_tod_timer(void *opaque) { CPUS390XState *env = opaque; @@ -59,7 +59,7 @@ static void s390x_tod_timer(void *opaque) cpu_interrupt(env, CPU_INTERRUPT_HARD); } -static void s390x_cpu_timer(void *opaque) +void s390x_cpu_timer(void *opaque) { CPUS390XState *env = opaque; @@ -72,32 +72,17 @@ CPUS390XState *cpu_s390x_init(const char *cpu_model) { S390CPU *cpu; CPUS390XState *env; -#if !defined (CONFIG_USER_ONLY) - struct tm tm; -#endif static int inited = 0; - static int cpu_num = 0; cpu = S390_CPU(object_new(TYPE_S390_CPU)); env = &cpu->env; - cpu_exec_init(env); + if (tcg_enabled() && !inited) { inited = 1; s390x_translate_init(); } -#if !defined(CONFIG_USER_ONLY) - qemu_get_timedate(&tm, 0); - env->tod_offset = TOD_UNIX_EPOCH + - (time2tod(mktimegm(&tm)) * 1000000000ULL); - env->tod_basetime = 0; - env->tod_timer = qemu_new_timer_ns(vm_clock, s390x_tod_timer, env); - env->cpu_timer = qemu_new_timer_ns(vm_clock, s390x_cpu_timer, env); -#endif env->cpu_model_str = cpu_model; - env->cpu_num = cpu_num++; - env->ext_index = -1; - cpu_reset(CPU(cpu)); qemu_init_vcpu(env); return env; } |