aboutsummaryrefslogtreecommitdiff
path: root/translate-i386.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 /translate-i386.c
parentc33a346edff5910dddeea84792b73cb117518911 (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 'translate-i386.c')
-rw-r--r--translate-i386.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/translate-i386.c b/translate-i386.c
index 820cc65c30..dd4a8a486c 100644
--- a/translate-i386.c
+++ b/translate-i386.c
@@ -4113,13 +4113,7 @@ static inline int gen_intermediate_code_internal(CPUState *env,
dc->addseg = (flags >> GEN_FLAG_ADDSEG_SHIFT) & 1;
dc->f_st = (flags >> GEN_FLAG_ST_SHIFT) & 7;
dc->vm86 = (flags >> GEN_FLAG_VM_SHIFT) & 1;
- /* CPL is implicit if real mode or vm86 mode */
- if (!dc->pe)
- dc->cpl = 0;
- else if (dc->vm86)
- dc->cpl = 3;
- else
- dc->cpl = (flags >> GEN_FLAG_CPL_SHIFT) & 3;
+ dc->cpl = (flags >> GEN_FLAG_CPL_SHIFT) & 3;
dc->iopl = (flags >> GEN_FLAG_IOPL_SHIFT) & 3;
dc->tf = (flags >> GEN_FLAG_TF_SHIFT) & 1;
dc->cc_op = CC_OP_DYNAMIC;
@@ -4362,7 +4356,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr, int is_write)
int cpl, error_code, is_dirty, is_user, prot, page_size;
void *map_addr;
- cpl = env->segs[R_CS].selector & 3;
+ cpl = env->cpl;
is_user = (cpl == 3);
#ifdef DEBUG_MMU