Make SetPeiServicesTablePointer() earlier than ProcessLibraryConstructorList()
so the constructor() function can get the correct pei service table pointer.

https://bugzilla.tianocore.org/show_bug.cgi?id=238

Cc: Michael Kinney <[email protected]>
Cc: Star Zeng <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <[email protected]>
---
 MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c 
b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
index fed34f3..27484ba 100644
--- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
+++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
@@ -208,16 +208,16 @@ PeiCore (
       }
 
       //
-      // Initialize libraries that the PEI Core is linked against
-      //
-      ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES 
**)&OldCoreData->Ps);
-      
-      //
       // Fixup for PeiService's address
       //
       SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&OldCoreData->Ps);
 
       //
+      // Initialize libraries that the PEI Core is linked against
+      //
+      ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES 
**)&OldCoreData->Ps);
+
+      //
       // Update HandOffHob for new installed permanent memory
       //
       HandoffInformationTable = OldCoreData->HobList.HandoffInformationTable;
@@ -302,14 +302,14 @@ PeiCore (
   PrivateData.Ps = &PrivateData.ServiceTableShadow;
 
   //
-  // Initialize libraries that the PEI Core is linked against
+  // Save PeiServicePointer so that it can be retrieved anywhere.
   //
-  ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES 
**)&PrivateData.Ps);
+  SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps);
 
   //
-  // Save PeiServicePointer so that it can be retrieved anywhere.
+  // Initialize libraries that the PEI Core is linked against
   //
-  SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps);
+  ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES 
**)&PrivateData.Ps);
 
   //
   // Initialize PEI Core Services
-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to