aboutsummaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-07-29 20:53:01 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-07-29 20:53:01 +0000
commitb6d78bfa0dc11a7a23cb7ccc9b00b217e6fb68fe (patch)
tree1277b63f1b009b779040781fff8cc554448ea9f4 /cpu-exec.c
parentc33a346edff5910dddeea84792b73cb117518911 (diff)
downloadqemu-b6d78bfa0dc11a7a23cb7ccc9b00b217e6fb68fe.zip
qemu-b6d78bfa0dc11a7a23cb7ccc9b00b217e6fb68fe.tar.gz
qemu-b6d78bfa0dc11a7a23cb7ccc9b00b217e6fb68fe.tar.bz2
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.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 1ffeb8e..d478fa8 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;