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.31; helo=mga06.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 B3D5921B02822 for ; Tue, 18 Sep 2018 19:39:50 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2018 19:39:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,392,1531810800"; d="scan'208";a="81558480" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 18 Sep 2018 19:39:42 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 18 Sep 2018 19:39:42 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Wed, 19 Sep 2018 10:39:40 +0800 From: "Zeng, Star" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: Younas khan , "Kinney, Michael D" , "Gao, Liming" , "Zeng, Star" Thread-Topic: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateXXXAcpiTable APIs Thread-Index: AQHUT7gGuihTDp3Sa0ixEedUb2FShKT2VaMAgACGjHD//3rfAIAAhoJggAAG4OA= Date: Wed, 19 Sep 2018 02:39:39 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BBBB53A@shsmsx102.ccr.corp.intel.com> References: <1537320482-37324-1-git-send-email-star.zeng@intel.com> <74D8A39837DF1E4DA445A8C0B3885C503AD657B6@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BBBB4D5@shsmsx102.ccr.corp.intel.com> <74D8A39837DF1E4DA445A8C0B3885C503AD65813@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BBBB4F9@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BBBB4F9@shsmsx102.ccr.corp.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] 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 02:39:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Just sent V2 patch at https://lists.01.org/pipermail/edk2-devel/2018-Septem= ber/029849.html with this idea. Thanks, Star -----Original Message----- From: Zeng, Star=20 Sent: Wednesday, September 19, 2018 10:15 AM To: Yao, Jiewen ; edk2-devel@lists.01.org Cc: Younas khan ; Kinney, Michael D ; Gao, Liming ; Zeng, Star Subject: RE: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateX= XXAcpiTable APIs I think it is a good idea. Thanks, Star -----Original Message----- From: Yao, Jiewen Sent: Wednesday, September 19, 2018 10:13 AM To: Zeng, Star ; edk2-devel@lists.01.org Cc: Younas khan ; Kinney, Michael D ; Gao, Liming Subject: RE: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateX= XXAcpiTable APIs Yes. > -----Original Message----- > From: Zeng, Star > Sent: Wednesday, September 19, 2018 10:11 AM > To: Yao, Jiewen ; edk2-devel@lists.01.org > Cc: Younas khan ; Kinney, Michael D=20 > ; Gao, Liming ;=20 > Zeng, Star > Subject: RE: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new=20 > EfiLocateXXXAcpiTable APIs >=20 > You mean like below for the case? > ASSERT(FALSE); > return NULL; >=20 > Thanks, > Star > -----Original Message----- > From: Yao, Jiewen > Sent: Wednesday, September 19, 2018 10:08 AM > To: Zeng, Star ; edk2-devel@lists.01.org > Cc: Younas khan ; Kinney, Michael D=20 > ; Gao, Liming > Subject: RE: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new=20 > EfiLocateXXXAcpiTable APIs >=20 > Hi > I do not recommend we add more new feature to a to-be-deprecated=20 > package. >=20 > Can we just return UNSUPPORTED? >=20 >=20 > > -----Original Message----- > > From: Zeng, Star > > Sent: Wednesday, September 19, 2018 9:28 AM > > To: edk2-devel@lists.01.org > > Cc: Zeng, Star ; Younas khan=20 > > ; Kinney, Michael D=20 > > ; Gao, Liming ;=20 > > Yao, Jiewen > > Subject: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new=20 > > EfiLocateXXXAcpiTable APIs > > > > It updates FrameworkUefiLib and is the supplement to=20 > > https://lists.01.org/pipermail/edk2-devel/2018-September/029757.html > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D967 > > Request to add a library function for GetAcpiTable() in order to get=20 > > ACPI table using signature as input. > > > > After evaluation, we found there are many duplicated code to find=20 > > ACPI table by signature in different modules. > > > > This patch adds new EfiLocateXXXAcpiTable() APIs in UefiLib for the=20 > > request and also the following patch to remove the duplicated code. > > > > 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 > > --- > > IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c | 428 > > +++++++++++++++++++++ > > .../Library/FrameworkUefiLib/FrameworkUefiLib.inf | 3 + > > 2 files changed, 431 insertions(+) > > create mode 100644 > IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c > > > > diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c > > b/IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c > > new file mode 100644 > > index 000000000000..e16ccc7e7b74 > > --- /dev/null > > +++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c > > @@ -0,0 +1,428 @@ > > +/** @file > > + This module provides help function for finding ACPI table. > > + > > + Copyright (c) 2018, Intel Corporation. All rights reserved.
=20 > > + This program and the accompanying materials are licensed and made=20 > > + available under the terms and conditions of the > > BSD License > > + which accompanies this distribution. The full text of the=20 > > + 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 > > +#include > > + > > +/** > > + This function scans ACPI table in XSDT/RSDT. > > + > > + @param Sdt ACPI XSDT/RSDT. > > + @param TablePointerSize Size of table pointer: 8(XSDT) or > > 4(RSDT). > > + @param Signature ACPI table signature. > > + @param PreviousTable Pointer to previous returned table > to > > locate > > + next table, or NULL to locate first > > table. > > + @param PreviousTableLocated Pointer to the indicator about > > whether the > > + previous returned table could be > > located, or > > + NULL if PreviousTable is NULL. > > + > > + If PreviousTable is NULL and PreviousTableLocated is not NULL,=20 > > + then > > ASSERT(). > > + If PreviousTable is not NULL and PreviousTableLocated is NULL,=20 > > + then > > ASSERT(). > > + > > + @return ACPI table or NULL if not found. > > + > > +**/ > > +EFI_ACPI_COMMON_HEADER * > > +ScanTableInSDT ( > > + IN EFI_ACPI_DESCRIPTION_HEADER *Sdt, > > + IN UINTN TablePointerSize, > > + IN UINT32 Signature, > > + IN EFI_ACPI_COMMON_HEADER *PreviousTable, > OPTIONAL > > + OUT BOOLEAN *PreviousTableLocated > > OPTIONAL > > + ) > > +{ > > + UINTN Index; > > + UINTN EntryCount; > > + UINT64 EntryPtr; > > + UINTN BasePtr; > > + EFI_ACPI_COMMON_HEADER *Table; > > + > > + if (PreviousTableLocated !=3D NULL) { > > + ASSERT (PreviousTable !=3D NULL); > > + *PreviousTableLocated =3D FALSE; > > + } else { > > + ASSERT (PreviousTable =3D=3D NULL); } > > + > > + if (Sdt =3D=3D NULL) { > > + return NULL; > > + } > > + > > + EntryCount =3D (Sdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) > / > > TablePointerSize; > > + > > + BasePtr =3D (UINTN)(Sdt + 1); > > + for (Index =3D 0; Index < EntryCount; Index ++) { > > + EntryPtr =3D 0; > > + CopyMem (&EntryPtr, (VOID *)(BasePtr + Index *=20 > > + TablePointerSize), > > TablePointerSize); > > + Table =3D (EFI_ACPI_COMMON_HEADER *)((UINTN)(EntryPtr)); > > + if (Table->Signature =3D=3D Signature) { > > + if (PreviousTable !=3D NULL) { > > + if (Table =3D=3D PreviousTable) { > > + *PreviousTableLocated =3D TRUE; > > + } else if (*PreviousTableLocated) { > > + // > > + // Return next table. > > + // > > + return Table; > > + } > > + } else { > > + // > > + // Return first table. > > + // > > + return Table; > > + } > > + > > + } > > + } > > + > > + return NULL; > > +} > > + > > +/** > > + To locate FACS in FADT. > > + > > + @param Fadt FADT table pointer. > > + > > + @return FACS table pointer or NULL if not found. > > + > > +**/ > > +EFI_ACPI_COMMON_HEADER * > > +LocateAcpiFacsFromFadt ( > > + IN EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt > > + ) > > +{ > > + EFI_ACPI_COMMON_HEADER *Facs; > > + UINT64 Data64; > > + > > + if (Fadt =3D=3D NULL) { > > + return NULL; > > + } > > + > > + if (Fadt->Header.Revision < > > EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) { > > + Facs =3D (EFI_ACPI_COMMON_HEADER *)(UINTN)Fadt->FirmwareCtrl; }=20 > > + else { > > + CopyMem (&Data64, &Fadt->XFirmwareCtrl, sizeof(UINT64)); > > + if (Data64 !=3D 0) { > > + Facs =3D (EFI_ACPI_COMMON_HEADER *)(UINTN)Data64; > > + } else { > > + Facs =3D (EFI_ACPI_COMMON_HEADER > *)(UINTN)Fadt->FirmwareCtrl; > > + } > > + } > > + return Facs; > > +} > > + > > +/** > > + To locate DSDT in FADT. > > + > > + @param Fadt FADT table pointer. > > + > > + @return DSDT table pointer or NULL if not found. > > + > > +**/ > > +EFI_ACPI_COMMON_HEADER * > > +LocateAcpiDsdtFromFadt ( > > + IN EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt > > + ) > > +{ > > + EFI_ACPI_COMMON_HEADER *Dsdt; > > + UINT64 Data64; > > + > > + if (Fadt =3D=3D NULL) { > > + return NULL; > > + } > > + > > + if (Fadt->Header.Revision < > > EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) { > > + Dsdt =3D (EFI_ACPI_COMMON_HEADER *)(UINTN)Fadt->Dsdt; > > + } else { > > + CopyMem (&Data64, &Fadt->XDsdt, sizeof(UINT64)); > > + if (Data64 !=3D 0) { > > + Dsdt =3D (EFI_ACPI_COMMON_HEADER *)(UINTN)Data64; > > + } else { > > + Dsdt =3D (EFI_ACPI_COMMON_HEADER *)(UINTN)Fadt->Dsdt; > > + } > > + } > > + return Dsdt; > > +} > > + > > +/** > > + To locate ACPI table in ACPI ConfigurationTable. > > + > > + @param AcpiTableGuid The GUID used to get ACPI > > ConfigurationTable. > > + @param Signature ACPI table signature. > > + @param PreviousTable Pointer to previous returned table > to > > locate > > + next table, or NULL to locate first > > table. > > + @param PreviousTableLocated Pointer to the indicator to return > > whether the > > + previous returned table could be > > located or not, > > + or NULL if PreviousTable is NULL. > > + > > + If PreviousTable is NULL and PreviousTableLocated is not NULL,=20 > > + then > > ASSERT(). > > + If PreviousTable is not NULL and PreviousTableLocated is NULL,=20 > > + then > > ASSERT(). > > + If AcpiGuid is NULL, then ASSERT(). > > + > > + @return ACPI table or NULL if not found. > > + > > +**/ > > +EFI_ACPI_COMMON_HEADER * > > +LocateAcpiTableInAcpiConfigurationTable ( > > + IN EFI_GUID *AcpiGuid, > > + IN UINT32 Signature, > > + IN EFI_ACPI_COMMON_HEADER *PreviousTable, OPTIONAL > > + OUT BOOLEAN *PreviousTableLocated > OPTIONAL > > + ) > > +{ > > + EFI_STATUS Status; > > + EFI_ACPI_COMMON_HEADER *Table; > > + EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; > > + EFI_ACPI_DESCRIPTION_HEADER *Rsdt; > > + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; > > + EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt; > > + > > + if (PreviousTableLocated !=3D NULL) { > > + ASSERT (PreviousTable !=3D NULL); > > + *PreviousTableLocated =3D FALSE; > > + } else { > > + ASSERT (PreviousTable =3D=3D NULL); } > > + > > + Rsdp =3D NULL; > > + // > > + // Get ACPI ConfigurationTable (RSD_PTR) // Status =3D=20 > > + EfiGetSystemConfigurationTable(AcpiGuid, (VOID **)&Rsdp); if=20 > > + (EFI_ERROR (Status) || (Rsdp =3D=3D NULL)) { > > + return NULL; > > + } > > + > > + Table =3D NULL; > > + > > + // > > + // Search XSDT > > + // > > + if (Rsdp->Revision >=3D > > EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) { > > + Xsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN) > > Rsdp->XsdtAddress; > > + if (Signature =3D=3D > > > EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE > ) > > { > > + ASSERT (PreviousTable =3D=3D NULL); > > + // > > + // It is to locate DSDT, > > + // need to locate FADT first. > > + // > > + Fadt =3D (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *) > > ScanTableInSDT ( > > + Xsdt, > > + sizeof (UINT64), > > + > > EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, > > + NULL, > > + NULL > > + ); > > + Table =3D LocateAcpiDsdtFromFadt (Fadt); > > + } else if (Signature =3D=3D > > EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) { > > + ASSERT (PreviousTable =3D=3D NULL); > > + // > > + // It is to locate FACS, > > + // need to locate FADT first. > > + // > > + Fadt =3D (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *) > > ScanTableInSDT ( > > + Xsdt, > > + sizeof (UINT64), > > + > > EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, > > + NULL, > > + NULL > > + ); > > + Table =3D LocateAcpiFacsFromFadt (Fadt); > > + } else { > > + Table =3D ScanTableInSDT ( > > + Xsdt, > > + sizeof (UINT64), > > + Signature, > > + PreviousTable, > > + PreviousTableLocated > > + ); > > + } > > + } > > + > > + if (Table !=3D NULL) { > > + return Table; > > + } else if ((PreviousTableLocated !=3D NULL) && > > + *PreviousTableLocated) { > > + // > > + // PreviousTable could be located in XSDT, > > + // but next table could not be located in XSDT. > > + // > > + return NULL; > > + } > > + > > + // > > + // Search RSDT > > + // > > + Rsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN) > Rsdp->RsdtAddress; > > + if (Signature =3D=3D > > > EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE > ) > > { > > + ASSERT (PreviousTable =3D=3D NULL); > > + // > > + // It is to locate DSDT, > > + // need to locate FADT first. > > + // > > + Fadt =3D (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *) > > ScanTableInSDT ( > > + Rsdt, > > + sizeof (UINT32), > > + > > EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, > > + NULL, > > + NULL > > + ); > > + Table =3D LocateAcpiDsdtFromFadt (Fadt); } else if (Signature =3D= =3D > > EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) { > > + ASSERT (PreviousTable =3D=3D NULL); > > + // > > + // It is to locate FACS, > > + // need to locate FADT first. > > + // > > + Fadt =3D (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *) > > ScanTableInSDT ( > > + Rsdt, > > + sizeof (UINT32), > > + > > EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, > > + NULL, > > + NULL > > + ); > > + Table =3D LocateAcpiFacsFromFadt (Fadt); } else { > > + Table =3D ScanTableInSDT ( > > + Rsdt, > > + sizeof (UINT32), > > + Signature, > > + PreviousTable, > > + PreviousTableLocated > > + ); > > + } > > + > > + return Table; > > +} > > + > > +/** > > + This function locates next ACPI table in XSDT/RSDT based on=20 > > +Signature > > and > > + previous returned Table. > > + > > + If PreviousTable is NULL: > > + This function will locate the first ACPI table in XSDT/RSDT based=20 > > + on Signature in gEfiAcpi20TableGuid system configuration table=20 > > + 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=20 > > + Dsdt in FADT. > > + For FACS, this function will locate XFirmwareCtrl in FADT first,=20 > > + and then 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 > > + ) > > +{ > > + EFI_ACPI_COMMON_HEADER *Table; > > + BOOLEAN TempPreviousTableLocated; > > + BOOLEAN *PreviousTableLocated; > > + > > + if (PreviousTable !=3D NULL) { > > + if (PreviousTable->Signature !=3D Signature) { > > + // > > + // PreviousTable->Signature is not same with Signature. > > + // > > + return NULL; > > + } else if ((Signature =3D=3D > > EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) || > > + (Signature =3D=3D > > > EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE > ) > > || > > + (Signature =3D=3D > > EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE)) { > > + // > > + // There is only one FADT/DSDT/FACS table, > > + // so don't try to locate next one. > > + // > > + return NULL; > > + } > > + > > + PreviousTableLocated =3D &TempPreviousTableLocated; > > + *PreviousTableLocated =3D FALSE; > > + } else { > > + PreviousTableLocated =3D NULL; > > + } > > + > > + Table =3D LocateAcpiTableInAcpiConfigurationTable ( > > + &gEfiAcpi20TableGuid, > > + Signature, > > + PreviousTable, > > + PreviousTableLocated > > + ); > > + if (Table !=3D NULL) { > > + return Table; > > + } else if ((PreviousTableLocated !=3D NULL) && > > + *PreviousTableLocated) { > > + // > > + // PreviousTable could be located in gEfiAcpi20TableGuid system > > + // configuration table, but next table could not be located in > > + // gEfiAcpi20TableGuid system configuration table. > > + // > > + return NULL; > > + } > > + > > + return LocateAcpiTableInAcpiConfigurationTable ( > > + &gEfiAcpi10TableGuid, > > + Signature, > > + PreviousTable, > > + PreviousTableLocated > > + ); > > +} > > + > > +/** > > + This function locates first ACPI table in XSDT/RSDT based on Signatu= re. > > + > > + This function will locate the first ACPI table in XSDT/RSDT based=20 > > + on Signature in gEfiAcpi20TableGuid system configuration table=20 > > + 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=20 > > + Dsdt in FADT. > > + For FACS, this function will locate XFirmwareCtrl in FADT first,=20 > > + and then 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..2d333b1b4b2a 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 > > > > [Packages] > > MdePkg/MdePkg.dec > > @@ -55,6 +56,8 @@ [LibraryClasses] > > [Guids] > > gEfiEventReadyToBootGuid ## > > SOMETIMES_CONSUMES ## Event > > gEfiEventLegacyBootGuid ## > > SOMETIMES_CONSUMES ## Event > > + gEfiAcpi20TableGuid ## > > SOMETIMES_CONSUMES ## SystemTable > > + gEfiAcpi10TableGuid ## > > SOMETIMES_CONSUMES ## SystemTable > > > > [Protocols] > > gEfiDriverBindingProtocolGuid ## > > SOMETIMES_PRODUCES > > -- > > 2.7.0.windows.1