summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c')
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c92
1 files changed, 65 insertions, 27 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c
index 14ced68e64..d98573d613 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c
@@ -1,7 +1,7 @@
/** @file
ACPI Sdt Protocol Driver
- Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -191,8 +191,7 @@ SdtNotifyAcpiList (
/**
Returns a requested ACPI table.
- The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
- with the Index that was input. The following structures are not considered elements in the list of
+ The following structures are not considered elements in the list of
ACPI tables:
- Root System Description Pointer (RSD_PTR)
- Root System Description Table (RSDT)
@@ -201,42 +200,32 @@ SdtNotifyAcpiList (
member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,
the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
- @param[in] Index The zero-based index of the table to retrieve.
- @param[out] Table Pointer for returning the table buffer.
- @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
- EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
- EFI_ACPI_SDT_PROTOCOL.
- @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.
- This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
- The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()
- to uninstall the table.
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
+ @param[in] AcpiTableInstance ACPI table Instance.
+ @param[in] Index The zero-based index of the table to retrieve.
+ @param[out] Table Pointer for returning the table buffer.
+ @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
+ EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
+ EFI_ACPI_SDT_PROTOCOL.
+ @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.
+ This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
+ The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()
+ to uninstall the table.
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
**/
EFI_STATUS
-EFIAPI
-GetAcpiTable2 (
+SdtGetAcpiTable (
+ IN EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance,
IN UINTN Index,
OUT EFI_ACPI_SDT_HEADER **Table,
OUT EFI_ACPI_TABLE_VERSION *Version,
OUT UINTN *TableKey
)
{
- EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance;
UINTN TableIndex;
LIST_ENTRY *CurrentLink;
LIST_ENTRY *StartLink;
EFI_ACPI_TABLE_LIST *CurrentTable;
-
- ASSERT (Table != NULL);
- ASSERT (Version != NULL);
- ASSERT (TableKey != NULL);
-
- //
- // Get the instance of the ACPI Table
- //
- AcpiTableInstance = SdtGetAcpiTableInstance ();
-
//
// Find the table
//
@@ -271,6 +260,55 @@ GetAcpiTable2 (
}
/**
+ Returns a requested ACPI table.
+
+ The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
+ with the Index that was input. The following structures are not considered elements in the list of
+ ACPI tables:
+ - Root System Description Pointer (RSD_PTR)
+ - Root System Description Table (RSDT)
+ - Extended System Description Table (XSDT)
+ Version is updated with a bit map containing all the versions of ACPI of which the table is a
+ member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,
+ the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
+
+ @param[in] Index The zero-based index of the table to retrieve.
+ @param[out] Table Pointer for returning the table buffer.
+ @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
+ EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
+ EFI_ACPI_SDT_PROTOCOL.
+ @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.
+ This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
+ The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()
+ to uninstall the table.
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
+**/
+EFI_STATUS
+EFIAPI
+GetAcpiTable2 (
+ IN UINTN Index,
+ OUT EFI_ACPI_SDT_HEADER **Table,
+ OUT EFI_ACPI_TABLE_VERSION *Version,
+ OUT UINTN *TableKey
+ )
+{
+ EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance;
+
+ ASSERT (Table != NULL);
+ ASSERT (Version != NULL);
+ ASSERT (TableKey != NULL);
+
+ //
+ // Get the instance of the ACPI Table
+ //
+ AcpiTableInstance = SdtGetAcpiTableInstance ();
+
+ return SdtGetAcpiTable (AcpiTableInstance, Index, Table, Version, TableKey);
+}
+
+
+/**
Register a callback when an ACPI table is installed.
This function registers a function which will be called whenever a new ACPI table is installed.