]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add compatibility logic to handle framework fvhob and install FvInfo ppi. And remove...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 21 Aug 2008 07:51:03 +0000 (07:51 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 21 Aug 2008 07:51:03 +0000 (07:51 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5704 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
MdeModulePkg/Core/Pei/FwVol/FwVol.c
MdeModulePkg/Core/Pei/PeiMain.inf
MdeModulePkg/MdeModulePkg.dec

index f016f171a4c8cfc3049a8550c6d1a95927aae6e0..b83f0006e4c0455ec69e3631e4c4491bda8e4b30 100644 (file)
@@ -347,7 +347,10 @@ PeiDispatcher (
     \r
     for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {\r
       Private->CurrentPeimFvCount = FvCount;\r
-      VolumeHandle = Private->Fv[FvCount].FvHeader;\r
+      //\r
+      // Get this Fv Handle by PeiService FvFindNextVolume.\r
+      //\r
+      PeiFvFindNextVolume (PeiServices, FvCount, &VolumeHandle);\r
 \r
       if (Private->CurrentPeimCount == 0) {\r
         //\r
index a841a7eb24c9313b0c3b40580c2649e19efada88..cf0cfe78c5c12e6aa7530298df3d695bd078fd1b 100644 (file)
@@ -612,17 +612,51 @@ PeiFfsFindNextFile (
 EFI_STATUS \r
 EFIAPI\r
 PeiFvFindNextVolume (\r
-  IN CONST EFI_PEI_SERVICES           **PeiServices,\r
+  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
   IN     UINTN                      Instance,\r
   IN OUT EFI_PEI_FV_HANDLE          *VolumeHandle\r
   )\r
 {\r
-  PEI_CORE_INSTANCE   *Private;\r
+  PEI_CORE_INSTANCE        *Private;\r
+  UINTN                    Index;\r
+  BOOLEAN                  Match;\r
+  EFI_HOB_FIRMWARE_VOLUME  *FvHob;\r
 \r
   Private = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
   if (VolumeHandle == NULL) {\r
    return EFI_INVALID_PARAMETER;\r
-  } \r
+  }\r
+  \r
+  //\r
+  // Handle Framework FvHob and Install FvInfo Ppi for it.\r
+  //\r
+  if (FeaturePcdGet (PcdFrameworkFvHobCompatibilitySupport)) {\r
+    //\r
+    // Loop to search the wanted FirmwareVolume which supports FFS\r
+    //\r
+    FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetFirstHob (EFI_HOB_TYPE_FV);\r
+    while (FvHob != NULL) {\r
+      for (Index = 0, Match = FALSE; Index < Private->AllFvCount; Index++) {\r
+        if ((EFI_PEI_FV_HANDLE)(UINTN)FvHob->BaseAddress == Private->AllFv[Index]) {\r
+          Match = TRUE;\r
+          break;\r
+        }\r
+      }\r
+      //\r
+      // If Not Found, Install FvInfo Ppi for it.\r
+      //\r
+      if (!Match) {\r
+        PiLibInstallFvInfoPpi (\r
+          NULL,\r
+          (VOID *)(UINTN)FvHob->BaseAddress,\r
+          (UINT32)FvHob->Length,\r
+          NULL,\r
+          NULL\r
+          );\r
+      }\r
+      FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength)); \r
+    }\r
+  }\r
 \r
   if (Instance >= Private->AllFvCount) {\r
    VolumeHandle = NULL;\r
index 7a94f53184a41a729980e90d4cd16214e6fb2eb0..35c8b973c075da663ae4e0281d37097c62d6c872 100644 (file)
@@ -95,3 +95,5 @@
 \r
 [FeaturePcd.common]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkFvHobCompatibilitySupport\r
+  
\ No newline at end of file
index da75dec76bd90bfbefabb13ca189b239ec6be7ae..792b7f29b5f5da4ad403aecca41523feea60bfd7 100644 (file)
   \r
   ## This feature flag can be used to enable or disable the PCD service PEIM to handle DynamicEX PCD. \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiPcdDatabaseExEnabled|TRUE|BOOLEAN|0x00010033\r
-  \r
-  ## If this feature is enabled, then the DXE IPL must support decompressing files compressed with the EFI Compression algorithm.\r
-  #  This feature flag is deprecated.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportEfiDecompress|TRUE|BOOLEAN|0x00010034\r
-  \r
-  ## If this feature is enabled, then the DXE IPL must support decompressing files compressed with the Tiano Compression algorithm.\r
-  #  This feature flag is deprecated.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportTianoDecompress|TRUE|BOOLEAN|0x00010035\r
-  \r
-  ## If this feature is enabled, then the DXE IPL must support decompressing files compressed with the Custom Compression algorithm.\r
-  #  This feature flag is deprecated.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportCustomDecompress|TRUE|BOOLEAN|0x00010036\r
-  \r
\r
   ## If TRUE, then the Device Path To Text Protocol should be produced by the platform.\r
   #  It can be disabled to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdDevicePathSupportDevicePathToText|TRUE|BOOLEAN|0x00010037\r
   ## If TRUE, then the Device Path From Text Protocol should be produced by the platform.\r
   #  It can be disabled to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdDevicePathSupportDevicePathFromText|TRUE|BOOLEAN|0x00010038\r
\r
-  ## If this feature is enabled, DXE IPL will build a series of HOBs to share code with DXE Core.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplBuildShareCodeHobs|FALSE|BOOLEAN|0x0001003c\r
-  \r
+    \r
   ## If this PCD is set as TRUE, the code specific to NT emulator will be endabled.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdNtEmulatorEnable|FALSE|BOOLEAN|0x0001003e\r
   \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdDisableDefaultKeyboardLayoutInUsbKbDriver|FALSE|BOOLEAN|0x00010200\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkHiiCompatibilitySupport|TRUE|BOOLEAN|0x00012008\r
+  \r
+  ## IF TRUE, the PeiCore will handle the framework FvHob and install FvInfo PPI for it.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkFvHobCompatibilitySupport|FALSE|BOOLEAN|0x00012009\r
 \r
 [PcdsFixedAtBuild.common]\r
   ## Dynamic type PCD can be registered callback function for Pcd setting action.\r