Browse Source

EmbeddedPkg: Add back FfsFindSectionData

In commit c673216f53 a new input parameter is added in FfsFindSectionData.
That change breaks the build of ArmVirtPkg. In this patch
FfsFindSectionData is added back. It calls FfsFindSectionDataWithHook with
a NULL hook.

Signed-off-by: Min Xu <min.m.xu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Min M Xu 1 year ago
parent
commit
51411435d5
2 changed files with 43 additions and 0 deletions
  1. 20 0
      EmbeddedPkg/Include/Library/PrePiLib.h
  2. 23 0
      EmbeddedPkg/Library/PrePiLib/FwVol.c

+ 20 - 0
EmbeddedPkg/Include/Library/PrePiLib.h

@@ -85,6 +85,26 @@ FfsFindSectionDataWithHook (
   OUT VOID                   **SectionData
   );
 
+/**
+  This service enables discovery sections of a given type within a valid FFS file.
+
+  @param  SectionType           The value of the section type to find.
+  @param  FileHandle            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.
+
+  @retval EFI_SUCCESS           The section was found.
+  @retval EFI_NOT_FOUND         The section was not found.
+
+**/
+EFI_STATUS
+EFIAPI
+FfsFindSectionData (
+  IN EFI_SECTION_TYPE     SectionType,
+  IN EFI_PEI_FILE_HANDLE  FileHandle,
+  OUT VOID                **SectionData
+  );
+
 /**
   Find a file in the volume by name
 

+ 23 - 0
EmbeddedPkg/Library/PrePiLib/FwVol.c

@@ -504,6 +504,29 @@ FfsFindSectionDataWithHook (
            );
 }
 
+/**
+  This service enables discovery sections of a given type within a valid FFS file.
+
+  @param  SectionType           The value of the section type to find.
+  @param  FileHandle            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.
+
+  @retval EFI_SUCCESS           The section was found.
+  @retval EFI_NOT_FOUND         The section was not found.
+
+**/
+EFI_STATUS
+EFIAPI
+FfsFindSectionData (
+  IN EFI_SECTION_TYPE     SectionType,
+  IN EFI_PEI_FILE_HANDLE  FileHandle,
+  OUT VOID                **SectionData
+  )
+{
+  return FfsFindSectionDataWithHook (SectionType, NULL, FileHandle, SectionData);
+}
+
 /**
   This service enables discovery of additional firmware files.