From 24ebf5f31a178051cff1a4aab5ba621037191577 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 18 Feb 2010 21:25:23 +0100 Subject: 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 Signed-off-by: Blue Swirl --- cpu-exec.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'cpu-exec.c') diff --git a/cpu-exec.c b/cpu-exec.c index 6a290fd..ab6defc 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; -- cgit v1.1