TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeEmuPeCoffExtraActionLib.c
Go to the documentation of this file.
1
12#include <PiDxe.h>
13
14#include <Protocol/EmuThunk.h>
15
16#include <Library/PeCoffLib.h>
17#include <Library/BaseLib.h>
18#include <Library/DebugLib.h>
19#include <Library/HobLib.h>
22
23//
24// Cache of UnixThunk protocol
25//
26EMU_THUNK_PROTOCOL *mThunk = NULL;
27
36EFIAPI
38 IN EFI_HANDLE ImageHandle,
39 IN EFI_SYSTEM_TABLE *SystemTable
40 )
41{
42 EFI_HOB_GUID_TYPE *GuidHob;
43
44 //
45 // Retrieve EmuThunkProtocol from GUID'ed HOB
46 //
47 GuidHob = GetFirstGuidHob (&gEmuThunkProtocolGuid);
48 ASSERT (GuidHob != NULL);
49 mThunk = (EMU_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));
50 ASSERT (mThunk != NULL);
51
52 return EFI_SUCCESS;
53}
54
64VOID
65EFIAPI
68 )
69{
70 if (mThunk != NULL) {
71 mThunk->PeCoffRelocateImageExtraAction (ImageContext);
72 }
73}
74
85VOID
86EFIAPI
89 )
90{
91 if (mThunk != NULL) {
92 mThunk->PeCoffUnloadImageExtraAction (ImageContext);
93 }
94}
UINT64 UINTN
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
Definition: HobLib.c:215
VOID EFIAPI PeCoffLoaderUnloadImageExtraAction(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
VOID EFIAPI PeCoffLoaderRelocateImageExtraAction(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
EFI_STATUS EFIAPI DxeEmuPeCoffLibExtraActionConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112