From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Mon, 15 Apr 2019 09:38:56 -0700 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ABC7A81227; Mon, 15 Apr 2019 16:38:55 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-136.rdu2.redhat.com [10.10.121.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D6805D979; Mon, 15 Apr 2019 16:38:54 +0000 (UTC) Subject: Re: [PATCH 18/25] OvmfPkg/ResetSystemLib: Add new API ResetSystem To: Zhichao Gao , devel@edk2.groups.io Cc: Jordan Justen , Ard Biesheuvel , Liming Gao References: <20190415030611.12464-1-zhichao.gao@intel.com> <20190415030611.12464-19-zhichao.gao@intel.com> From: "Laszlo Ersek" Message-ID: <10aedee2-57bb-6bf8-a82f-0c5be6738f8f@redhat.com> Date: Mon, 15 Apr 2019 18:38:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190415030611.12464-19-zhichao.gao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 15 Apr 2019 16:38:55 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 04/15/19 05:06, Zhichao Gao wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 > > Add a new API ResetSystem to this ResetSystemLib instance. > It only adds the basic functions from ResetSystemRuntimeDxe. > Lacking of this interface may cause link error, if some drivers > use this new API and link to this library instance. > Notes: > This library API only provide a basic function of reset. Full > function should use the instance in the MdeModulePkg and make > sure the depex driver is dispatched. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Liming Gao > Signed-off-by: Zhichao Gao > --- > .../Library/ResetSystemLib/ResetSystemLib.c | 43 +++++++++++++++++++ > 1 file changed, 43 insertions(+) > > diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c > index c2c7736aa8..c05a87ad51 100644 > --- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c > +++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c > @@ -140,3 +140,46 @@ ResetPlatformSpecific ( > { > ResetCold (); > } > + > +/** > + The ResetSystem function 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. > +**/ > +VOID > +EFIAPI > +ResetSystem ( > + IN EFI_RESET_TYPE ResetType, > + IN EFI_STATUS ResetStatus, > + IN UINTN DataSize, > + IN VOID *ResetData OPTIONAL > + ) > +{ > + switch (ResetType) { > + case EfiResetWarm: > + ResetWarm (); > + break; > + > + case EfiResetCold: > + ResetCold (); > + break; > + > + case EfiResetShutdown: > + ResetShutdown (); > + return ; > + > + case EfiResetPlatformSpecific: > + ResetPlatformSpecific (DataSize, ResetData); > + return; > + > + default: > + return ; > + } > +} > For patches 18/25 and 23/25]: - please replace return ; with return; (there are two instances in both patches) - with that update, for both patches: Reviewed-by: Laszlo Ersek Thanks Laszlo