summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Include
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2021-10-08 15:46:14 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-10-08 15:39:42 +0000
commitbfaf7c8b9e4b89eb49c6357e50ba556e5fc47387 (patch)
treebd9465a0cdc6321dc2eb671c9050b134deb220e4 /DynamicTablesPkg/Include
parent25cf58a16353b20a20641c499b013392c5eb42ae (diff)
downloadedk2-bfaf7c8b9e4b89eb49c6357e50ba556e5fc47387.tar.gz
edk2-bfaf7c8b9e4b89eb49c6357e50ba556e5fc47387.tar.bz2
edk2-bfaf7c8b9e4b89eb49c6357e50ba556e5fc47387.zip
DynamicTablesPkg: Add AddSsdtAcpiHeader()
To fetch the Oem information from the ConfigurationManagerProtocol and the AcpiTableInfo, and populate the SSDT ACPI header when creating a RootNode via the AmlLib, create AddSsdtAcpiHeader(). Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Diffstat (limited to 'DynamicTablesPkg/Include')
-rw-r--r--DynamicTablesPkg/Include/Library/TableHelperLib.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h b/DynamicTablesPkg/Include/Library/TableHelperLib.h
index 6d362ff99a..76f9e8c25f 100644
--- a/DynamicTablesPkg/Include/Library/TableHelperLib.h
+++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h
@@ -12,6 +12,8 @@
#ifndef TABLE_HELPER_LIB_H_
#define TABLE_HELPER_LIB_H_
+#include <Library/AmlLib/AmlLib.h>
+
/** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
object from the Configuration Manager.
@@ -62,6 +64,39 @@ AddAcpiHeader (
IN CONST UINT32 Length
);
+/** Build a RootNode containing SSDT ACPI header information using the AmlLib.
+
+ The function utilizes the ACPI table Generator and the Configuration
+ Manager protocol to obtain any information required for constructing the
+ header. It then creates a RootNode. The SSDT ACPI header is part of the
+ RootNode.
+
+ This is essentially a wrapper around AmlCodeGenDefinitionBlock ()
+ from the AmlLib.
+
+ @param [in] CfgMgrProtocol Pointer to the Configuration Manager
+ protocol interface.
+ @param [in] Generator Pointer to the ACPI table Generator.
+ @param [in] AcpiTableInfo Pointer to the ACPI table info structure.
+ @param [out] RootNode If success, contains the created RootNode.
+ The SSDT ACPI header is part of the RootNode.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_NOT_FOUND The required object information is not found.
+ @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
+ Manager is less than the Object size for the
+ requested object.
+**/
+EFI_STATUS
+EFIAPI
+AddSsdtAcpiHeader (
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+ IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
+ IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
+ OUT AML_ROOT_NODE_HANDLE * RootNode
+ );
+
/**
Function prototype for testing if two arbitrary objects are equal.