diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2019-03-28 11:26:22 -1000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2019-06-10 07:03:42 -0700 |
commit | 7506ed902eb97fe4e2a1dd16766c621d32ecc40d (patch) | |
tree | fcbd11f0a3306da8767ec90b41ccf016e9339bab /target/nios2 | |
parent | 677c4d69ac21961e76a386f9bfc892a44923acc0 (diff) |
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.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 186af4913d..b00223e0c7 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 } |