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=star.zeng@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 4C297203B8597 for ; Wed, 9 May 2018 02:32:39 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 02:32:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,381,1520924400"; d="scan'208";a="39584543" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga007.jf.intel.com with ESMTP; 09 May 2018 02:32:37 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 9 May 2018 02:32:37 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 9 May 2018 02:32:36 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.40]) with mapi id 14.03.0319.002; Wed, 9 May 2018 17:32:34 +0800 From: "Zeng, Star" To: "Marvin.Haeuser@outlook.com" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Kinney, Michael D" , "Laszlo Ersek (lersek@redhat.com)" , "Ni, Ruiyu" , "Dong, Eric" , "Zeng, Star" Thread-Topic: [PATCH 1/2] MdeModulePkg: Add PlatformAcpiLib LibraryClass. Thread-Index: AQHT5yPk+OtHJaVgR0WrYxIFBUV3I6QnHwkA Date: Wed, 9 May 2018 09:32:33 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BAE9AE2@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 1/2] MdeModulePkg: Add PlatformAcpiLib LibraryClass. 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: Wed, 09 May 2018 09:32:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Marvin, It is good direction to reuse more code. What am I concerning about are 1. There are comments "Sample ACPI Platform Driver" in AcpiPlatformDxe.inf = and AcpiPlatformDxe.c, the current position of AcpiPlatformDxe seems just f= or reference. 2. Almost all the platforms have their own AcpiPlatformDxe, for example https://github.com/tianocore/edk2/tree/master/OvmfPkg/AcpiPlatformDxe https://github.com/tianocore/edk2/tree/master/QuarkPlatformPkg/Acpi/Dxe/Acp= iPlatform https://github.com/tianocore/edk2/tree/master/Vlv2TbltDevicePkg/AcpiPlatfor= m ... Should more evaluation be done on them to see whether we can do more or we = just suggest platform should implement its own AcpiPlatformDxe? Including more experts. Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Marv= in H?user Sent: Wednesday, May 9, 2018 7:26 AM To: edk2-devel@lists.01.org Cc: Ni, Ruiyu ; Dong, Eric ; Zeng,= Star Subject: [edk2] [PATCH 1/2] MdeModulePkg: Add PlatformAcpiLib LibraryClass. PlatformAcpiLib can be consumed by the generic ACPI Platform driver to allow platform specific updates to the ACPI tables loaded from the configured Firmware Volume. This allows for more platforms to incorporate the generic ACPI Platform driver. This commit also provides a NULL implementation of PlatformAcpiLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser --- MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLibNull.c |= 36 ++++++++++++++++++++ MdeModulePkg/Include/Library/PlatformAcpiLib.h |= 36 ++++++++++++++++++++ MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLibNull.inf |= 35 +++++++++++++++++++ MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLibNull.uni |= 18 ++++++++++ MdeModulePkg/MdeModulePkg.dec |= 4 +++ MdeModulePkg/MdeModulePkg.dsc |= 2 ++ 6 files changed, 131 insertions(+) diff --git a/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiL= ibNull.c b/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLib= Null.c new file mode 100644 index 000000000000..5d5d0d051e1b --- /dev/null +++ b/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLibNull.= c @@ -0,0 +1,36 @@ +/** @file + Null Platform ACPI Library instance. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made availabl= e under=20 +the terms and conditions of the BSD License that accompanies this distribu= tion. =20 +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. = =20 + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. + +**/ + +#include + +#include + +/** + Performs platform specific updates to CurrentTable. + + @param[in,out] CurrentTable The table to perform updates on. + + @retval RETURN_SUCCESS The platform specific ACPI table updates were ap= plied + successfully. + @retval other The platform specific ACPI table updates could n= ot be + applied. + =20 +**/ +RETURN_STATUS +PlatformAcpiUpdateTable ( + IN OUT EFI_ACPI_COMMON_HEADER *CurrentTable + ) +{ + return RETURN_SUCCESS; +} diff --git a/MdeModulePkg/Include/Library/PlatformAcpiLib.h b/MdeModulePkg/= Include/Library/PlatformAcpiLib.h new file mode 100644 index 000000000000..a3e367f3ab61 --- /dev/null +++ b/MdeModulePkg/Include/Library/PlatformAcpiLib.h @@ -0,0 +1,36 @@ +/** @file + Platform ACPI library. Platform can provide an implementation of this + library class to provide an ACPI table update routine that may be requir= ed + for some type of platform initialization. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made availabl= e under=20 +the terms and conditions of the BSD License that accompanies this distribu= tion. =20 +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. = =20 + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. + +**/ + +#ifndef __PLATFORM_ACPI_LIB__ +#define __PLATFORM_ACPI_LIB__ + +/** + Performs platform specific updates to CurrentTable. + + @param[in,out] CurrentTable The table to perform updates on. + + @retval RETURN_SUCCESS The platform specific ACPI table updates were ap= plied + successfully. + @retval other The platform specific ACPI table updates could n= ot be + applied. + =20 +**/ +RETURN_STATUS +PlatformAcpiUpdateTable ( + IN OUT EFI_ACPI_COMMON_HEADER *CurrentTable + ); + +#endif // __PLATFORM_ACPI_LIB__ diff --git a/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiL= ibNull.inf b/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiL= ibNull.inf new file mode 100644 index 000000000000..a548ecdd91a7 --- /dev/null +++ b/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLibNull.= inf @@ -0,0 +1,35 @@ +## @file +# Null Platform ACPI Library instance. +# +# Copyright (c) 2018, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may b= e found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BasePlatformAcpiLibNull + MODULE_UNI_FILE =3D BasePlatformAcpiLibNull.uni + FILE_GUID =3D 0957C6BA-0559-46E8-8180-CD0317F0AEE7 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformAcpiLib + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC +# + +[Sources] + BasePlatformAcpiLibNull.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec diff --git a/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiL= ibNull.uni b/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiL= ibNull.uni new file mode 100644 index 000000000000..d709a3cad8b5 --- /dev/null +++ b/MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLibNull.= uni @@ -0,0 +1,18 @@ +// /** @file +// Null Platform ACPI Library instance. +// +// Null Platform ACPI Library instance. +// +// Copyright (c) 2018, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials +// are licensed and made available under the terms and conditions of the B= SD License +// which accompanies this distribution. The full text of the license may b= e found at +// http://opensource.org/licenses/bsd-license.php +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +// +// **/ + +#string STR_MODULE_ABSTRACT #language en-US "Null Platform ACPI Librar= y instance" +#string STR_MODULE_DESCRIPTION #language en-US "Null Platform ACPI Librar= y instance." diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index cc397185f7b9..8e3d392b3314 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -93,6 +93,10 @@ [LibraryClasses] # DebugAgentLib|Include/Library/DebugAgentLib.h =20 + ## @libraryclass Provide platform specific ACPI Table update functions= . + # + PlatformAcpiLib|Include/Library/PlatformAcpiLib.h + ## @libraryclass Provide platform specific hooks. # PlatformHookLib|Include/Library/PlatformHookLib.h diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index ec24a50c7d0a..b18506a9af9c 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -91,6 +91,7 @@ [LibraryClasses] PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeC= offExtraActionLibNull.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.i= nf + PlatformAcpiLib|MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatfor= mAcpiLibNull.inf PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSyst= emLibNull.inf SmbusLib|MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf @@ -300,6 +301,7 @@ [Components] MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatu= sCodeLib.inf MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf + MdeModulePkg/Library/BasePlatformAcpiLibNull/BasePlatformAcpiLibNull.inf MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelL= ib.inf MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf --=20 2.17.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel