]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
MdePkg UefiLib: Add new EfiLocateXXXAcpiTable() APIs
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index f80067f1110372127cb19a9c8b6bf05d52383a87..468bffc3cb6660ef9a4f52fc2a54aed671142352 100644 (file)
@@ -26,6 +26,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __UEFI_LIB_H__\r
 #define __UEFI_LIB_H__\r
 \r
+#include <IndustryStandard/Acpi.h>\r
+\r
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/DriverConfiguration.h>\r
 #include <Protocol/ComponentName.h>\r
@@ -1595,4 +1597,70 @@ EfiOpenFileByDevicePath (
   IN     UINT64                    OpenMode,\r
   IN     UINT64                    Attributes\r
   );\r
+\r
+/**\r
+  This function locates next ACPI table in XSDT/RSDT based on Signature and\r
+  previous returned Table.\r
+\r
+  If PreviousTable is NULL:\r
+  This function will locate the first ACPI table in XSDT/RSDT based on\r
+  Signature in gEfiAcpi20TableGuid system configuration table first, and then\r
+  gEfiAcpi10TableGuid system configuration table.\r
+  This function will locate in XSDT first, and then RSDT.\r
+  For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in\r
+  FADT.\r
+  For FACS, this function will locate XFirmwareCtrl in FADT first, and then\r
+  FirmwareCtrl in FADT.\r
+\r
+  If PreviousTable is not NULL:\r
+  1. If it could be located in XSDT in gEfiAcpi20TableGuid system configuration\r
+     table, then this function will just locate next table in XSDT in\r
+     gEfiAcpi20TableGuid system configuration table.\r
+  2. If it could be located in RSDT in gEfiAcpi20TableGuid system configuration\r
+     table, then this function will just locate next table in RSDT in\r
+     gEfiAcpi20TableGuid system configuration table.\r
+  3. If it could be located in RSDT in gEfiAcpi10TableGuid system configuration\r
+     table, then this function will just locate next table in RSDT in\r
+     gEfiAcpi10TableGuid system configuration table.\r
+\r
+  It's not supported that PreviousTable is not NULL but PreviousTable->Signature\r
+  is not same with Signature, NULL will be returned.\r
+\r
+  @param Signature          ACPI table signature.\r
+  @param PreviousTable      Pointer to previous returned table to locate next\r
+                            table, or NULL to locate first table.\r
+\r
+  @return Next ACPI table or NULL if not found.\r
+\r
+**/\r
+EFI_ACPI_COMMON_HEADER *\r
+EFIAPI\r
+EfiLocateNextAcpiTable (\r
+  IN UINT32                     Signature,\r
+  IN EFI_ACPI_COMMON_HEADER     *PreviousTable OPTIONAL\r
+  );\r
+\r
+/**\r
+  This function locates first ACPI table in XSDT/RSDT based on Signature.\r
+\r
+  This function will locate the first ACPI table in XSDT/RSDT based on\r
+  Signature in gEfiAcpi20TableGuid system configuration table first, and then\r
+  gEfiAcpi10TableGuid system configuration table.\r
+  This function will locate in XSDT first, and then RSDT.\r
+  For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in\r
+  FADT.\r
+  For FACS, this function will locate XFirmwareCtrl in FADT first, and then\r
+  FirmwareCtrl in FADT.\r
+\r
+  @param Signature          ACPI table signature.\r
+\r
+  @return First ACPI table or NULL if not found.\r
+\r
+**/\r
+EFI_ACPI_COMMON_HEADER *\r
+EFIAPI\r
+EfiLocateFirstAcpiTable (\r
+  IN UINT32                     Signature\r
+  );\r
+\r
 #endif\r