diff options
Diffstat (limited to 'EmbeddedPkg/Library/PrePiLib/Hob.c')
-rw-r--r-- | EmbeddedPkg/Library/PrePiLib/Hob.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/EmbeddedPkg/Library/PrePiLib/Hob.c b/EmbeddedPkg/Library/PrePiLib/Hob.c index 3c6574282c..04b49bb044 100644 --- a/EmbeddedPkg/Library/PrePiLib/Hob.c +++ b/EmbeddedPkg/Library/PrePiLib/Hob.c @@ -13,7 +13,10 @@ **/ #include <PrePi.h> +#include <Protocol/PeCoffLoader.h> +#include <Guid/ExtractSection.h> #include <Guid/MemoryTypeInformation.h> +#include <Library/PeCoffLib.H> // // Have to use build system to set the original value in case we are running @@ -806,3 +809,48 @@ BuildMemoryAllocationHob ( } + +VOID +EFIAPI +BuildExtractSectionHob ( + IN EFI_GUID *Guid, + IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER SectionGetInfo, + IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER SectionExtraction + ) +{ + EXTRACT_SECTION_HOB Hob; + + Hob.SectionGetInfo = SectionGetInfo; + Hob.SectionExtraction = SectionExtraction; + BuildGuidDataHob (Guid, &Hob, sizeof (EXTRACT_SECTION_HOB)); +} + +PE_COFF_LOADER_PROTOCOL gPeCoffProtocol = { + PeCoffLoaderGetImageInfo, + PeCoffLoaderLoadImage, + PeCoffLoaderRelocateImage, + PeCoffLoaderImageReadFromMemory, + PeCoffLoaderRelocateImageForRuntime, + PeCoffLoaderUnloadImage +}; + +typedef struct { + EFI_HOB_GUID_TYPE Hob; + VOID *Interface; +} PROTOCOL_HOB; + + + +VOID +EFIAPI +BuildPeCoffLoaderHob ( + ) +{ + PROTOCOL_HOB Hob; + + Hob.Interface = &gPeCoffProtocol; + BuildGuidDataHob (&gPeCoffLoaderProtocolGuid, &Hob, sizeof (PROTOCOL_HOB)); +} + + + |