From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: hao.a.wu@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Tue, 16 Apr 2019 23:37:12 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2019 23:37:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,360,1549958400"; d="scan'208";a="338344713" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 16 Apr 2019 23:37:11 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 16 Apr 2019 23:37:10 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 16 Apr 2019 23:37:10 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.92]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.153]) with mapi id 14.03.0415.000; Wed, 17 Apr 2019 14:37:08 +0800 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Gao, Zhichao" CC: Bret Barkelew , "Wang, Jian J" , "Ni, Ray" , "Zeng, Star" , "Gao, Liming" , Sean Brogan , Michael Turner Subject: Re: [edk2-devel] [PATCH V2 25/25] MdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtype Thread-Topic: [edk2-devel] [PATCH V2 25/25] MdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtype Thread-Index: AQHU9ObWeLv4G2LsGECJmMZ4f12H76Y/5ggg Date: Wed, 17 Apr 2019 06:37:08 +0000 Message-ID: References: <20190417062722.8568-1-zhichao.gao@intel.com> <20190417062722.8568-26-zhichao.gao@intel.com> In-Reply-To: <20190417062722.8568-26-zhichao.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Ga= o, > Zhichao > Sent: Wednesday, April 17, 2019 2:27 PM > To: devel@edk2.groups.io > Cc: Bret Barkelew; Wang, Jian J; Wu, Hao A; Ni, Ray; Zeng, Star; Gao, Li= ming; > Sean Brogan; Michael Turner > Subject: [edk2-devel] [PATCH V2 25/25] MdeModulePkg/ResetUtilityLib: Add= a > new API ResetSystemWithSubtype >=20 > From: Bret Barkelew >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1458 >=20 > Implement the new API ResetSystemWithSubtype. Depend on Uefi Spec > 2.8 chapter 8.5.1, the ResetData is valid while the ResetStatus > is EFI_SUCCESS regardless of the ResetType. Also change the function > ResetPlatofrmSpecificGuid to directly call ResetSystemWithSubtype > to reduce the duplicated code. >=20 > Cc: Jian J Wang > Cc: Hao Wu > Cc: Ray Ni > Cc: Star Zeng > Cc: Liming Gao > Cc: Sean Brogan > Cc: Michael Turner > Cc: Bret Barkelew > Signed-off-by: Zhichao Gao > --- > .../Library/ResetUtilityLib/ResetUtility.c | 40 ++++++++++++++++--- > 1 file changed, 34 insertions(+), 6 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c > b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c > index 59f14edadc..2b5af4b95a 100644 > --- a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c > +++ b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c > @@ -1,7 +1,7 @@ > /** @file > This contains the business logic for the module-specific Reset Helper > functions. >=20 > - Copyright (c) 2017 - 2018 Intel Corporation. All rights reserved.
> + Copyright (c) 2017 - 2019 Intel Corporation. All rights reserved.
> Copyright (c) 2016 Microsoft Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -23,9 +23,9 @@ typedef struct { > VERIFY_SIZE_OF (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, 18); >=20 > /** > - This is a shorthand helper function to reset with a subtype so that > - the caller doesn't have to bother with a function that has half a doz= en > - parameters. > + This is a shorthand helper function to reset with reset type and a su= btype > + so that the caller doesn't have to bother with a function that has ha= lf > + a dozen parameters. >=20 > This will generate a reset with status EFI_SUCCESS, a NULL string, an= d > no custom data. The subtype will be formatted in such a way that it c= an be > @@ -35,12 +35,14 @@ VERIFY_SIZE_OF > (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, 18); > are not initialized. For DXE, you can add gEfiResetArchProtocol= Guid > to your DEPEX. >=20 > + @param[in] ResetType The default EFI_RESET_TYPE of the reset. > @param[in] ResetSubtype GUID pointer for the reset subtype to be us= ed. >=20 > **/ > VOID > EFIAPI > -ResetPlatformSpecificGuid ( > +ResetSystemWithSubtype ( > + IN EFI_RESET_TYPE ResetType, > IN CONST GUID *ResetSubtype > ) > { > @@ -51,7 +53,33 @@ ResetPlatformSpecificGuid ( > (GUID *)((UINT8 *)&ResetData + OFFSET_OF > (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, ResetSubtype)), > ResetSubtype > ); > - ResetPlatformSpecific (sizeof (ResetData), &ResetData); > + > + ResetSystem (ResetType, EFI_SUCCESS, sizeof (ResetData), &ResetData); > +} > + > +/** > + This is a shorthand helper function to reset with the reset type > + 'EfiResetPlatformSpecific' and a subtype so that the caller doesn't > + have to bother with a function that has half a dozen parameters. > + > + This will generate a reset with status EFI_SUCCESS, a NULL string, an= d > + no custom data. The subtype will be formatted in such a way that it c= an be > + picked up by notification registrations and custom handlers. > + > + NOTE: This call will fail if the architectural ResetSystem underpinni= ngs > + are not initialized. For DXE, you can add gEfiResetArchProtocol= Guid > + to your DEPEX. > + > + @param[in] ResetSubtype GUID pointer for the reset subtype to be us= ed. > + > +**/ > +VOID > +EFIAPI > +ResetPlatformSpecificGuid ( > + IN CONST GUID *ResetSubtype > + ) > +{ > + ResetSystemWithSubtype (EfiResetPlatformSpecific, ResetSubtype); Thanks for addressing the comments. Reviewed-by: Hao Wu Best Regards, Hao Wu > } >=20 > /** > -- > 2.21.0.windows.1 >=20 >=20 >=20