aboutsummaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2010-02-18 21:25:23 +0100
committerBlue Swirl <blauwirbel@gmail.com>2010-02-18 20:38:35 +0000
commit24ebf5f31a178051cff1a4aab5ba621037191577 (patch)
treecea4158f79e102f29e5719332d6a84ca732645af /cpu-exec.c
parentdf2a54e6987172ad5de725b541e3650834d329bf (diff)
get rid of hostregs_helper.h
Since b567b38 (target-arm: remove T0 and T1, 2009-10-16) the only global register that is used is AREG0, so the complexity of hostregs_helper.h is unused. Use regular assignments and a compiler optimization barrier. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 6a290fd6cd..ab6defca75 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -210,8 +210,7 @@ static void cpu_handle_debug_exception(CPUState *env)
int cpu_exec(CPUState *env1)
{
-#define DECLARE_HOST_REGS 1
-#include "hostregs_helper.h"
+ host_reg_t saved_env_reg;
int ret, interrupt_request;
TranslationBlock *tb;
uint8_t *tc_ptr;
@@ -222,9 +221,12 @@ int cpu_exec(CPUState *env1)
cpu_single_env = env1;
- /* first we save global registers */
-#define SAVE_HOST_REGS 1
-#include "hostregs_helper.h"
+ /* the access to env below is actually saving the global register's
+ value, so that files not including target-xyz/exec.h are free to
+ use it. */
+ QEMU_BUILD_BUG_ON (sizeof (saved_env_reg) != sizeof (env));
+ saved_env_reg = (host_reg_t) env;
+ asm("");
env = env1;
#if defined(TARGET_I386)
@@ -669,7 +671,8 @@ int cpu_exec(CPUState *env1)
#endif
/* restore global registers */
-#include "hostregs_helper.h"
+ asm("");
+ env = (void *) saved_env_reg;
/* fail safe : never use cpu_single_env outside cpu_exec() */
cpu_single_env = NULL;