//\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
- // If Not Found, Install FvInfo Ppi for it.\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
NULL\r
);\r
}\r
+ \r
FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength)); \r
}\r
}\r