summaryrefslogtreecommitdiffstats
path: root/target-openrisc
diff options
context:
space:
mode:
authorAndreas Färber2013-02-22 19:10:01 +0100
committerBlue Swirl2013-03-03 15:28:28 +0100
commitfadf982584b040527aeee0ede270a4d01463d293 (patch)
treede8d94b847354eced90a266fa7dc3164ad897fde /target-openrisc
parenttcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses (diff)
downloadqemu-fadf982584b040527aeee0ede270a4d01463d293.tar.gz
qemu-fadf982584b040527aeee0ede270a4d01463d293.tar.xz
qemu-fadf982584b040527aeee0ede270a4d01463d293.zip
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-openrisc')
-rw-r--r--target-openrisc/cpu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h
index 419f007991..4cfd1c74fb 100644
--- a/target-openrisc/cpu.h
+++ b/target-openrisc/cpu.h
@@ -340,6 +340,8 @@ static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpenRISCState *env)
#define ENV_GET_CPU(e) CPU(openrisc_env_get_cpu(e))
+#define ENV_OFFSET offsetof(OpenRISCCPU, env)
+
OpenRISCCPU *cpu_openrisc_init(const char *cpu_model);
void cpu_openrisc_list(FILE *f, fprintf_function cpu_fprintf);