aboutsummaryrefslogtreecommitdiff
path: root/dyngen-exec.h
diff options
context:
space:
mode:
Diffstat (limited to 'dyngen-exec.h')
-rw-r--r--dyngen-exec.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/dyngen-exec.h b/dyngen-exec.h
index fbde29ea01..3544372a65 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -19,7 +19,12 @@
#if !defined(__DYNGEN_EXEC_H__)
#define __DYNGEN_EXEC_H__
-#if defined(__i386__)
+#if defined(CONFIG_TCG_INTERPRETER)
+/* The TCG interpreter does not need a special register AREG0,
+ * but it is possible to use one by defining AREG0.
+ * On i386, register edi seems to work. */
+/* Run without special register AREG0 or use a value defined elsewhere. */
+#elif defined(__i386__)
#define AREG0 "ebp"
#elif defined(__x86_64__)
#define AREG0 "r14"
@@ -55,6 +60,11 @@
#error unsupported CPU
#endif
+#if defined(AREG0)
register CPUState *env asm(AREG0);
+#else
+/* TODO: Try env = cpu_single_env. */
+extern CPUState *env;
+#endif
#endif /* !defined(__DYNGEN_EXEC_H__) */