diff options
| author | Oliver Smith-Denny <osde@microsoft.com> | 2026-06-12 17:48:11 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-06-13 12:06:33 +0300 |
| commit | e63bba000a464fe35fb215e99bc4dcf01ebeabd6 (patch) | |
| tree | 68f7a63b7ffbc080d85bf3a25b0741d0c1c201f3 /EmbeddedPkg/Library/PrePiLib | |
| parent | 622a2c7abf98d36525f8122ae724d381148121df (diff) | |
| download | edk2-e63bba000a464fe35fb215e99bc4dcf01ebeabd6.tar.xz | |
EmbeddedPkg: PrePiLib: Skip Extracting if FV3 HOB Found
PrePiLib only searches for the existence of an FV2 HOB to
determine if an FV has already been extracted. However,
FV2 HOBs have been superceded by FV3 HOBs for describing extracted
FVs.
This commit updates PrePiLib to check for the existence of either
an FV2 or FV3 HOB for this FV and skips extracting if either is
found.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Diffstat (limited to 'EmbeddedPkg/Library/PrePiLib')
| -rw-r--r-- | EmbeddedPkg/Library/PrePiLib/FwVol.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c b/EmbeddedPkg/Library/PrePiLib/FwVol.c index ee6de5f59a..bdc3022e79 100644 --- a/EmbeddedPkg/Library/PrePiLib/FwVol.c +++ b/EmbeddedPkg/Library/PrePiLib/FwVol.c @@ -875,7 +875,7 @@ FfsProcessFvFile ( EFI_FV_INFO FvImageInfo;
UINT32 FvAlignment;
VOID *FvBuffer;
- EFI_PEI_HOB_POINTERS HobFv2;
+ EFI_PEI_HOB_POINTERS Hob;
FvBuffer = NULL;
@@ -883,16 +883,22 @@ FfsProcessFvFile ( // Check if this EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE file has already
// been extracted.
//
- HobFv2.Raw = GetHobList ();
- while ((HobFv2.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobFv2.Raw)) != NULL) {
- if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &HobFv2.FirmwareVolume2->FileName)) {
- //
- // this FILE has been dispatched, it will not be dispatched again.
- //
- return EFI_SUCCESS;
+ for (Hob.Raw = GetHobList (); !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
+ if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) {
+ if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &Hob.FirmwareVolume2->FileName)) {
+ //
+ // this FILE has been dispatched, it will not be dispatched again.
+ //
+ return EFI_SUCCESS;
+ }
+ } else if ((GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV3) && Hob.FirmwareVolume3->ExtractedFv) {
+ if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &Hob.FirmwareVolume3->FileName)) {
+ //
+ // this FILE has been dispatched, it will not be dispatched again.
+ //
+ return EFI_SUCCESS;
+ }
}
-
- HobFv2.Raw = GET_NEXT_HOB (HobFv2);
}
//
|
