summaryrefslogtreecommitdiffstats
path: root/target/unicore32/cpu.c
diff options
context:
space:
mode:
authorRichard Henderson2019-03-28 22:26:22 +0100
committerRichard Henderson2019-06-10 16:03:42 +0200
commit7506ed902eb97fe4e2a1dd16766c621d32ecc40d (patch)
treefcbd11f0a3306da8767ec90b41ccf016e9339bab /target/unicore32/cpu.c
parentcpu: Move ENV_OFFSET to exec/gen-icount.h (diff)
downloadqemu-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/unicore32/cpu.c')
-rw-r--r--target/unicore32/cpu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c
index 3f57c508a0..451082bbe6 100644
--- a/target/unicore32/cpu.c
+++ b/target/unicore32/cpu.c
@@ -103,11 +103,10 @@ static void uc32_cpu_realizefn(DeviceState *dev, Error **errp)
static void uc32_cpu_initfn(Object *obj)
{
- CPUState *cs = CPU(obj);
UniCore32CPU *cpu = UNICORE32_CPU(obj);
CPUUniCore32State *env = &cpu->env;
- cs->env_ptr = env;
+ cpu_set_cpustate_pointers(cpu);
#ifdef CONFIG_USER_ONLY
env->uncached_asr = ASR_MODE_USER;