aboutsummaryrefslogtreecommitdiff
path: root/target-i386/translate.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-18 09:32:32 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-18 09:32:32 +0000
commit94451178b6b7d6d08c0f16a5a1b0d03bf978f74b (patch)
treeb794553b91c5562d300e54a1a03c3da6de4b7263 /target-i386/translate.c
parent17ca26e7918353ae67fa9cfcbf61e3b90a1b3a6b (diff)
downloadqemu-94451178b6b7d6d08c0f16a5a1b0d03bf978f74b.zip
qemu-94451178b6b7d6d08c0f16a5a1b0d03bf978f74b.tar.gz
qemu-94451178b6b7d6d08c0f16a5a1b0d03bf978f74b.tar.bz2
HLT, MWAIT and MONITOR insn fixes (initial patch by Alexander Graf)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4746 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/translate.c')
-rw-r--r--target-i386/translate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 14903b4..6f9c256 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -6420,8 +6420,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
} else {
if (s->cc_op != CC_OP_DYNAMIC)
gen_op_set_cc_op(s->cc_op);
- gen_jmp_im(s->pc - s->cs_base);
- tcg_gen_helper_0_0(helper_hlt);
+ gen_jmp_im(pc_start - s->cs_base);
+ tcg_gen_helper_0_1(helper_hlt, tcg_const_i32(s->pc - pc_start));
s->is_jmp = 3;
}
break;
@@ -6519,6 +6519,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
if (!(s->cpuid_ext_features & CPUID_EXT_MONITOR) ||
s->cpl != 0)
goto illegal_op;
+ if (s->cc_op != CC_OP_DYNAMIC)
+ gen_op_set_cc_op(s->cc_op);
gen_jmp_im(pc_start - s->cs_base);
#ifdef TARGET_X86_64
if (s->aflag == 2) {
@@ -6541,8 +6543,8 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
gen_op_set_cc_op(s->cc_op);
s->cc_op = CC_OP_DYNAMIC;
}
- gen_jmp_im(s->pc - s->cs_base);
- tcg_gen_helper_0_0(helper_mwait);
+ gen_jmp_im(pc_start - s->cs_base);
+ tcg_gen_helper_0_1(helper_mwait, tcg_const_i32(s->pc - pc_start));
gen_eob(s);
break;
default: