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
>
20
#include <
Library/BaseMemoryLib.h
>
21
#include <
Library/PeCoffExtraActionLib.h
>
22
23
//
24
// Cache of UnixThunk protocol
25
//
26
EMU_THUNK_PROTOCOL
*mThunk =
NULL
;
27
35
EFI_STATUS
36
EFIAPI
37
DxeEmuPeCoffLibExtraActionConstructor
(
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
64
VOID
65
EFIAPI
66
PeCoffLoaderRelocateImageExtraAction
(
67
IN
OUT
PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
68
)
69
{
70
if
(mThunk !=
NULL
) {
71
mThunk->PeCoffRelocateImageExtraAction (ImageContext);
72
}
73
}
74
85
VOID
86
EFIAPI
87
PeCoffLoaderUnloadImageExtraAction
(
88
IN
OUT
PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
89
)
90
{
91
if
(mThunk !=
NULL
) {
92
mThunk->PeCoffUnloadImageExtraAction (ImageContext);
93
}
94
}
UINTN
UINT64 UINTN
Definition:
ProcessorBind.h:112
GetFirstGuidHob
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
Definition:
HobLib.c:215
BaseLib.h
BaseMemoryLib.h
PeCoffLoaderUnloadImageExtraAction
VOID EFIAPI PeCoffLoaderUnloadImageExtraAction(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
Definition:
DxeEmuPeCoffExtraActionLib.c:87
PeCoffLoaderRelocateImageExtraAction
VOID EFIAPI PeCoffLoaderRelocateImageExtraAction(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
Definition:
DxeEmuPeCoffExtraActionLib.c:66
DxeEmuPeCoffLibExtraActionConstructor
EFI_STATUS EFIAPI DxeEmuPeCoffLibExtraActionConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition:
DxeEmuPeCoffExtraActionLib.c:37
HobLib.h
NULL
#define NULL
Definition:
Base.h:319
IN
#define IN
Definition:
Base.h:279
OUT
#define OUT
Definition:
Base.h:284
DebugLib.h
PeCoffExtraActionLib.h
PeCoffLib.h
PiDxe.h
EmuThunk.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_HANDLE
VOID * EFI_HANDLE
Definition:
UefiBaseType.h:33
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
_EMU_THUNK_PROTOCOL
Definition:
EmuThunk.h:202
EFI_HOB_GUID_TYPE
Definition:
PiHob.h:339
EFI_SYSTEM_TABLE
Definition:
UefiSpec.h:2028
PE_COFF_LOADER_IMAGE_CONTEXT
Definition:
PeCoffLib.h:75
EmulatorPkg
Library
DxeEmuPeCoffExtraActionLib
DxeEmuPeCoffExtraActionLib.c
Generated on Fri Nov 15 2024 18:01:07 for TianoCore EDK2 by
1.9.6