From 75fe0a78aea7f450a46d958f7ad8219899574acc Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Wed, 23 Nov 2016 12:51:29 +0800 Subject: 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 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'MdeModulePkg/Core') 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 // @@ -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 -- cgit v1.2.3