Fix the issue that unknown format FV in Fvhob is installed for FvInfoPpi more than one time. The fixing is search dispatched Fv database and cached unknown Fv information for all Fv in FvHob, if Fv has been identified by PeiCore, then no need install FvInfoPpi for it again.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9984 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2010-02-11 05:49:48 +00:00
parent 6635217350
commit 20ead7252b
1 changed files with 22 additions and 1 deletions

View File

@ -1348,14 +1348,34 @@ FindNextCoreFvHandle (
//
FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetFirstHob (EFI_HOB_TYPE_FV);
while (FvHob != NULL) {
//
// Search whether FvHob has been installed into PeiCore's FV database.
// If found, no need install new FvInfoPpi for it.
//
for (Index = 0, Match = FALSE; Index < Private->FvCount; Index++) {
if ((EFI_PEI_FV_HANDLE)(UINTN)FvHob->BaseAddress == Private->Fv[Index].FvHeader) {
Match = TRUE;
break;
}
}
//
// If Not Found, Install FvInfo Ppi for it.
// Search whether FvHob has been cached into PeiCore's Unknown FV database.
// If found, no need install new FvInfoPpi for it.
//
if (!Match) {
for (Index = 0; Index < Private->UnknownFvInfoCount; Index ++) {
if ((UINTN)FvHob->BaseAddress == (UINTN)Private->UnknownFvInfo[Index].FvInfo) {
Match = TRUE;
break;
}
}
}
//
// If the Fv in FvHob has not been installed into PeiCore's FV database and has
// not been cached into PeiCore's Unknown FV database, install a new FvInfoPpi
// for it then PeiCore will dispatch it in callback of FvInfoPpi.
//
if (!Match) {
PeiServicesInstallFvInfoPpi (
@ -1366,6 +1386,7 @@ FindNextCoreFvHandle (
NULL
);
}
FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength));
}
}