]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
Fix a bug:
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain / PeiMain.c
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