summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg
diff options
context:
space:
mode:
authorMin M Xu <min.m.xu@intel.com>2023-01-19 09:51:07 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-01-19 08:35:59 +0000
commit0826808d4f0246f25d25fdf60c0bce8172040f41 (patch)
tree5d516d01aa41d7ebab1052be7bae67d1f43b7a36 /EmbeddedPkg
parent18df11da8c14e48b6e4a90fb0b5befb1c243070a (diff)
downloadedk2-0826808d4f0246f25d25fdf60c0bce8172040f41.tar.gz
edk2-0826808d4f0246f25d25fdf60c0bce8172040f41.tar.bz2
edk2-0826808d4f0246f25d25fdf60c0bce8172040f41.zip
EmbeddedPkg: Rename FfsFindSectionData as FfsFindSectionDataWithHook
Commit c673216f53 introduces FFS_CHECK_SECTION_HOOK and add it as the second input parameter in FfsFindSectionData. This change breaks the build of ArmVirtPkg. To fix this issue, the new version of FfsFindSectionData is renamed as FfsFindSectionDataWithHook in this patch. In the following patch the original FfsFindSectionData will be added back. FfsFindSectionData is renamed as FfsFindSectionDataWithHook. Accordingly PeilessStartupLib in OvmfPkg should be updated as well. To prevent the build from being broken, the changes in OvmfPkg are in this patch. 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>
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r--EmbeddedPkg/Include/Library/PrePiLib.h2
-rw-r--r--EmbeddedPkg/Library/PrePiLib/FwVol.c10
-rw-r--r--EmbeddedPkg/Library/PrePiLib/PrePiLib.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/Library/PrePiLib.h
index f60b667818..0c259864d6 100644
--- a/EmbeddedPkg/Include/Library/PrePiLib.h
+++ b/EmbeddedPkg/Include/Library/PrePiLib.h
@@ -78,7 +78,7 @@ EFI_STATUS
**/
EFI_STATUS
EFIAPI
-FfsFindSectionData (
+FfsFindSectionDataWithHook (
IN EFI_SECTION_TYPE SectionType,
IN FFS_CHECK_SECTION_HOOK SectionCheckHook,
IN EFI_PEI_FILE_HANDLE FileHandle,
diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c b/EmbeddedPkg/Library/PrePiLib/FwVol.c
index 778d8b13c3..85dbf5b0ad 100644
--- a/EmbeddedPkg/Library/PrePiLib/FwVol.c
+++ b/EmbeddedPkg/Library/PrePiLib/FwVol.c
@@ -459,9 +459,11 @@ CheckNextSection:
/**
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 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.
@@ -471,7 +473,7 @@ CheckNextSection:
**/
EFI_STATUS
EFIAPI
-FfsFindSectionData (
+FfsFindSectionDataWithHook (
IN EFI_SECTION_TYPE SectionType,
IN FFS_CHECK_SECTION_HOOK SectionCheckHook,
IN EFI_PEI_FILE_HANDLE FileHandle,
@@ -817,7 +819,7 @@ FfsProcessFvFile (
//
// Find FvImage in FvFile
//
- Status = FfsFindSectionData (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, NULL, FvFileHandle, (VOID **)&FvImageHandle);
+ Status = FfsFindSectionDataWithHook (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, NULL, FvFileHandle, (VOID **)&FvImageHandle);
if (EFI_ERROR (Status)) {
return Status;
}
diff --git a/EmbeddedPkg/Library/PrePiLib/PrePiLib.c b/EmbeddedPkg/Library/PrePiLib/PrePiLib.c
index 3b6fc4f0eb..3cf866dab2 100644
--- a/EmbeddedPkg/Library/PrePiLib/PrePiLib.c
+++ b/EmbeddedPkg/Library/PrePiLib/PrePiLib.c
@@ -131,7 +131,7 @@ LoadDxeCoreFromFfsFile (
VOID *Hob;
EFI_FV_FILE_INFO FvFileInfo;
- Status = FfsFindSectionData (EFI_SECTION_PE32, NULL, FileHandle, &PeCoffImage);
+ Status = FfsFindSectionDataWithHook (EFI_SECTION_PE32, NULL, FileHandle, &PeCoffImage);
if (EFI_ERROR (Status)) {
return Status;
}