4 Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include <AmlNodeDefines.h>
14 /** Get the root node from any node of the tree.
15 This is done by climbing up the tree until the root node is reached.
17 @param [in] Node Pointer to a node.
19 @return The root node of the tree.
25 IN CONST AML_NODE_HEADER
* Node
28 /** Check whether the input Node is in the fixed argument list of its parent
31 If so, IndexPtr contains this Index.
33 @param [in] Node Pointer to a Node.
34 @param [out] IndexPtr Pointer holding the Index of the Node in
35 its parent's fixed argument list.
37 @retval TRUE The node is a fixed argument and the index
39 @retval FALSE The node is not a fixed argument.
43 AmlIsNodeFixedArgument (
44 IN CONST AML_NODE_HEADER
* Node
,
45 OUT EAML_PARSE_INDEX
* IndexPtr
48 /** Set the fixed argument of the ObjectNode at the Index to the NewNode.
50 It is the caller's responsibility to save the old node, if desired,
51 otherwise the reference to the old node will be lost.
52 If NewNode is not NULL, set its parent to ObjectNode.
54 @param [in] ObjectNode Pointer to an object node.
55 @param [in] Index Index in the fixed argument list of
56 the ObjectNode to set.
57 @param [in] NewNode Pointer to the NewNode.
58 Can be NULL, a data node or an object node.
60 @retval EFI_SUCCESS The function completed successfully.
61 @retval EFI_INVALID_PARAMETER Invalid parameter.
66 IN AML_OBJECT_NODE
* ObjectNode
,
67 IN EAML_PARSE_INDEX Index
,
68 IN AML_NODE_HEADER
* NewNode
71 /** If the given AML_NODE_HEADER has a variable list of arguments,
72 return a pointer to this list.
73 Return NULL otherwise.
75 @param [in] Node Pointer to the AML_NODE_HEADER to check.
77 @return The list of variable arguments if there is one.
82 AmlNodeGetVariableArgList (
83 IN CONST AML_NODE_HEADER
* Node
86 /** Add the NewNode to the tail of the variable list of arguments
89 NOTE: This is an internal function which does not propagate the size
90 when a new node is added.
92 @param [in] ParentNode Pointer to the parent node.
93 Must be a root or an object node.
94 @param [in] NewNode Pointer to the node to add.
96 @retval EFI_SUCCESS The function completed successfully.
97 @retval EFI_INVALID_PARAMETER Invalid parameter.
101 AmlVarListAddTailInternal (
102 IN AML_NODE_HEADER
* ParentNode
,
103 IN AML_NODE_HEADER
* NewNode
106 /** Replace the OldNode by the NewNode.
108 Note: This function unlinks the OldNode from the tree. It is the callers
109 responsibility to delete the OldNode if needed.
111 @param [in] OldNode Pointer to the node to replace.
112 Must be a data node or an object node.
113 @param [in] NewNode The new node to insert.
114 Must be a data node or an object node.
116 @retval EFI_SUCCESS The function completed successfully.
117 @retval EFI_INVALID_PARAMETER Invalid parameter.
122 IN AML_NODE_HEADER
* OldNode
,
123 IN AML_NODE_HEADER
* NewNode
126 #endif // AML_TREE_H_