diff options
Diffstat (limited to 'MdeModulePkg/Core/Pei')
-rw-r--r-- | MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 5 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/FwVol/FwVol.c | 40 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiMain.inf | 2 |
3 files changed, 43 insertions, 4 deletions
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index f016f171a4..b83f0006e4 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -347,7 +347,10 @@ PeiDispatcher ( for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {
Private->CurrentPeimFvCount = FvCount;
- VolumeHandle = Private->Fv[FvCount].FvHeader;
+ //
+ // Get this Fv Handle by PeiService FvFindNextVolume.
+ //
+ PeiFvFindNextVolume (PeiServices, FvCount, &VolumeHandle);
if (Private->CurrentPeimCount == 0) {
//
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index a841a7eb24..cf0cfe78c5 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -612,17 +612,51 @@ PeiFfsFindNextFile ( EFI_STATUS
EFIAPI
PeiFvFindNextVolume (
- IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_SERVICES **PeiServices,
IN UINTN Instance,
IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
)
{
- PEI_CORE_INSTANCE *Private;
+ PEI_CORE_INSTANCE *Private;
+ UINTN Index;
+ BOOLEAN Match;
+ EFI_HOB_FIRMWARE_VOLUME *FvHob;
Private = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
if (VolumeHandle == NULL) {
return EFI_INVALID_PARAMETER;
- }
+ }
+
+ //
+ // Handle Framework FvHob and Install FvInfo Ppi for it.
+ //
+ if (FeaturePcdGet (PcdFrameworkFvHobCompatibilitySupport)) {
+ //
+ // Loop to search the wanted FirmwareVolume which supports FFS
+ //
+ FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetFirstHob (EFI_HOB_TYPE_FV);
+ while (FvHob != NULL) {
+ for (Index = 0, Match = FALSE; Index < Private->AllFvCount; Index++) {
+ if ((EFI_PEI_FV_HANDLE)(UINTN)FvHob->BaseAddress == Private->AllFv[Index]) {
+ Match = TRUE;
+ break;
+ }
+ }
+ //
+ // If Not Found, Install FvInfo Ppi for it.
+ //
+ if (!Match) {
+ PiLibInstallFvInfoPpi (
+ NULL,
+ (VOID *)(UINTN)FvHob->BaseAddress,
+ (UINT32)FvHob->Length,
+ NULL,
+ NULL
+ );
+ }
+ FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength));
+ }
+ }
if (Instance >= Private->AllFvCount) {
VolumeHandle = NULL;
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 7a94f53184..35c8b973c0 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -95,3 +95,5 @@ [FeaturePcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkFvHobCompatibilitySupport
+
\ No newline at end of file |