From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 B666E22393634 for ; Thu, 1 Feb 2018 22:39:56 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 22:45:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,447,1511856000"; d="scan'208";a="14900485" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.19]) by fmsmga008.fm.intel.com with ESMTP; 01 Feb 2018 22:45:33 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Michael D Kinney , Liming Gao , Star Zeng Date: Fri, 2 Feb 2018 14:45:22 +0800 Message-Id: <20180202064530.407028-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.1.windows.2 In-Reply-To: <20180202064530.407028-1-ruiyu.ni@intel.com> References: <20180202064530.407028-1-ruiyu.ni@intel.com> Subject: [PATCH 02/10] MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2018 06:39:57 -0000 From: Michael D Kinney Update PEI Service ResetSystem() to always attempt to use the Reset2 PPI before looking for the Reset PPI. Cc: Liming Gao Reviewed-by: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney --- MdeModulePkg/Core/Pei/Reset/Reset.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Reset/Reset.c b/MdeModulePkg/Core/Pei/Reset/Reset.c index 7440eefd78..cd36c526b5 100644 --- a/MdeModulePkg/Core/Pei/Reset/Reset.c +++ b/MdeModulePkg/Core/Pei/Reset/Reset.c @@ -35,16 +35,21 @@ PeiResetSystem ( EFI_STATUS Status; EFI_PEI_RESET_PPI *ResetPpi; - Status = PeiServicesLocatePpi ( - &gEfiPeiResetPpiGuid, - 0, - NULL, - (VOID **)&ResetPpi - ); + // + // Attempt to use newer ResetSystem2(). If this returns, then ResetSystem2() + // is not available. + // + PeiResetSystem2 (EfiResetCold, EFI_SUCCESS, 0, NULL); // - // LocatePpi returns EFI_NOT_FOUND on error + // Look for PEI Reset System PPI // + Status = PeiServicesLocatePpi ( + &gEfiPeiResetPpiGuid, + 0, + NULL, + (VOID **)&ResetPpi + ); if (!EFI_ERROR (Status)) { return ResetPpi->ResetSystem (PeiServices); } @@ -55,6 +60,10 @@ PeiResetSystem ( EFI_ERROR_CODE | EFI_ERROR_MINOR, (EFI_SOFTWARE_PEI_CORE | EFI_SW_PS_EC_RESET_NOT_AVAILABLE) ); + + // + // No reset PPIs are available yet. + // return EFI_NOT_AVAILABLE_YET; } @@ -85,6 +94,9 @@ PeiResetSystem2 ( EFI_STATUS Status; EFI_PEI_RESET2_PPI *Reset2Ppi; + // + // Look for PEI Reset System 2 PPI + // Status = PeiServicesLocatePpi ( &gEfiPeiReset2PpiGuid, 0, -- 2.15.1.windows.2