From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 18CAB223972A0 for ; Wed, 7 Feb 2018 03:31:49 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 03:37:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="28100749" Received: from shzintpr02.sh.intel.com (HELO [10.253.24.48]) ([10.239.4.160]) by fmsmga004.fm.intel.com with ESMTP; 07 Feb 2018 03:37:31 -0800 To: Ruiyu Ni , edk2-devel@lists.01.org Cc: Michael D Kinney , Liming Gao , star.zeng@intel.com References: <20180202064530.407028-1-ruiyu.ni@intel.com> <20180202064530.407028-2-ruiyu.ni@intel.com> From: "Zeng, Star" Message-ID: <14695759-6134-7d0a-e92e-80ed332b8ebd@intel.com> Date: Wed, 7 Feb 2018 19:37:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180202064530.407028-2-ruiyu.ni@intel.com> Subject: Re: [PATCH 01/10] MdePkg/PeiServicesLib: Add PeiServicesResetSystem2() 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: Wed, 07 Feb 2018 11:31:50 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2018/2/2 14:45, Ruiyu Ni wrote: > From: Michael D Kinney > > Add the PeiServicesResetSytstem2() function to the PeiServiesLib > to call the ResetSystem2() services in the PEI Services Table. > > Cc: Liming Gao > Cc: Ruiyu Ni > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Michael D Kinney > Signed-off-by: Ruiyu Ni Reviewed-by: Star Zeng Thanks, Star > --- > MdePkg/Include/Library/PeiServicesLib.h | 24 ++++++++++++++++++++++++ > MdePkg/Library/PeiServicesLib/PeiServicesLib.c | 26 ++++++++++++++++++++++++++ > 2 files changed, 50 insertions(+) > > diff --git a/MdePkg/Include/Library/PeiServicesLib.h b/MdePkg/Include/Library/PeiServicesLib.h > index 9fc22a10c1..0be72237f2 100644 > --- a/MdePkg/Include/Library/PeiServicesLib.h > +++ b/MdePkg/Include/Library/PeiServicesLib.h > @@ -540,4 +540,28 @@ PeiServicesInstallFvInfo2Ppi ( > IN UINT32 AuthenticationStatus > ); > > +/** > + Resets the entire platform. > + > + @param[in] ResetType The type of reset to perform. > + @param[in] ResetStatus The status code for the reset. > + @param[in] DataSize The size, in bytes, of ResetData. > + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown > + the data buffer starts with a Null-terminated string, optionally > + followed by additional binary data. The string is a description > + that the caller may use to further indicate the reason for the > + system reset. ResetData is only valid if ResetStatus is something > + other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific > + where a minimum amount of ResetData is always required. > + > +**/ > +VOID > +EFIAPI > +PeiServicesResetSystem2 ( > + IN EFI_RESET_TYPE ResetType, > + IN EFI_STATUS ResetStatus, > + IN UINTN DataSize, > + IN VOID *ResetData OPTIONAL > + ); > + > #endif > diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c > index 89166ccd38..d0838ed709 100644 > --- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c > +++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c > @@ -789,3 +789,29 @@ PeiServicesInstallFvInfo2Ppi ( > InternalPeiServicesInstallFvInfoPpi (FALSE, FvFormat, FvInfo, FvInfoSize, ParentFvName, ParentFileName, AuthenticationStatus); > } > > +/** > + Resets the entire platform. > + > + @param[in] ResetType The type of reset to perform. > + @param[in] ResetStatus The status code for the reset. > + @param[in] DataSize The size, in bytes, of ResetData. > + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown > + the data buffer starts with a Null-terminated string, optionally > + followed by additional binary data. The string is a description > + that the caller may use to further indicate the reason for the > + system reset. ResetData is only valid if ResetStatus is something > + other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific > + where a minimum amount of ResetData is always required. > + > +**/ > +VOID > +EFIAPI > +PeiServicesResetSystem2 ( > + IN EFI_RESET_TYPE ResetType, > + IN EFI_STATUS ResetStatus, > + IN UINTN DataSize, > + IN VOID *ResetData OPTIONAL > + ) > +{ > + (*GetPeiServicesTablePointer())->ResetSystem2 (ResetType, ResetStatus, DataSize, ResetData); > +} >