From 75fe0a78aea7f450a46d958f7ad8219899574acc Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Wed, 23 Nov 2016 12:51:29 +0800 Subject: [PATCH] MdeModulePkg PeiCore: Make SetPeiServicesTablePointer() early in EntryPoint 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 Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao Reviewed-by: Star Zeng --- MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c index fed34f3552..27484bafc5 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -207,16 +207,16 @@ PeiCore ( OldCoreData->FileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->FileHandles - OldCoreData->HeapOffset); } - // - // 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 // @@ -301,16 +301,16 @@ PeiCore ( // PrivateData.Ps = &PrivateData.ServiceTableShadow; - // - // Initialize libraries that the PEI Core is linked against - // - ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.Ps); - // // Save PeiServicePointer so that it can be retrieved anywhere. // SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps); + // + // Initialize libraries that the PEI Core is linked against + // + ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.Ps); + // // Initialize PEI Core Services //