1 /** @file 2 3 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR> 4 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions 7 of the BSD License which accompanies this distribution. The 8 full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 14 **/ 15 16 #ifndef _IPF_THUNK_H_ 17 #define _IPF_THUNK_H_ 18 19 #include "LegacyBiosInterface.h" 20 #include <IndustryStandard/Sal.h> 21 22 /** 23 Template of real mode code. 24 25 @param CodeStart Start address of code. 26 @param CodeEnd End address of code 27 @param ReverseThunkStart Start of reverse thunk. 28 @param IntThunk Low memory thunk. 29 30 **/ 31 VOID 32 RealModeTemplate ( 33 OUT UINTN *CodeStart, 34 OUT UINTN *CodeEnd, 35 OUT UINTN *ReverseThunkStart, 36 LOW_MEMORY_THUNK *IntThunk 37 ); 38 39 /** 40 Register physical address of Esal Data Area 41 42 @param ReverseThunkCodeAddress Reverse Thunk Address 43 @param IntThunkAddress IntThunk Address 44 45 @retval EFI_SUCCESS ESAL data area set successfully. 46 47 **/ 48 EFI_STATUS 49 EsalSetSalDataArea ( 50 IN UINTN ReverseThunkCodeAddress, 51 IN UINTN IntThunkAddress 52 ); 53 54 /** 55 Get address of reverse thunk. 56 57 @retval EFI_SAL_SUCCESS Address of reverse thunk returned successfully. 58 59 **/ 60 SAL_RETURN_REGS 61 EsalGetReverseThunkAddress ( 62 VOID 63 ); 64 65 typedef struct { 66 UINT32 Eax; // 0 67 UINT32 Ecx; // 4 68 UINT32 Edx; // 8 69 UINT32 Ebx; // 12 70 UINT32 Esp; // 16 71 UINT32 Ebp; // 20 72 UINT32 Esi; // 24 73 UINT32 Edi; // 28 74 UINT32 Eflag; // 32 75 UINT32 Eip; // 36 76 UINT16 Cs; // 40 77 UINT16 Ds; // 42 78 UINT16 Es; // 44 79 UINT16 Fs; // 46 80 UINT16 Gs; // 48 81 UINT16 Ss; // 50 82 } IPF_DWORD_REGS; 83 84 /** 85 Entrypoint of IA32 code. 86 87 @param CallTypeData Data of call type 88 @param DwordRegister Register set of IA32 general registers 89 and segment registers 90 @param StackPointer Stack pointer. 91 @param StackSize Size of stack. 92 93 **/ 94 VOID 95 EfiIaEntryPoint ( 96 UINT64 CallTypeData, 97 IPF_DWORD_REGS *DwordRegister, 98 UINT64 StackPointer, 99 UINT64 StackSize 100 ); 101 102 #endif 103