summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Include/Library/PrePiLib.h
diff options
context:
space:
mode:
authorMin M Xu <min.m.xu@intel.com>2023-01-17 07:31:55 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-01-18 03:04:27 +0000
commitc673216f53bd18515ecbffdba75af007e6700853 (patch)
treee72c40993c7f7c41dd680af1820e4416f3713c83 /EmbeddedPkg/Include/Library/PrePiLib.h
parent6c1988af7683f3234dfd06a6a99deb3ea6946c39 (diff)
downloadedk2-c673216f53bd18515ecbffdba75af007e6700853.tar.gz
edk2-c673216f53bd18515ecbffdba75af007e6700853.tar.bz2
edk2-c673216f53bd18515ecbffdba75af007e6700853.zip
EmbeddedPkg/PrePiLib: Add FFS_CHECK_SECTION_HOOK when finding section
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4152 EmbeddedPkg/PrePiLib provides the service of finding sections based on the input SectionType. But sometimes there maybe multiple sections with the same SectionType. FFS_CHECK_SECTION_HOOK is a hook which can be called to do additional check. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Acked-by: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'EmbeddedPkg/Include/Library/PrePiLib.h')
-rw-r--r--EmbeddedPkg/Include/Library/PrePiLib.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/Library/PrePiLib.h
index 3741b08c44..f60b667818 100644
--- a/EmbeddedPkg/Include/Library/PrePiLib.h
+++ b/EmbeddedPkg/Include/Library/PrePiLib.h
@@ -53,10 +53,22 @@ FfsFindNextFile (
);
/**
+ * This is a hook which is used to check if the section is the target one.
+ *
+ */
+typedef
+EFI_STATUS
+(EFIAPI *FFS_CHECK_SECTION_HOOK)(
+ IN EFI_COMMON_SECTION_HEADER *Section
+ );
+
+/**
This service enables discovery sections of a given type within a valid FFS file.
+ Caller also can provide a SectionCheckHook to do additional checking.
- @param SearchType The value of the section type to find.
- @param FfsFileHeader A pointer to the file header that contains the set of sections to
+ @param SectionType The value of the section type to find.
+ @param SectionCheckHook A hook which can check if the section is the target one.
+ @param FileHeader A pointer to the file header that contains the set of sections to
be searched.
@param SectionData A pointer to the discovered section, if successful.
@@ -67,9 +79,10 @@ FfsFindNextFile (
EFI_STATUS
EFIAPI
FfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_PEI_FILE_HANDLE FileHandle,
- OUT VOID **SectionData
+ IN EFI_SECTION_TYPE SectionType,
+ IN FFS_CHECK_SECTION_HOOK SectionCheckHook,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT VOID **SectionData
);
/**