From c05efcb18ee30cdf2b00b3512aa0f5233b52911f Mon Sep 17 00:00:00 2001 From: Andreas Färber Date: Thu, 17 Jan 2013 12:13:41 +0100 Subject: 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 Signed-off-by: Andreas Färber --- target-alpha/cpu.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'target-alpha') diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c index 0cdae6986f..cec9989925 100644 --- a/target-alpha/cpu.c +++ b/target-alpha/cpu.c @@ -233,9 +233,11 @@ static const TypeInfo ev68_cpu_type_info = { static void alpha_cpu_initfn(Object *obj) { + CPUState *cs = CPU(obj); AlphaCPU *cpu = ALPHA_CPU(obj); CPUAlphaState *env = &cpu->env; + cs->env_ptr = env; cpu_exec_init(env); tlb_flush(env, 1); -- cgit v1.2.3-55-g7522