]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix the issue that unknown format FV in Fvhob is installed for FvInfoPpi more than...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Feb 2010 05:49:48 +0000 (05:49 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Feb 2010 05:49:48 +0000 (05:49 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9984 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/FwVol/FwVol.c

index c6eb1fa24f55420b0bbde9ff5b3ac39f46dca0b0..30485a836cc98c68b1ccb30fc8973b8f8fe81c4f 100644 (file)
@@ -1348,14 +1348,34 @@ FindNextCoreFvHandle (
     //\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
@@ -1366,6 +1386,7 @@ FindNextCoreFvHandle (
           NULL\r
           );\r
       }\r
+      \r
       FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength)); \r
     }\r
   }\r