summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Library/PrePiLib
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-30 20:37:50 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-30 20:37:50 +0000
commite4dbec73c5f31286bb1645465d87a65793cfadce (patch)
tree28842ef3bc15b99419bdd76ebf295cb31dbdf5b9 /EmbeddedPkg/Library/PrePiLib
parent76a689b57344bb915be03e2b27dc432eec7c03b5 (diff)
downloadedk2-platforms-e4dbec73c5f31286bb1645465d87a65793cfadce.tar.xz
Change name to remove Template
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9877 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg/Library/PrePiLib')
-rw-r--r--EmbeddedPkg/Library/PrePiLib/Hob.c48
-rw-r--r--EmbeddedPkg/Library/PrePiLib/PrePiLib.inf1
2 files changed, 49 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));
+}
+
+
+
diff --git a/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf b/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
index 8e4f796bb2..72e41c999f 100644
--- a/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
+++ b/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
@@ -65,6 +65,7 @@
[Protocols]
gEfiStatusCodeRuntimeProtocolGuid
+ gPeCoffLoaderProtocolGuid
[FixedPcd.common]