#*****************************************************************************\r
#*\r
-#* Copyright (c) 2008, Intel Corporation \r
-#* All rights reserved. This program and the accompanying materials \r
+#* Copyright (c) 2008 - 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
#* http://opensource.org/licenses/bsd-license.php \r
#*****************************************************************************\r
#include <EfiBind.h>\r
\r
-\r
+#ifndef __APPLE__\r
\r
.data\r
\r
pushq $0xe #push sizeof (IA32_REGS) / 4\r
pop %rcx\r
rep movsl %ds:(%rsi),%es:(%rdi)\r
+ #; copy eflags to stack frame\r
+ mov -16(%rsi), %rax\r
+ mov %rax, -80(%rsi)\r
pop %rbx #rbx <- 16-bit stack offset\r
lea Label,%eax #42 <_Thunk16+0x42>\r
stos %eax,%es:(%rdi)\r
retq \r
\r
\r
- .align 0x10\r
+ .p2align 4\r
\r
_Code16Addr:\r
ASM_PFX(RealMode):\r
.byte 0x07 #pop es\r
popq %fs\r
popq %gs\r
- add $0x8,%esp #skip RFLAGS\r
- .byte 0x67 #test [esp + 0eh], 1\r
+ sub 64, %esp\r
+ .byte 0x66, 0x9d #popfd\r
+ add $0x4,%esp #skip high part of RFLAGS\r
+ .byte 0x67 #; test (_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1\r
.byte 0xf7 \r
.byte 0x44\r
.byte 0x24\r
- .byte 0x0e\r
+ .byte 0x4e\r
.byte 0x01\r
.byte 0x00\r
jz 1f\r
- pushfq #pushf, actually\r
+ pushfq #pushf, actually, when it's INT#\r
1:\r
.byte 0x0e #push cs\r
.byte 0x68 #push /iw\r
.word FarCallRet - _Code16Addr\r
jz 2f\r
.byte 0x66\r
- ljmp *6(%esp)\r
+ ljmp *70(%esp)\r
2: \r
.byte 0x66\r
- ljmp *4(%esp)\r
+ ljmp *68(%esp)\r
FarCallRet: \r
+ add 64, %esp\r
.byte 0x66\r
push $0x00 #push a dword of zero\r
.byte 0x66\r
_16Idtr:\r
.word 0x3ff #FWORD (1 SHL 10) - 1\r
.byte 0x00\r
+\r
+#endif\r