diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-07-29 20:53:01 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-07-29 20:53:01 +0000 |
commit | b6d78bfa0dc11a7a23cb7ccc9b00b217e6fb68fe (patch) | |
tree | 1277b63f1b009b779040781fff8cc554448ea9f4 /cpu-exec.c | |
parent | c33a346edff5910dddeea84792b73cb117518911 (diff) |
correct CPL support (should fix flat real mode support)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@343 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cpu-exec.c')
-rw-r--r-- | cpu-exec.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cpu-exec.c b/cpu-exec.c index 1ffeb8e86c..d478fa8261 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -244,13 +244,8 @@ int cpu_exec(CPUState *env1) (unsigned long)env->segs[R_ES].base | (unsigned long)env->segs[R_SS].base) != 0) << GEN_FLAG_ADDSEG_SHIFT; - if (env->cr[0] & CR0_PE_MASK) { - if (!(env->eflags & VM_MASK)) - flags |= (env->segs[R_CS].selector & 3) << - GEN_FLAG_CPL_SHIFT; - else - flags |= (1 << GEN_FLAG_VM_SHIFT); - } + flags |= env->cpl << GEN_FLAG_CPL_SHIFT; + flags |= (env->eflags & VM_MASK) >> (17 - GEN_FLAG_VM_SHIFT); flags |= (env->eflags & (IOPL_MASK | TF_MASK)); cs_base = env->segs[R_CS].base; pc = cs_base + env->eip; |