]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Include/Library/PrePiLib.h
EmbeddedPkg/PrePiLib: Add FFS_CHECK_SECTION_HOOK when finding section
[mirror_edk2.git] / EmbeddedPkg / Include / Library / PrePiLib.h
index 3741b08c44780d4eafff37a5df645d82160420f7..f60b6678185ac11dad8625aec038d896ad1a6168 100644 (file)
@@ -52,11 +52,23 @@ FfsFindNextFile (
   IN OUT EFI_PEI_FILE_HANDLE  *FileHandle\r
   );\r
 \r
+/**\r
+ * This is a hook which is used to check if the section is the target one.\r
+ *\r
+ */\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FFS_CHECK_SECTION_HOOK)(\r
+  IN EFI_COMMON_SECTION_HEADER *Section\r
+  );\r
+\r
 /**\r
   This service enables discovery sections of a given type within a valid FFS file.\r
+  Caller also can provide a SectionCheckHook to do additional checking.\r
 \r
-  @param  SearchType            The value of the section type to find.\r
-  @param  FfsFileHeader         A pointer to the file header that contains the set of sections to\r
+  @param  SectionType           The value of the section type to find.\r
+  @param  SectionCheckHook      A hook which can check if the section is the target one.\r
+  @param  FileHeader            A pointer to the file header that contains the set of sections to\r
                                 be searched.\r
   @param  SectionData           A pointer to the discovered section, if successful.\r
 \r
@@ -67,9 +79,10 @@ FfsFindNextFile (
 EFI_STATUS\r
 EFIAPI\r
 FfsFindSectionData (\r
-  IN EFI_SECTION_TYPE     SectionType,\r
-  IN EFI_PEI_FILE_HANDLE  FileHandle,\r
-  OUT VOID                **SectionData\r
+  IN EFI_SECTION_TYPE        SectionType,\r
+  IN FFS_CHECK_SECTION_HOOK  SectionCheckHook,\r
+  IN EFI_PEI_FILE_HANDLE     FileHandle,\r
+  OUT VOID                   **SectionData\r
   );\r
 \r
 /**\r