aboutsummaryrefslogtreecommitdiff
path: root/target-i386/helper.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-26 22:26:53 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-26 22:26:53 +0000
commit08cea4eef8e17114dcdbce93f95cb111c9d622f6 (patch)
treed708e9ce4d32057cd80834b7ca7c131e12a09d89 /target-i386/helper.c
parent883da8e21932b24630f87ed4d801ea1ad48b735b (diff)
fixed ljmp and iret to TSS
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@682 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r--target-i386/helper.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 6239436315..dbdabd82ee 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1219,7 +1219,7 @@ void load_seg(int seg_reg, int selector)
}
/* protected mode jump */
-void helper_ljmp_protected_T0_T1(void)
+void helper_ljmp_protected_T0_T1(int next_eip)
{
int new_cs, new_eip, gate_cs, type;
uint32_t e1, e2, cpl, dpl, rpl, limit;
@@ -1267,8 +1267,7 @@ void helper_ljmp_protected_T0_T1(void)
case 5: /* task gate */
if (dpl < cpl || dpl < rpl)
raise_exception_err(EXCP0D_GPF, new_cs & 0xfffc);
- /* XXX: check if it is really the current EIP */
- switch_tss(new_cs, e1, e2, SWITCH_TSS_JMP, env->eip);
+ switch_tss(new_cs, e1, e2, SWITCH_TSS_JMP, next_eip);
break;
case 4: /* 286 call gate */
case 12: /* 386 call gate */
@@ -1732,7 +1731,7 @@ static inline void helper_ret_protected(int shift, int is_iret, int addend)
ESP = new_esp;
}
-void helper_iret_protected(int shift)
+void helper_iret_protected(int shift, int next_eip)
{
int tss_selector, type;
uint32_t e1, e2;
@@ -1748,8 +1747,7 @@ void helper_iret_protected(int shift)
/* NOTE: we check both segment and busy TSS */
if (type != 3)
raise_exception_err(EXCP0A_TSS, tss_selector & 0xfffc);
- /* XXX: check if it is really the current EIP */
- switch_tss(tss_selector, e1, e2, SWITCH_TSS_IRET, env->eip);
+ switch_tss(tss_selector, e1, e2, SWITCH_TSS_IRET, next_eip);
} else {
helper_ret_protected(shift, 1, 0);
}