summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
diff options
context:
space:
mode:
authorJeff Brasen <jbrasen@nvidia.com>2022-08-17 10:39:39 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-09-01 12:43:22 +0000
commitb9bb27e1ff40d93fd39c1257df28ecde0642bb07 (patch)
tree470b51b8f585c1b780fba38a2deb4db2b63f0565 /DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
parent033ba8bb2976629fdb664d7131f44f8b0b8f6777 (diff)
downloadedk2-b9bb27e1ff40d93fd39c1257df28ecde0642bb07.tar.gz
edk2-b9bb27e1ff40d93fd39c1257df28ecde0642bb07.tar.bz2
edk2-b9bb27e1ff40d93fd39c1257df28ecde0642bb07.zip
DynamicTablesPkg: Add support to build _DSD
Add APIs needed to build _DSD with different UUIDs. This is per ACPI specification 6.4 s6.2.5. Adds support for building data packages with format Package {"Name", Integer} Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h')
-rw-r--r--DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 6f214c0dfa..39968660f2 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -1280,6 +1280,62 @@ AmlAddLpiState (
IN AML_OBJECT_NODE_HANDLE LpiNode
);
+/** AML code generation for a _DSD device data object.
+
+ AmlAddDeviceDataDescriptorPackage (Uuid, DsdNode, PackageNode) is
+ equivalent of the following ASL code:
+ ToUUID(Uuid),
+ Package () {}
+
+ Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".
+
+ _DSD (Device Specific Data) Implementation Guide
+ https://github.com/UEFI/DSD-Guide
+ Per s3. "'Well-Known _DSD UUIDs and Data Structure Formats'"
+ If creating a Device Properties data then UUID daffd814-6eba-4d8c-8a91-bc9bbf4aa301 should be used.
+
+ @param [in] Uuid The Uuid of the descriptor to be created
+ @param [in] DsdNode Node of the DSD Package.
+ @param [out] PackageNode If success, contains the created package node.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlAddDeviceDataDescriptorPackage (
+ IN CONST EFI_GUID *Uuid,
+ IN AML_OBJECT_NODE_HANDLE DsdNode,
+ OUT AML_OBJECT_NODE_HANDLE *PackageNode
+ );
+
+/** AML code generation to add a package with a name and value,
+ to a parent package.
+ This is useful to build the _DSD package but can be used in other cases.
+
+ AmlAddNameIntegerPackage ("Name", Value, PackageNode) is
+ equivalent of the following ASL code:
+ Package (2) {"Name", Value}
+
+ Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".
+
+ @param [in] Name String to place in first entry of package
+ @param [in] Value Integer to place in second entry of package
+ @param [in] PackageNode Package to add new sub package to.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlAddNameIntegerPackage (
+ IN CHAR8 *Name,
+ IN UINT64 Value,
+ IN AML_OBJECT_NODE_HANDLE PackageNode
+ );
+
// DEPRECATED APIS
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES