diff options
| author | Richard Henderson | 2019-03-28 22:26:22 +0100 |
|---|---|---|
| committer | Richard Henderson | 2019-06-10 16:03:42 +0200 |
| commit | 7506ed902eb97fe4e2a1dd16766c621d32ecc40d (patch) | |
| tree | fcbd11f0a3306da8767ec90b41ccf016e9339bab /target/s390x | |
| parent | cpu: Move ENV_OFFSET to exec/gen-icount.h (diff) | |
| download | qemu-7506ed902eb97fe4e2a1dd16766c621d32ecc40d.tar.gz qemu-7506ed902eb97fe4e2a1dd16766c621d32ecc40d.tar.xz qemu-7506ed902eb97fe4e2a1dd16766c621d32ecc40d.zip | |
cpu: Introduce cpu_set_cpustate_pointers
Consolidate some boilerplate from foo_cpu_initfn.
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/s390x')
| -rw-r--r-- | target/s390x/cpu.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 6af1a1530f..4ca66fed1a 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -285,17 +285,18 @@ static void s390_cpu_initfn(Object *obj) { CPUState *cs = CPU(obj); S390CPU *cpu = S390_CPU(obj); - CPUS390XState *env = &cpu->env; - cs->env_ptr = env; + cpu_set_cpustate_pointers(cpu); cs->halted = 1; cs->exception_index = EXCP_HLT; object_property_add(obj, "crash-information", "GuestPanicInformation", s390_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL); s390_cpu_model_register_props(obj); #if !defined(CONFIG_USER_ONLY) - env->tod_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); - env->cpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu); + cpu->env.tod_timer = + timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu); + cpu->env.cpu_timer = + timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu); s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); #endif } |
