public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Zeng, Star" <star.zeng@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	Younas khan <pmdyounaskhan786@gmail.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateXXXAcpiTable APIs
Date: Wed, 19 Sep 2018 05:58:58 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AD65C83@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1537324706-44764-1-git-send-email-star.zeng@intel.com>

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 <michael.d.kinney@intel.com>; Younas khan
> <pmdyounaskhan786@gmail.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new
> EfiLocateXXXAcpiTable APIs
> 
> It updates FrameworkUefiLib and is the supplement to
> https://lists.01.org/pipermail/edk2-devel/2018-September/029757.html
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=967
> Request to add a library function for GetAcpiTable() in order
> to get ACPI table using signature as input.
> 
> After evaluation, we found there are many duplicated code to
> find ACPI table by signature in different modules.
> 
> This patch adds new EfiLocateXXXAcpiTable() APIs in UefiLib
> for the request and also the following patch to remove the
> duplicated code.
> 
> V2:
> ASSERT(FALSE) and return NULL instead of real implementation for the
> new APIs as the IntelFrameworkPkg is a to-be-deprecated packages.
> 
> Cc: Younas khan <pmdyounaskhan786@gmail.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> Reviewed-by: Liming Gao <liming.gao@intel.com>
> ---
>  IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c  | 88
> ++++++++++++++++++++++
>  .../Library/FrameworkUefiLib/FrameworkUefiLib.inf  |  1 +
>  2 files changed, 89 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..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.<BR>
> +  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 <IndustryStandard/Acpi.h>
> +
> +/**
> +  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 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
> +  )
> +{
> +  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 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..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
> 
>  [Packages]
>    MdePkg/MdePkg.dec
> --
> 2.7.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2018-09-19  5:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19  2:38 [PATCH] IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateXXXAcpiTable APIs Star Zeng
2018-09-19  5:58 ` Yao, Jiewen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-19  1:28 Star Zeng
2018-09-19  1:35 ` Gao, Liming
2018-09-19  2:08 ` Yao, Jiewen
2018-09-19  2:10   ` Zeng, Star
2018-09-19  2:13     ` Yao, Jiewen
2018-09-19  2:15       ` Zeng, Star
2018-09-19  2:39         ` Zeng, Star

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74D8A39837DF1E4DA445A8C0B3885C503AD65C83@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox