aboutsummaryrefslogtreecommitdiff
path: root/target-i386/helper.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-11-14 15:39:16 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-11-14 15:39:16 +0000
commit61a8c4ec3a39cf8547aba056f03574a5fac31fdd (patch)
tree103d0fe806e291f8ca8477a8c7346cc8fc28a546 /target-i386/helper.c
parent9746b15b4ecd4702410a2769f6d18a67dbd0872d (diff)
enter insn fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1135 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r--target-i386/helper.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 41ebaf221e..e6686da722 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1068,6 +1068,38 @@ void helper_cpuid(void)
}
}
+void helper_enter_level(int level, int data32)
+{
+ uint8_t *ssp;
+ uint32_t esp_mask, esp, ebp;
+
+ esp_mask = get_sp_mask(env->segs[R_SS].flags);
+ ssp = env->segs[R_SS].base;
+ ebp = EBP;
+ esp = ESP;
+ if (data32) {
+ /* 32 bit */
+ esp -= 4;
+ while (--level) {
+ esp -= 4;
+ ebp -= 4;
+ stl(ssp + (esp & esp_mask), ldl(ssp + (ebp & esp_mask)));
+ }
+ esp -= 4;
+ stl(ssp + (esp & esp_mask), T1);
+ } else {
+ /* 16 bit */
+ esp -= 2;
+ while (--level) {
+ esp -= 2;
+ ebp -= 2;
+ stw(ssp + (esp & esp_mask), lduw(ssp + (ebp & esp_mask)));
+ }
+ esp -= 2;
+ stw(ssp + (esp & esp_mask), T1);
+ }
+}
+
void helper_lldt_T0(void)
{
int selector;