diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-11 05:49:48 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-11 05:49:48 +0000 |
commit | 20ead7252b301c04204afed52de53397a942c542 (patch) | |
tree | 5c54463f392cfccf4d52301d7e8ffdcda0430c49 | |
parent | 66352173507452dc6812269db140a3b2a470e90d (diff) | |
download | edk2-platforms-20ead7252b301c04204afed52de53397a942c542.tar.xz |
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
-rw-r--r-- | MdeModulePkg/Core/Pei/FwVol/FwVol.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index c6eb1fa24f..30485a836c 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -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));
}
}
|