]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Ppi/Ppi.c
MdeModule PeiCore: Support pre memory page allocation
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Ppi / Ppi.c
index 36b8c235b2358bc28fb450cb877c668048c48d55..082c37945802f405422d10f0cccd3d3aca87809c 100644 (file)
@@ -103,7 +103,7 @@ ConvertSinglePpiPointer (
 \r
 /**\r
 \r
-  Migrate PPI Pointers from the temporary memory stack to PEI installed memory.\r
+  Migrate PPI Pointers from the temporary memory to PEI installed memory.\r
 \r
   @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size \r
                          and location of temporary RAM, the stack location and the BFV location.\r
@@ -121,6 +121,20 @@ ConvertPpiPointers (
 \r
   for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {\r
     if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) {\r
+      if (PrivateData->MemoryPages.Size != 0) {\r
+        //\r
+        // Convert PPI pointer in old memory pages\r
+        // It needs to be done before Convert PPI pointer in old Heap\r
+        //\r
+        ConvertSinglePpiPointer (\r
+          &PrivateData->PpiData.PpiListPtrs[Index],\r
+          (UINTN)PrivateData->MemoryPages.Base,\r
+          (UINTN)PrivateData->MemoryPages.Base + PrivateData->MemoryPages.Size,\r
+          PrivateData->MemoryPages.Offset,\r
+          PrivateData->MemoryPages.OffsetPositive\r
+          );\r
+      }\r
+\r
       //\r
       // Convert PPI pointer in old Heap\r
       //\r