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.100; helo=mga07.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 22F0D2110C829 for ; Sun, 3 Jun 2018 20:26:21 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jun 2018 20:26:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,475,1520924400"; d="scan'208";a="53409394" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 03 Jun 2018 20:26:20 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 3 Jun 2018 20:26:19 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.87]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.70]) with mapi id 14.03.0319.002; Mon, 4 Jun 2018 11:25:40 +0800 From: "Ni, Ruiyu" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLib Thread-Index: AQHT+6zdIcpt0ggfTkK4zs1kUnx4RaRPbR8w Date: Mon, 4 Jun 2018 03:25:39 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BD23310@SHSMSX104.ccr.corp.intel.com> References: <20180601072212.99856-1-ruiyu.ni@intel.com> <20180601072212.99856-2-ruiyu.ni@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BB51BAE@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BB51BAE@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 03:26:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable No. DxeResetSystemLib cannot be used by runtime driver. 1. the gRT is not converted by itself. 2. Even if we change the library implementation to convert gRT in VirtualAd= dressChange callback, when DXE driver links to this library, the problem similar to UefiRuntimeLi= b still occurs. So I will make a V2 patch to remove runtime driver support. Thanks/Ray > -----Original Message----- > From: Zeng, Star > Sent: Monday, June 4, 2018 10:37 AM > To: Ni, Ruiyu ; edk2-devel@lists.01.org > Cc: Gao, Liming ; Zeng, Star > Subject: RE: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid > depending on UefiRuntimeLib >=20 > Could interfaces in DxeResetSystemLib be used by runtime code? > If yes, gRT needs to be converted for runtime environment as we discussed > about it at https://lists.01.org/pipermail/edk2-devel/2018- > February/021260.html before. >=20 >=20 >=20 > Thanks, > Star >=20 > -----Original Message----- > From: Ni, Ruiyu > Sent: Friday, June 1, 2018 3:22 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Gao, Liming > Subject: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid depending > on UefiRuntimeLib >=20 > Current DxeResetSystemLib depends on UefiRuntimeLib because it calls > EfiResetSystem() API exposed by UefiRuntimeLib. >=20 > Due to the commit XXX which reverts UefiRuntimeLib to only support > DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the > DxeResetSystemLib can be used by DXE drivers. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ruiyu Ni > Cc: Star Zeng > Cc: Liming Gao > --- > MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c | 10 > +++++----- > MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf | 3 +-- > 2 files changed, 6 insertions(+), 7 deletions(-) >=20 > diff --git > a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c > b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c > index ea452e3231..76bca223ae 100644 > --- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c > +++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c > @@ -14,7 +14,7 @@ >=20 > #include > #include > -#include > +#include >=20 > /** > This function causes a system-wide reset (cold reset), in which @@ -30= ,7 > +30,7 @@ ResetCold ( > VOID > ) > { > - EfiResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > } >=20 > /** > @@ -45,7 +45,7 @@ ResetWarm ( > VOID > ) > { > - EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL); > + gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL); > } >=20 > /** > @@ -60,7 +60,7 @@ ResetShutdown ( > VOID > ) > { > - EfiResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL); > + gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL); > } >=20 > /** > @@ -94,5 +94,5 @@ ResetPlatformSpecific ( > IN VOID *ResetData > ) > { > - EfiResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, > ResetData); > + gRT->ResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, > + ResetData); > } > diff --git > a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf > b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf > index 6eb2766b93..0d97d5899b 100644 > --- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf > +++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf > @@ -35,5 +35,4 @@ [Packages] > MdeModulePkg/MdeModulePkg.dec >=20 > [LibraryClasses] > - UefiRuntimeLib > - > + UefiRuntimeServicesTableLib > -- > 2.16.1.windows.1