]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Ppi/Ppi.c
MdeModulePkg PeiCore: Install SEC HOB data
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Ppi / Ppi.c
index b2ab3fbd208617359e5ffafdc6b3cca2e620cfa7..36b8c235b2358bc28fb450cb877c668048c48d55 100644 (file)
@@ -726,7 +726,9 @@ ProcessPpiListFromSec (
   IN CONST EFI_PEI_PPI_DESCRIPTOR   *PpiList\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
+  EFI_STATUS                Status;\r
+  EFI_SEC_HOB_DATA_PPI      *SecHobDataPpi;\r
+  EFI_HOB_GENERIC_HEADER    *SecHobList;\r
 \r
   for (;;) {\r
     if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES) != 0) {\r
@@ -752,5 +754,20 @@ ProcessPpiListFromSec (
 \r
     PpiList++;\r
   }\r
+\r
+  //\r
+  // If the EFI_SEC_HOB_DATA_PPI is in the list of PPIs passed to the PEI entry point,\r
+  // the PEI Foundation will call the GetHobs() member function and install all HOBs\r
+  // returned into the HOB list. It does this after installing all PPIs passed from SEC\r
+  // into the PPI database and before dispatching any PEIMs.\r
+  //\r
+  Status = PeiLocatePpi (PeiServices, &gEfiSecHobDataPpiGuid, 0, NULL, (VOID **) &SecHobDataPpi);\r
+  if (!EFI_ERROR (Status)) {\r
+    Status = SecHobDataPpi->GetHobs (SecHobDataPpi, &SecHobList);\r
+    if (!EFI_ERROR (Status)) {\r
+      Status = PeiInstallSecHobData (PeiServices, SecHobList);\r
+      ASSERT_EFI_ERROR (Status);\r
+    }\r
+  }\r
 }\r
 \r