summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S18
1 files changed, 12 insertions, 6 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
index d1feb9972e..55415d8703 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
@@ -1,6 +1,6 @@
#*****************************************************************************
#*
-#* Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+#* Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
#* This program and the accompanying materials
#* are licensed and made available under the terms and conditions of the BSD License
#* which accompanies this distribution. The full text of the license may be found at
@@ -72,6 +72,9 @@ ASM_PFX(Thunk16):
push $0xd
pop %ecx
rep movsl %ds:(%esi),%es:(%edi) #; copy context to 16-bit stack
+ #; copy eflags to stack frame
+ mov -12(%esi), %eax
+ mov %eax, -72(%edi)
pop %ebx #; ebx <- 16-bit stack offset
mov $L_Lable1,%eax
stos %eax,%es:(%edi)
@@ -140,20 +143,23 @@ ASM_PFX(RealMode):
popw %es
popw %fs
popw %gs
- addw $4, %sp # skip EFlags
- testw $1, 14(%esp) #(_STK16 ptr [esp + 8]).ThunkFlags, 1
+ sub 60, %esp
+ popfw
+ testw $1, 74(%esp) #(_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1
+
jz 1f
- pushf
+ pushf # push Flags when it's INT#
1:
pushw %cs
# push @FarCallRet - _Code16Addr
.byte 0x68 # push /iw
.word FarCallRet - _Code16Addr
jz 2f
- ljmp *6(%esp) #bugbug
+ ljmp *66(%esp) #[esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
2:
- ljmp *4(%esp) #bugbug
+ ljmp *64(%esp) #[esp + 4 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
FarCallRet:
+ add 60, %esp
pushfl
pushw %gs
pushw %fs