summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
diff options
context:
space:
mode:
Diffstat (limited to 'DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c')
-rw-r--r--DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c105
1 files changed, 90 insertions, 15 deletions
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
index d40a27410d..c7348aa5da 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
@@ -1,7 +1,7 @@
/** @file
AML Resource Data Code Generation.
- Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
+ Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -161,7 +161,7 @@ AmlCodeGenInterrupt (
This function creates a Resource Data element corresponding to the
"Interrupt ()" ASL function, stores it in an AML Data Node.
- It then adds it after the input CurrRdNode in the list of resource data
+ It then adds it after the input NameOpNode in the list of resource data
element.
The Resource Data effectively created is an Extended Interrupt Resource
@@ -175,12 +175,12 @@ AmlCodeGenInterrupt (
- attach this node to an AML tree;
- delete this node.
- Note: The _CRS node must be defined using the ASL Name () function.
- e.g. Name (_CRS, ResourceTemplate () {
- ...
- }
+ Note:
+ The named node must be defined using the ASL "Name ()" statement.
+ E.g. Name (_CRS, ResourceTemplate () { ... })
+ Methods cannot be modified with this function.
- @param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
+ @param [in] NameOpNode NameOp object node defining a named object.
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
NameOp object nodes are defined in ASL
using the "Name ()" function.
@@ -201,8 +201,8 @@ AmlCodeGenInterrupt (
**/
EFI_STATUS
EFIAPI
-AmlCodeGenCrsAddRdInterrupt (
- IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
+AmlCodeGenAddRdInterrupt (
+ IN AML_OBJECT_NODE_HANDLE NameOpNode,
IN BOOLEAN ResourceConsumer,
IN BOOLEAN EdgeTriggered,
IN BOOLEAN ActiveLow,
@@ -215,18 +215,17 @@ AmlCodeGenCrsAddRdInterrupt (
AML_OBJECT_NODE_HANDLE BufferOpNode;
- if ((IrqList == NULL) ||
- (IrqCount == 0) ||
- (!AmlNodeHasOpCode (NameOpCrsNode, AML_NAME_OP, 0)) ||
- (!AmlNameOpCompareName (NameOpCrsNode, "_CRS"))) {
+ if ((IrqList == NULL) ||
+ (IrqCount == 0) ||
+ (!AmlNodeHasOpCode (NameOpNode, AML_NAME_OP, 0))) {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
- // Get the _CRS value which is represented as a BufferOp object node
+ // Get the value which is represented as a BufferOp object node
// which is the 2nd fixed argument (i.e. index 1).
BufferOpNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
- NameOpCrsNode,
+ NameOpNode,
EAmlParseIndexTerm1
);
if ((BufferOpNode == NULL) ||
@@ -254,3 +253,79 @@ AmlCodeGenCrsAddRdInterrupt (
return Status;
}
+
+// DEPRECATED APIS
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
+/** DEPRECATED API
+
+ Add an Interrupt Resource Data node.
+
+ This function creates a Resource Data element corresponding to the
+ "Interrupt ()" ASL function, stores it in an AML Data Node.
+
+ It then adds it after the input CurrRdNode in the list of resource data
+ element.
+
+ The Resource Data effectively created is an Extended Interrupt Resource
+ Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
+ for more information about Extended Interrupt Resource Data.
+
+ The Extended Interrupt contains one single interrupt.
+
+ This function allocates memory to create a data node. It is the caller's
+ responsibility to either:
+ - attach this node to an AML tree;
+ - delete this node.
+
+ Note: The _CRS node must be defined using the ASL Name () function.
+ e.g. Name (_CRS, ResourceTemplate () {
+ ...
+ }
+
+ @ingroup UserApis
+
+ @param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
+ Must have an OpCode=AML_NAME_OP, SubOpCode=0.
+ NameOp object nodes are defined in ASL
+ using the "Name ()" function.
+ @param [in] ResourceConsumer The device consumes the specified interrupt
+ or produces it for use by a child device.
+ @param [in] EdgeTriggered The interrupt is edge triggered or
+ level triggered.
+ @param [in] ActiveLow The interrupt is active-high or active-low.
+ @param [in] Shared The interrupt can be shared with other
+ devices or not (Exclusive).
+ @param [in] IrqList Interrupt list. Must be non-NULL.
+ @param [in] IrqCount Interrupt count. Must be non-zero.
+
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlCodeGenCrsAddRdInterrupt (
+ IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
+ IN BOOLEAN ResourceConsumer,
+ IN BOOLEAN EdgeTriggered,
+ IN BOOLEAN ActiveLow,
+ IN BOOLEAN Shared,
+ IN UINT32 * IrqList,
+ IN UINT8 IrqCount
+ )
+{
+ return AmlCodeGenAddRdInterrupt (
+ NameOpCrsNode,
+ NameOpNode,
+ ResourceConsumer,
+ EdgeTriggered,
+ ActiveLow,
+ Shared,
+ IrqList,
+ IrqCount
+ );
+}
+
+#endif // DISABLE_NEW_DEPRECATED_INTERFACES