aboutsummaryrefslogtreecommitdiff
path: root/exec-i386.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-29 16:52:44 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-29 16:52:44 +0000
commitfc2b4c4879955829430f33bf262e7eab93c6173a (patch)
tree8d92449e3244cfc59633ef30e891bd2e217e3bb6 /exec-i386.c
parent9c605cb13547a5faa5cb1092e3e44ac8b0d0b841 (diff)
eflags update
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@56 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec-i386.c')
-rw-r--r--exec-i386.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/exec-i386.c b/exec-i386.c
index 5dbe7fa534..f59e1ccecf 100644
--- a/exec-i386.c
+++ b/exec-i386.c
@@ -330,9 +330,10 @@ int cpu_x86_exec(CPUX86State *env1)
#endif
/* put eflags in CPU temporary format */
- T0 = env->eflags;
- op_movl_eflags_T0();
+ CC_SRC = env->eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
+ DF = 1 - (2 * ((env->eflags >> 10) & 1));
CC_OP = CC_OP_EFLAGS;
+ env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
env->interrupt_request = 0;
/* prepare setjmp context for exception handling */
@@ -354,6 +355,7 @@ int cpu_x86_exec(CPUX86State *env1)
(unsigned long)env->seg_cache[R_ES].base |
(unsigned long)env->seg_cache[R_SS].base) != 0) <<
GEN_FLAG_ADDSEG_SHIFT;
+ flags |= (env->eflags & VM_MASK) >> (17 - GEN_FLAG_VM_SHIFT);
cs_base = env->seg_cache[R_CS].base;
pc = cs_base + env->eip;
tb = tb_find(&ptb, (unsigned long)pc, (unsigned long)cs_base,
@@ -390,8 +392,7 @@ int cpu_x86_exec(CPUX86State *env1)
ret = env->exception_index;
/* restore flags in standard format */
- op_movl_T0_eflags();
- env->eflags = T0;
+ env->eflags = env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK);
/* restore global registers */
#ifdef reg_EAX
@@ -489,7 +490,7 @@ int cpu_x86_signal_handler(int host_signum, struct siginfo *info,
/* for glibc 2.1 */
#define REG_EIP EIP
#endif
- pc = uc->uc_mcontext.gregs[EIP];
+ pc = uc->uc_mcontext.gregs[REG_EIP];
pold_set = &uc->uc_sigmask;
return handle_cpu_signal(pc, pold_set);
#else