mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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>
This commit is contained in:
@@ -371,6 +371,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
|
||||
|
||||
Reference in New Issue
Block a user