]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Oct 2007 10:01:06 +0000 (10:01 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Oct 2007 10:01:06 +0000 (10:01 +0000)
PI spec Vol 1, 7.3.1 specifies that this same information reported by EFI_SEC_PLATFORM_INFORMATION_PPI
will be placed in a GUIDed HOB with the PPI GUID as the HOB GUID for HOB consumer phase.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4166 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/PeiMain.h
MdeModulePkg/Core/Pei/PeiMain.inf
MdeModulePkg/Core/Pei/PeiMain/PeiMain.c

index 156c6b2ed44d459ef320ffaff79928a4973d2493..37aca731ee1de205effe7cc9acea37fe90b434cd 100644 (file)
@@ -37,6 +37,7 @@ Revision History
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/LoadFile.h>\r
 #include <Ppi/Security2.h>\r
+#include <Ppi/SecPlatformInformation.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PeiCoreEntryPoint.h>\r
 #include <Library/BaseLib.h>\r
index a954cadedaa733727872cdd322fd63cb0d7faf19..392a548e248097937c78533e30ea67cf73fd4f54 100644 (file)
@@ -96,6 +96,7 @@
   gEfiPeiFirmwareVolumeInfoPpiGuid\r
   gEfiPeiLoadFilePpiGuid\r
   gEfiPeiSecurity2PpiGuid\r
+  gEfiSecPlatformInformationPpiGuid\r
 \r
 [FixedPcd.common]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported\r
index 4dd7f26c3094feaae756868ced39bb980afff460..d7b5807bf74a9b940ed80b995e7d44d0574275a9 100644 (file)
@@ -122,6 +122,9 @@ Returns:
   PEI_CORE_INSTANCE                                     *OldCoreData;\r
   EFI_PEI_CPU_IO_PPI                                    *CpuIo;\r
   EFI_PEI_PCI_CFG2_PPI                                  *PciCfg;\r
+  UINT64                                                SecPlatformInfoRecordSize;\r
+  EFI_SEC_PLATFORM_INFORMATION_PPI                      *SecPlatformInfoPpi;\r
+  EFI_SEC_PLATFORM_INFORMATION_RECORD                   *SecPlatformInfoRecord;\r
 \r
   mTick = 0;\r
   OldCoreData = (PEI_CORE_INSTANCE *) Data;\r
@@ -234,6 +237,37 @@ Returns:
     if (PpiList != NULL) {\r
       Status = PeiServicesInstallPpi (PpiList);\r
       ASSERT_EFI_ERROR (Status);\r
+      \r
+      //\r
+      // PI spec Vol 1, 7.3.1 specifies that this same information reported by EFI_SEC_PLATFORM_INFORMATION_PPI\r
+      // will be placed in a GUIDed HOB with the PPI GUID as the HOB GUID for HOB consumer phase.\r
+      //\r
+      Status = PeiServicesLocatePpi (\r
+                 &gEfiSecPlatformInformationPpiGuid,\r
+                 0,\r
+                 NULL,\r
+                 (VOID **) &SecPlatformInfoPpi\r
+                 );\r
+      if (!EFI_ERROR (Status)) {\r
+        SecPlatformInfoRecord = AllocateZeroPool (sizeof(*SecPlatformInfoRecord));\r
+        ASSERT (SecPlatformInfoRecord != NULL);\r
+\r
+        SecPlatformInfoRecordSize = sizeof(*SecPlatformInfoRecord);\r
+        \r
+        Status = SecPlatformInfoPpi->PlatformInformation (\r
+                   (CONST EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),\r
+                   &SecPlatformInfoRecordSize,\r
+                   SecPlatformInfoRecord\r
+                   );\r
+        \r
+        if (!EFI_ERROR (Status)) {\r
+          BuildGuidDataHob (\r
+            &gEfiSecPlatformInformationPpiGuid,\r
+            SecPlatformInfoRecord,\r
+            sizeof (*SecPlatformInfoRecord)\r
+            );\r
+        }\r
+      }\r
     }\r
   }\r
 \r