mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 20:33:54 -06:00
cpu: Replace ENV_GET_CPU with env_cpu
Now that we have both ArchCPU and CPUArchState, we can define this generically instead of via macro in each target's cpu.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2161a612b4
commit
29a0af618d
59 changed files with 175 additions and 197 deletions
|
@ -371,4 +371,16 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
|||
|
||||
int cpu_exec(CPUState *cpu);
|
||||
|
||||
/**
|
||||
* env_cpu(env)
|
||||
* @env: The architecture environment
|
||||
*
|
||||
* Return the CPUState associated with the environment.
|
||||
*/
|
||||
static inline CPUState *env_cpu(CPUArchState *env)
|
||||
{
|
||||
ArchCPU *arch_cpu = container_of(env, ArchCPU, env);
|
||||
return &arch_cpu->parent_obj;
|
||||
}
|
||||
|
||||
#endif /* CPU_ALL_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue