aboutsummaryrefslogtreecommitdiff
path: root/target/nios2
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-03-28 11:26:22 -1000
committerRichard Henderson <richard.henderson@linaro.org>2019-06-10 07:03:42 -0700
commit7506ed902eb97fe4e2a1dd16766c621d32ecc40d (patch)
treefcbd11f0a3306da8767ec90b41ccf016e9339bab /target/nios2
parent677c4d69ac21961e76a386f9bfc892a44923acc0 (diff)
downloadqemu-7506ed902eb97fe4e2a1dd16766c621d32ecc40d.zip
qemu-7506ed902eb97fe4e2a1dd16766c621d32ecc40d.tar.gz
qemu-7506ed902eb97fe4e2a1dd16766c621d32ecc40d.tar.bz2
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/nios2')
-rw-r--r--target/nios2/cpu.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
index 186af49..b00223e 100644
--- a/target/nios2/cpu.c
+++ b/target/nios2/cpu.c
@@ -66,14 +66,12 @@ static void nios2_cpu_reset(CPUState *cs)
static void nios2_cpu_initfn(Object *obj)
{
- CPUState *cs = CPU(obj);
Nios2CPU *cpu = NIOS2_CPU(obj);
- CPUNios2State *env = &cpu->env;
- cs->env_ptr = env;
+ cpu_set_cpustate_pointers(cpu);
#if !defined(CONFIG_USER_ONLY)
- mmu_init(env);
+ mmu_init(&cpu->env);
#endif
}