From 4136f33c7e3c034b17bb0032fa5d4297ae2f317a Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 23 Nov 2003 23:09:40 +0000 Subject: fixed eflags IF/IOPL update git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@476 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-i386/translate.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'target-i386/translate.c') diff --git a/target-i386/translate.c b/target-i386/translate.c index b09f1b7a4c..9c5c52e4b2 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -3540,10 +3540,18 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start) gen_op_movw_eflags_T0_cpl0(); } } else { - if (s->dflag) { - gen_op_movl_eflags_T0(); + if (s->cpl <= s->iopl) { + if (s->dflag) { + gen_op_movl_eflags_T0_io(); + } else { + gen_op_movw_eflags_T0_io(); + } } else { - gen_op_movw_eflags_T0(); + if (s->dflag) { + gen_op_movl_eflags_T0(); + } else { + gen_op_movw_eflags_T0(); + } } } gen_pop_update(s); @@ -4265,6 +4273,10 @@ static uint16_t opc_write_flags[NB_OPS] = { [INDEX_op_movb_eflags_T0] = CC_S | CC_Z | CC_A | CC_P | CC_C, [INDEX_op_movw_eflags_T0] = CC_OSZAPC, [INDEX_op_movl_eflags_T0] = CC_OSZAPC, + [INDEX_op_movw_eflags_T0_io] = CC_OSZAPC, + [INDEX_op_movl_eflags_T0_io] = CC_OSZAPC, + [INDEX_op_movw_eflags_T0_cpl0] = CC_OSZAPC, + [INDEX_op_movl_eflags_T0_cpl0] = CC_OSZAPC, [INDEX_op_clc] = CC_C, [INDEX_op_stc] = CC_C, [INDEX_op_cmc] = CC_C, -- cgit v1.2.3