summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Include
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2021-12-09 10:25:00 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-13 12:48:42 +0000
commitfd5fc4bbb7b4f13d98a5c643776d92df39ecf49a (patch)
tree6cd60bf4c50e24404ff1e78112ae4760696e81aa /DynamicTablesPkg/Include
parent0e7147fe75e48862c236d11bcfc27dde8e3e8d89 (diff)
downloadedk2-fd5fc4bbb7b4f13d98a5c643776d92df39ecf49a.tar.gz
edk2-fd5fc4bbb7b4f13d98a5c643776d92df39ecf49a.tar.bz2
edk2-fd5fc4bbb7b4f13d98a5c643776d92df39ecf49a.zip
DynamicTablesPkg: AML Code generation to create a named ResourceTemplate()
Add AmlCodeGenNameResourceTemplate() to generate code for a ResourceTemplate(). AmlCodeGenNameResourceTemplate ("REST", ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(REST, ResourceTemplate () {}) To: Sami Mujawar <sami.mujawar@arm.com> To: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'DynamicTablesPkg/Include')
-rw-r--r--DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 183f565f47..8949cf4d93 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -863,6 +863,34 @@ AmlCodeGenNamePackage (
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL
);
+/** AML code generation for a Name object node, containing a ResourceTemplate.
+
+ AmlCodeGenNameResourceTemplate ("PRS0", ParentNode, NewObjectNode) is
+ equivalent of the following ASL code:
+ Name(PRS0, ResourceTemplate () {})
+
+ @ingroup CodeGenApis
+
+ @param [in] NameString The new variable name.
+ Must be a NULL-terminated ASL NameString
+ e.g.: "DEV0", "DV15.DEV0", etc.
+ The input string is copied.
+ @param [in] ParentNode If provided, set ParentNode as the parent
+ of the node created.
+ @param [out] NewObjectNode If success, contains the created node.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlCodeGenNameResourceTemplate (
+ IN CONST CHAR8 *NameString,
+ IN AML_NODE_HANDLE ParentNode, OPTIONAL
+ OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL
+ );
+
/** AML code generation for a Device object node.
AmlCodeGenDevice ("COM0", ParentNode, NewObjectNode) is