]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
MdeModulePkg PeiCore: Remove the using of PcdPeiCoreMaxPpiSupported
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain / PeiMain.c
index 4869bf18f005ad0f741d8031130233c94cc9b0bf..4da80a8222bc164d60516ecda93852544fb4ae8b 100644 (file)
@@ -190,7 +190,15 @@ PeiCore (
         if (OldCoreData->CurrentFvFileHandles != NULL) {\r
           OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->CurrentFvFileHandles + OldCoreData->HeapOffset);\r
         }\r
-        OldCoreData->PpiData.PpiListPtrs  = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiListPtrs + OldCoreData->HeapOffset);\r
+        if (OldCoreData->PpiData.PpiList.PpiPtrs != NULL) {\r
+          OldCoreData->PpiData.PpiList.PpiPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiList.PpiPtrs + OldCoreData->HeapOffset);\r
+        }\r
+        if (OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs != NULL) {\r
+          OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs + OldCoreData->HeapOffset);\r
+        }\r
+        if (OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs != NULL) {\r
+          OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs + OldCoreData->HeapOffset);\r
+        }\r
         OldCoreData->Fv                   = (PEI_CORE_FV_HANDLE *) ((UINT8 *) OldCoreData->Fv + OldCoreData->HeapOffset);\r
         for (Index = 0; Index < OldCoreData->FvCount; Index ++) {\r
           if (OldCoreData->Fv[Index].PeimState != NULL) {\r
@@ -210,7 +218,15 @@ PeiCore (
         if (OldCoreData->CurrentFvFileHandles != NULL) {\r
           OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->CurrentFvFileHandles - OldCoreData->HeapOffset);\r
         }\r
-        OldCoreData->PpiData.PpiListPtrs  = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiListPtrs - OldCoreData->HeapOffset);\r
+        if (OldCoreData->PpiData.PpiList.PpiPtrs != NULL) {\r
+          OldCoreData->PpiData.PpiList.PpiPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiList.PpiPtrs - OldCoreData->HeapOffset);\r
+        }\r
+        if (OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs != NULL) {\r
+          OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.CallbackNotifyList.NotifyPtrs - OldCoreData->HeapOffset);\r
+        }\r
+        if (OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs != NULL) {\r
+          OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.DispatchNotifyList.NotifyPtrs - OldCoreData->HeapOffset);\r
+        }\r
         OldCoreData->Fv                   = (PEI_CORE_FV_HANDLE *) ((UINT8 *) OldCoreData->Fv - OldCoreData->HeapOffset);\r
         for (Index = 0; Index < OldCoreData->FvCount; Index ++) {\r
           if (OldCoreData->Fv[Index].PeimState != NULL) {\r
@@ -337,14 +353,6 @@ PeiCore (
   // Initialize PEI Core Services\r
   //\r
   InitializeMemoryServices   (&PrivateData, SecCoreData, OldCoreData);\r
-  if (OldCoreData == NULL) {\r
-    //\r
-    // Initialize PEI Core Private Data Buffer\r
-    //\r
-    PrivateData.PpiData.PpiListPtrs  = AllocateZeroPool (sizeof (PEI_PPI_LIST_POINTERS) * PcdGet32 (PcdPeiCoreMaxPpiSupported));\r
-    ASSERT (PrivateData.PpiData.PpiListPtrs != NULL);\r
-  }\r
-  InitializePpiServices      (&PrivateData,    OldCoreData);\r
 \r
   //\r
   // Update performance measurements\r
@@ -414,7 +422,7 @@ PeiCore (
     //\r
     // Process the Notify list and dispatch any notifies for the Memory Discovered PPI\r
     //\r
-    ProcessNotifyList (&PrivateData);\r
+    ProcessDispatchNotifyList (&PrivateData);\r
 \r
     PERF_INMODULE_END ("DisMem");\r
   }\r