From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DD22581E8C for ; Tue, 22 Nov 2016 20:51:33 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP; 22 Nov 2016 20:51:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,684,1473145200"; d="scan'208";a="34687917" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.23]) by fmsmga005.fm.intel.com with ESMTP; 22 Nov 2016 20:51:32 -0800 From: Liming Gao To: edk2-devel@lists.01.org Cc: Michael Kinney , Star Zeng Date: Wed, 23 Nov 2016 12:51:29 +0800 Message-Id: <1479876689-14868-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [Patch] MdeModulePkg PeiCore: Make SetPeiServicesTablePointer() early in EntryPoint X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2016 04:51:34 -0000 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 --- 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