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.43; helo=mga05.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 0C83620946094 for ; Sun, 6 May 2018 18:51:54 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 May 2018 18:51:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,372,1520924400"; d="scan'208";a="226286117" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 06 May 2018 18:51:51 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 6 May 2018 18:51:50 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.240]) with mapi id 14.03.0319.002; Mon, 7 May 2018 09:51:48 +0800 From: "Zeng, Star" To: "Marvin.Haeuser@outlook.com" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Ni, Ruiyu" , "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution. Thread-Index: AQHT5Hz51KYH6V+BOUSJX4ItxbLHQaQjgqHA Date: Mon, 7 May 2018 01:51:48 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BAE7857@shsmsx102.ccr.corp.intel.com> References: In-Reply-To: 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] MdeModulePkg/AcpiPlatformDxe: Unload after execution. 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, 07 May 2018 01:51:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable It is a good change. :) Only one minor comment. How about using EFI_REQUEST_UNLOAD_IMAGE instead? /// /// If this value is returned by an EFI image, then the image should be unl= oaded. /// #define EFI_REQUEST_UNLOAD_IMAGE DXE_ERROR (1) Thanks, Star -----Original Message----- From: Marvin H=E4user [mailto:Marvin.Haeuser@outlook.com]=20 Sent: Saturday, May 5, 2018 10:26 PM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Dong, Eric ; Ni,= Ruiyu Subject: [PATCH] MdeModulePkg/AcpiPlatformDxe: Unload after execution. AcpiPlatformDxe solely performs one-time tasks and does not expose any serv= ices or create any events. Hence it can safely be unloaded after the Entry = Point execution by returning an error code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser --- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c b/M= deModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c index 44bdd94fa8db..8772961bfd31 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c +++ b/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatform.c @@ -1,7 +1,7 @@ /** @file Sample ACPI Platform Driver =20 - Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2018, Intel Corporation. All rights=20 + reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -255,6 +255,9 @@ AcpiPlatformEntryPoint ( } } =20 - return EFI_SUCCESS; + // + // Return an error code so that the driver is unloaded. + // + return EFI_ALREADY_STARTED; } =20 -- 2.17.0.windows.1