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.126; helo=mga18.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 B941621B02822 for ; Tue, 18 Sep 2018 22:59:33 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2018 22:59:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,392,1531810800"; d="scan'208";a="71157272" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga007.fm.intel.com with ESMTP; 18 Sep 2018 22:59:01 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 18 Sep 2018 22:59:00 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 18 Sep 2018 22:59:00 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Wed, 19 Sep 2018 13:58:58 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , Younas khan , "Gao, Liming" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateXXXAcpiTable APIs Thread-Index: AQHUT8HmPSzaTVADgEqQLx3Qc+5h46T3HCUw Date: Wed, 19 Sep 2018 05:58:58 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AD65C83@shsmsx102.ccr.corp.intel.com> References: <1537324706-44764-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1537324706-44764-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTIyMWM0NDgtZWE3MS00YTMzLWE4ZDEtYWU5MmE4ZmYwNTZhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZHJ5VkV0S3d6SFdaVDA0R2hLb0c2cm5LREtTcTd1UHdBZ0EzRjlcLzh4blQ2d0syenQ0SjBKVnFtYlNlTU9XdUkifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateXXXAcpiTable APIs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 05:59:33 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Star Zeng > Sent: Wednesday, September 19, 2018 10:38 AM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D ; Younas khan > ; Yao, Jiewen ; > Gao, Liming ; Zeng, Star > Subject: [edk2] [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new > EfiLocateXXXAcpiTable APIs >=20 > It updates FrameworkUefiLib and is the supplement to > https://lists.01.org/pipermail/edk2-devel/2018-September/029757.html >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D967 > Request to add a library function for GetAcpiTable() in order > to get ACPI table using signature as input. >=20 > After evaluation, we found there are many duplicated code to > find ACPI table by signature in different modules. >=20 > This patch adds new EfiLocateXXXAcpiTable() APIs in UefiLib > for the request and also the following patch to remove the > duplicated code. >=20 > V2: > ASSERT(FALSE) and return NULL instead of real implementation for the > new APIs as the IntelFrameworkPkg is a to-be-deprecated packages. >=20 > Cc: Younas khan > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > Reviewed-by: Liming Gao > --- > IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c | 88 > ++++++++++++++++++++++ > .../Library/FrameworkUefiLib/FrameworkUefiLib.inf | 1 + > 2 files changed, 89 insertions(+) > create mode 100644 IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c >=20 > diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c > b/IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c > new file mode 100644 > index 000000000000..4b41abd036f9 > --- /dev/null > +++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c > @@ -0,0 +1,88 @@ > +/** @file > + This module provides help function for finding ACPI table. > + > + 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 > BSD License > + which accompanies this distribution. The full text of the license may= be > 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 IMPLIED. > + > +**/ > + > +#include "UefiLibInternal.h" > +#include > + > +/** > + This function locates next ACPI table in XSDT/RSDT based on Signature > and > + previous returned Table. > + > + If PreviousTable is NULL: > + This function will locate the first ACPI table in XSDT/RSDT based on > + Signature in gEfiAcpi20TableGuid system configuration table first, and > then > + gEfiAcpi10TableGuid system configuration table. > + This function will locate in XSDT first, and then RSDT. > + For DSDT, this function will locate XDsdt in FADT first, and then Dsdt= in > + FADT. > + For FACS, this function will locate XFirmwareCtrl in FADT first, and t= hen > + FirmwareCtrl in FADT. > + > + If PreviousTable is not NULL: > + 1. If it could be located in XSDT in gEfiAcpi20TableGuid system > configuration > + table, then this function will just locate next table in XSDT in > + gEfiAcpi20TableGuid system configuration table. > + 2. If it could be located in RSDT in gEfiAcpi20TableGuid system > configuration > + table, then this function will just locate next table in RSDT in > + gEfiAcpi20TableGuid system configuration table. > + 3. If it could be located in RSDT in gEfiAcpi10TableGuid system > configuration > + table, then this function will just locate next table in RSDT in > + gEfiAcpi10TableGuid system configuration table. > + > + It's not supported that PreviousTable is not NULL but > PreviousTable->Signature > + is not same with Signature, NULL will be returned. > + > + @param Signature ACPI table signature. > + @param PreviousTable Pointer to previous returned table to > locate next > + table, or NULL to locate first table. > + > + @return Next ACPI table or NULL if not found. > + > +**/ > +EFI_ACPI_COMMON_HEADER * > +EFIAPI > +EfiLocateNextAcpiTable ( > + IN UINT32 Signature, > + IN EFI_ACPI_COMMON_HEADER *PreviousTable OPTIONAL > + ) > +{ > + ASSERT (FALSE); > + return NULL; > +} > + > +/** > + This function locates first ACPI table in XSDT/RSDT based on Signature= . > + > + This function will locate the first ACPI table in XSDT/RSDT based on > + Signature in gEfiAcpi20TableGuid system configuration table first, and > then > + gEfiAcpi10TableGuid system configuration table. > + This function will locate in XSDT first, and then RSDT. > + For DSDT, this function will locate XDsdt in FADT first, and then Dsdt= in > + FADT. > + For FACS, this function will locate XFirmwareCtrl in FADT first, and t= hen > + FirmwareCtrl in FADT. > + > + @param Signature ACPI table signature. > + > + @return First ACPI table or NULL if not found. > + > +**/ > +EFI_ACPI_COMMON_HEADER * > +EFIAPI > +EfiLocateFirstAcpiTable ( > + IN UINT32 Signature > + ) > +{ > + return EfiLocateNextAcpiTable (Signature, NULL); > +} > diff --git > a/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf > b/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf > index 182d20fca051..086d898ee7dc 100644 > --- a/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf > +++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf > @@ -37,6 +37,7 @@ [Sources] > Console.c > UefiLib.c > UefiLibInternal.h > + Acpi.c >=20 > [Packages] > MdePkg/MdePkg.dec > -- > 2.7.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel