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 /include/exec | |
| 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 'include/exec')
| -rw-r--r-- | include/exec/cpu-all.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index c62f07b354..71154070a7 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -372,6 +372,17 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, int cpu_exec(CPUState *cpu); /** + * cpu_set_cpustate_pointers(cpu) + * @cpu: The cpu object + * + * Set the generic pointers in CPUState into the outer object. + */ +static inline void cpu_set_cpustate_pointers(ArchCPU *cpu) +{ + cpu->parent_obj.env_ptr = &cpu->env; +} + +/** * env_archcpu(env) * @env: The architecture environment * |
