mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
cpu: Add CPUArchState pointer to CPUState
The target-specific ENV_GET_CPU() macros have allowed us to navigate from CPUArchState to CPUState. The reverse direction was not supported. Avoid introducing CPU_GET_ENV() macros by initializing an untyped pointer that is initialized in derived instance_init functions. The field may not be called "env" due to it being poisoned. Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
907a5e32f2
commit
c05efcb18e
16 changed files with 31 additions and 0 deletions
|
@ -10529,11 +10529,13 @@ static void ppc_cpu_reset(CPUState *s)
|
|||
|
||||
static void ppc_cpu_initfn(Object *obj)
|
||||
{
|
||||
CPUState *cs = CPU(obj);
|
||||
PowerPCCPU *cpu = POWERPC_CPU(obj);
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
ppc_def_t *def = pcc->info;
|
||||
|
||||
cs->env_ptr = env;
|
||||
cpu_exec_init(env);
|
||||
|
||||
env->msr_mask = def->msr_mask;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue