diff options
author | Andreas Färber <afaerber@suse.de> | 2013-02-22 18:10:01 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2013-03-03 14:28:28 +0000 |
commit | fadf982584b040527aeee0ede270a4d01463d293 (patch) | |
tree | de8d94b847354eced90a266fa7dc3164ad897fde /target-ppc/cpu-qom.h | |
parent | 0980011b4f66482d2733ab2dd0f2f61747772c6b (diff) | |
download | qemu-fadf982584b040527aeee0ede270a4d01463d293.zip qemu-fadf982584b040527aeee0ede270a4d01463d293.tar.gz qemu-fadf982584b040527aeee0ede270a4d01463d293.tar.bz2 |
cpu: Introduce ENV_OFFSET macros
Introduce ENV_OFFSET macros which can be used in non-target-specific
code that needs to generate TCG instructions which reference CPUState
fields given the cpu_env register that TCG targets set up with a
pointer to the CPUArchState struct.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-ppc/cpu-qom.h')
-rw-r--r-- | target-ppc/cpu-qom.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/target-ppc/cpu-qom.h b/target-ppc/cpu-qom.h index 2b82cdb..4e8ceca 100644 --- a/target-ppc/cpu-qom.h +++ b/target-ppc/cpu-qom.h @@ -78,7 +78,8 @@ static inline PowerPCCPU *ppc_env_get_cpu(CPUPPCState *env) #define ENV_GET_CPU(e) CPU(ppc_env_get_cpu(e)) -PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr); +#define ENV_OFFSET offsetof(PowerPCCPU, env) +PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr); #endif |