From 7506ed902eb97fe4e2a1dd16766c621d32ecc40d Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 28 Mar 2019 11:26:22 -1000 Subject: cpu: Introduce cpu_set_cpustate_pointers Consolidate some boilerplate from foo_cpu_initfn. Reviewed-by: Alistair Francis Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/m68k/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'target/m68k') diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index b16957934a..ea38cb46e9 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -238,11 +238,9 @@ static void m68k_cpu_realizefn(DeviceState *dev, Error **errp) static void m68k_cpu_initfn(Object *obj) { - CPUState *cs = CPU(obj); M68kCPU *cpu = M68K_CPU(obj); - CPUM68KState *env = &cpu->env; - cs->env_ptr = env; + cpu_set_cpustate_pointers(cpu); } static const VMStateDescription vmstate_m68k_cpu = { -- cgit v1.2.3