- UINTN Index;\r
- BOOLEAN Match;\r
- EFI_HOB_FIRMWARE_VOLUME *FvHob;\r
-\r
- //\r
- // Handle Framework FvHob and Install FvInfo Ppi for it.\r
- //\r
- if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {\r
- //\r
- // Loop to search the wanted FirmwareVolume which supports FFS\r
- //\r
- FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetFirstHob (EFI_HOB_TYPE_FV);\r
- while (FvHob != NULL) {\r
- //\r
- // Search whether FvHob has been installed into PeiCore's FV database.\r
- // If found, no need install new FvInfoPpi for it.\r
- //\r
- for (Index = 0, Match = FALSE; Index < Private->FvCount; Index++) {\r
- if ((EFI_PEI_FV_HANDLE)(UINTN)FvHob->BaseAddress == Private->Fv[Index].FvHeader) {\r
- Match = TRUE;\r
- break;\r
- }\r
- }\r
-\r
- //\r
- // Search whether FvHob has been cached into PeiCore's Unknown FV database.\r
- // If found, no need install new FvInfoPpi for it.\r
- //\r
- if (!Match) {\r
- for (Index = 0; Index < Private->UnknownFvInfoCount; Index ++) {\r
- if ((UINTN)FvHob->BaseAddress == (UINTN)Private->UnknownFvInfo[Index].FvInfo) {\r
- Match = TRUE;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- //\r
- // If the Fv in FvHob has not been installed into PeiCore's FV database and has\r
- // not been cached into PeiCore's Unknown FV database, install a new FvInfoPpi\r
- // for it then PeiCore will dispatch it in callback of FvInfoPpi.\r
- //\r
- if (!Match) {\r
- PeiServicesInstallFvInfoPpi (\r
- &(((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHob->BaseAddress)->FileSystemGuid),\r
- (VOID *)(UINTN)FvHob->BaseAddress,\r
- (UINT32)FvHob->Length,\r
- NULL,\r
- NULL\r
- );\r
- }\r
-\r
- FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength));\r
- }\r
- }\r
-\r
- ASSERT (Private->FvCount <= PcdGet32 (PcdPeiCoreMaxFvSupported));\r