From 3e4571724fb92c77de81d8b54957de8232be6706 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Wed, 13 Jul 2011 12:44:15 +0000 Subject: exec.h cleanup Move softmmu_exec.h include directives from target-*/exec.h to target-*/op_helper.c. Move also various other stuff only used in op_helper.c there. Define global env in dyngen-exec.h. For i386, move wrappers for segment and FPU helpers from user-exec.c to op_helper.c. Implement raise_exception_err_env() to handle dynamic CPUState. Move the function declarations to cpu.h since they can be used outside of op_helper.c context. LM32, s390x, UniCore32: remove unused cpu_halted(), regs_to_env() and env_to_regs(). ARM: make raise_exception() static. Convert #include "exec.h" to #include "cpu.h" #include "dyngen-exec.h" and remove now unused target-*/exec.h. Signed-off-by: Blue Swirl --- user-exec.c | 49 +++---------------------------------------------- 1 file changed, 3 insertions(+), 46 deletions(-) (limited to 'user-exec.c') diff --git a/user-exec.c b/user-exec.c index 02c2f8ba43..14c0f251b4 100644 --- a/user-exec.c +++ b/user-exec.c @@ -17,7 +17,8 @@ * License along with this library; if not, see . */ #include "config.h" -#include "exec.h" +#include "cpu.h" +#include "dyngen-exec.h" #include "disas.h" #include "tcg.h" @@ -40,7 +41,7 @@ static void exception_action(CPUState *env1) { #if defined(TARGET_I386) - raise_exception_err(env1->exception_index, env1->error_code); + raise_exception_err_env(env1, env1->exception_index, env1->error_code); #else cpu_loop_exit(env1); #endif @@ -628,47 +629,3 @@ int cpu_signal_handler(int host_signum, void *pinfo, #error host CPU specific signal handler needed #endif - -#if defined(TARGET_I386) - -void cpu_x86_load_seg(CPUX86State *s, int seg_reg, int selector) -{ - CPUX86State *saved_env; - - saved_env = env; - env = s; - if (!(env->cr[0] & CR0_PE_MASK) || (env->eflags & VM_MASK)) { - selector &= 0xffff; - cpu_x86_load_seg_cache(env, seg_reg, selector, - (selector << 4), 0xffff, 0); - } else { - helper_load_seg(seg_reg, selector); - } - env = saved_env; -} - -void cpu_x86_fsave(CPUX86State *s, target_ulong ptr, int data32) -{ - CPUX86State *saved_env; - - saved_env = env; - env = s; - - helper_fsave(ptr, data32); - - env = saved_env; -} - -void cpu_x86_frstor(CPUX86State *s, target_ulong ptr, int data32) -{ - CPUX86State *saved_env; - - saved_env = env; - env = s; - - helper_frstor(ptr, data32); - - env = saved_env; -} - -#endif /* TARGET_I386 */ -- cgit v1.2.1