#*****************************************************************************\r
#*\r
-#* Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+#* Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
#* This program and the accompanying materials \r
#* are licensed and made available under the terms and conditions of the BSD License \r
#* which accompanies this distribution. The full text of the license may be found at \r
push $0xd\r
pop %ecx\r
rep movsl %ds:(%esi),%es:(%edi) #; copy context to 16-bit stack\r
+ #; copy eflags to stack frame\r
+ mov -12(%esi), %eax\r
+ mov %eax, -72(%edi) \r
pop %ebx #; ebx <- 16-bit stack offset\r
mov $L_Lable1,%eax\r
stos %eax,%es:(%edi)\r
popw %es\r
popw %fs\r
popw %gs\r
- addw $4, %sp # skip EFlags\r
- testw $1, 14(%esp) #(_STK16 ptr [esp + 8]).ThunkFlags, 1\r
+ sub 60, %esp\r
+ popfw\r
+ testw $1, 74(%esp) #(_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1\r
+\r
jz 1f\r
- pushf\r
+ pushf # push Flags when it's INT#\r
1: \r
pushw %cs\r
# push @FarCallRet - _Code16Addr\r
.byte 0x68 # push /iw\r
.word FarCallRet - _Code16Addr\r
jz 2f\r
- ljmp *6(%esp) #bugbug\r
+ ljmp *66(%esp) #[esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]\r
2: \r
- ljmp *4(%esp) #bugbug\r
+ ljmp *64(%esp) #[esp + 4 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]\r
FarCallRet: \r
+ add 60, %esp\r
pushfl\r
pushw %gs\r
pushw %fs\r