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.115; helo=mga14.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 770F8207DF2AE for ; Sun, 3 Jun 2018 19:36:42 -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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jun 2018 19:36:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,473,1520924400"; d="scan'208";a="53399731" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 03 Jun 2018 19:36:41 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 3 Jun 2018 19:36:40 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 3 Jun 2018 19:36:40 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.223]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.51]) with mapi id 14.03.0319.002; Mon, 4 Jun 2018 10:36:39 +0800 From: "Zeng, Star" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zeng, Star" Thread-Topic: [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLib Thread-Index: AQHT+XlA3tJKgB0eS0yG6Y970OU146RPXADQ Date: Mon, 4 Jun 2018 02:36:38 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB51BAE@shsmsx102.ccr.corp.intel.com> References: <20180601072212.99856-1-ruiyu.ni@intel.com> <20180601072212.99856-2-ruiyu.ni@intel.com> In-Reply-To: <20180601072212.99856-2-ruiyu.ni@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 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 02:36:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Could interfaces in DxeResetSystemLib be used by runtime code? If yes, gRT needs to be converted for runtime environment as we discussed a= bout it at https://lists.01.org/pipermail/edk2-devel/2018-February/021260.h= tml before. Thanks, Star -----Original Message----- From: Ni, Ruiyu=20 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 Uef= iRuntimeLib Current DxeResetSystemLib depends on UefiRuntimeLib because it calls EfiResetSystem() API exposed by UefiRuntimeLib. Due to the commit XXX which reverts UefiRuntimeLib to only support DXE_RUNT= IME_DRIVER, removing UefiRuntimeLib dependency makes the DxeResetSystemLib = can be used by DXE drivers. 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(-) diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c b/M= deModulePkg/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, ResetDa= ta); + gRT->ResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize,=20 + 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