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>
This commit is contained in:
Min M Xu 2023-01-19 09:51:07 +08:00 committed by mergify[bot]
parent 18df11da8c
commit 0826808d4f
4 changed files with 10 additions and 8 deletions

View File

@ -78,7 +78,7 @@ EFI_STATUS
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
FfsFindSectionData ( FfsFindSectionDataWithHook (
IN EFI_SECTION_TYPE SectionType, IN EFI_SECTION_TYPE SectionType,
IN FFS_CHECK_SECTION_HOOK SectionCheckHook, IN FFS_CHECK_SECTION_HOOK SectionCheckHook,
IN EFI_PEI_FILE_HANDLE FileHandle, IN EFI_PEI_FILE_HANDLE FileHandle,

View File

@ -459,9 +459,11 @@ CheckNextSection:
/** /**
This service enables discovery sections of a given type within a valid FFS file. 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 SectionType The value of the section type to find.
@param FfsFileHeader A pointer to the file header that contains the set of sections to @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. be searched.
@param SectionData A pointer to the discovered section, if successful. @param SectionData A pointer to the discovered section, if successful.
@ -471,7 +473,7 @@ CheckNextSection:
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
FfsFindSectionData ( FfsFindSectionDataWithHook (
IN EFI_SECTION_TYPE SectionType, IN EFI_SECTION_TYPE SectionType,
IN FFS_CHECK_SECTION_HOOK SectionCheckHook, IN FFS_CHECK_SECTION_HOOK SectionCheckHook,
IN EFI_PEI_FILE_HANDLE FileHandle, IN EFI_PEI_FILE_HANDLE FileHandle,
@ -817,7 +819,7 @@ FfsProcessFvFile (
// //
// Find FvImage in FvFile // 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)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }

View File

@ -131,7 +131,7 @@ LoadDxeCoreFromFfsFile (
VOID *Hob; VOID *Hob;
EFI_FV_FILE_INFO FvFileInfo; 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)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }

View File

@ -209,7 +209,7 @@ FindDxeNonCc (
// //
// Find FvImage in FvFile // Find FvImage in FvFile
// //
Status = FfsFindSectionData (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, CheckSectionHookForDxeNonCc, FileHandle, (VOID **)&FvImageHandle); Status = FfsFindSectionDataWithHook (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, CheckSectionHookForDxeNonCc, FileHandle, (VOID **)&FvImageHandle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
@ -303,7 +303,7 @@ DxeLoadCore (
// //
// Load the DXE Core from a Firmware Volume. // Load the DXE Core from a Firmware Volume.
// //
Status = FfsFindSectionData (EFI_SECTION_PE32, NULL, FileHandle, &PeCoffImage); Status = FfsFindSectionDataWithHook (EFI_SECTION_PE32, NULL, FileHandle, &PeCoffImage);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }