]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Only build FvHob for the extracted FvImage those parent Fv image has FvHob.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Aug 2008 07:36:24 +0000 (07:36 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Aug 2008 07:36:24 +0000 (07:36 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5625 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c

index a4ed45af522bb353093c140e899d61df83a81d34..9c1aab916f693443a75ef9e31781f7ba01700738 100644 (file)
@@ -814,7 +814,7 @@ ProcessFvFile (
   EFI_FV_INFO           FvImageInfo;\r
   UINT32                FvAlignment;\r
   VOID                  *FvBuffer;\r
-  EFI_PEI_HOB_POINTERS  HobFv2;\r
+  EFI_PEI_HOB_POINTERS  HobPtr;\r
 \r
   FvBuffer             = NULL;\r
   *AuthenticationState = 0;\r
@@ -823,15 +823,15 @@ ProcessFvFile (
   // Check if this EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE file has already\r
   // been extracted.\r
   //\r
-  HobFv2.Raw = GetHobList ();\r
-  while ((HobFv2.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobFv2.Raw)) != NULL) {\r
-    if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &HobFv2.FirmwareVolume2->FileName)) {\r
+  HobPtr.Raw = GetHobList ();\r
+  while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV2, HobPtr.Raw)) != NULL) {\r
+    if (CompareGuid (&(((EFI_FFS_FILE_HEADER *)FvFileHandle)->Name), &HobPtr.FirmwareVolume2->FileName)) {\r
       //\r
       // this FILE has been dispatched, it will not be dispatched again.\r
       //\r
       return EFI_SUCCESS;\r
     }\r
-    HobFv2.Raw = GET_NEXT_HOB (HobFv2);\r
+    HobPtr.Raw = GET_NEXT_HOB (HobPtr);\r
   }\r
 \r
   //\r
@@ -886,12 +886,24 @@ ProcessFvFile (
     );\r
 \r
   //\r
-  // Inform HOB consumer phase, i.e. DXE core, the existance of this FV\r
+  // Inform the extracted FvImage to Fv HOB consumer phase, i.e. DXE phase\r
+  // based on its parent Fvimage is informed or not.\r
+  // If FvHob of its parent fvimage is built, the extracted FvImage will be built also. \r
+  // Or, the extracted FvImage will not be built.\r
   //\r
-  BuildFvHob (\r
-    (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,\r
-    FvImageInfo.FvSize\r
-  );\r
+  HobPtr.Raw = GetHobList ();\r
+  while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV, HobPtr.Raw)) != NULL) {\r
+    if (((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle > HobPtr.FirmwareVolume->BaseAddress) && \r
+        ((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle < HobPtr.FirmwareVolume->BaseAddress + HobPtr.FirmwareVolume->Length)) {\r
+      BuildFvHob (\r
+        (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,\r
+        FvImageInfo.FvSize\r
+      );\r
+      break;\r
+    }\r
+    HobPtr.Raw = GET_NEXT_HOB (HobPtr);\r
+  }\r
+\r
   //\r
   // Makes the encapsulated volume show up in DXE phase to skip processing of\r
   // encapsulated file again.\r