TianoCore EDK2 master
|
#include <Tree/AmlTree.h>
#include <AmlCoreInterface.h>
#include <Tree/AmlNode.h>
#include <Tree/AmlTreeTraversal.h>
#include <Utils/AmlUtility.h>
Go to the source code of this file.
AML Tree.
Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AmlTree.c.
EFI_STATUS EFIAPI AmlAppendRdNode | ( | IN AML_OBJECT_NODE * | BufferOpNode, |
IN AML_DATA_NODE * | NewRdNode | ||
) |
Append a Resource Data node to the BufferOpNode.
The Resource Data node is added at the end of the variable list of arguments of the BufferOpNode, but before the End Tag. If no End Tag is found, the function returns an error.
[in] | BufferOpNode | Buffer node containing resource data elements. |
[in] | NewRdNode | The new Resource Data node to add. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlDeleteTree | ( | IN AML_NODE_HEADER * | Node | ) |
EFI_STATUS EFIAPI AmlDetachNode | ( | IN AML_NODE_HEADER * | Node | ) |
Detach the Node from the tree.
The function will fail if the Node is in its parent's fixed argument list. The Node is not deleted. The deletion is done separately from the removal.
[in] | Node | Pointer to a Node. Must be a data node or an object node. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
AML_NODE_HEADER *EFIAPI AmlGetFixedArgument | ( | IN AML_OBJECT_NODE * | ObjectNode, |
IN EAML_PARSE_INDEX | Index | ||
) |
Get the node at the input Index in the fixed argument list of the input ObjectNode.
[in] | ObjectNode | Pointer to an object node. |
[in] | Index | The Index of the fixed argument to get. |
AML_NODE_HEADER *EFIAPI AmlGetParent | ( | IN AML_NODE_HEADER * | Node | ) |
AML_ROOT_NODE *EFIAPI AmlGetRootNode | ( | IN CONST AML_NODE_HEADER * | Node | ) |
BOOLEAN EFIAPI AmlIsNodeFixedArgument | ( | IN CONST AML_NODE_HEADER * | Node, |
OUT EAML_PARSE_INDEX * | IndexPtr | ||
) |
Check whether the input Node is in the fixed argument list of its parent node.
If so, IndexPtr contains this Index.
[in] | Node | Pointer to a Node. |
[out] | IndexPtr | Pointer holding the Index of the Node in its parent's fixed argument list. |
TRUE | The node is a fixed argument and the index in IndexPtr is valid. |
FALSE | The node is not a fixed argument. |
LIST_ENTRY *EFIAPI AmlNodeGetVariableArgList | ( | IN CONST AML_NODE_HEADER * | Node | ) |
EFI_STATUS EFIAPI AmlRemoveNodeFromVarArgList | ( | IN AML_NODE_HEADER * | Node | ) |
Remove the Node from its parent's variable list of arguments.
The function will fail if the Node is in its parent's fixed argument list. The Node is not deleted. The deletion is done separately from the removal.
[in] | Node | Pointer to a Node. Must be a data node or an object node. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlReplaceArgument | ( | IN AML_NODE_HEADER * | OldNode, |
IN AML_NODE_HEADER * | NewNode | ||
) |
Replace the OldNode by the NewNode.
Note: This function unlinks the OldNode from the tree. It is the callers responsibility to delete the OldNode if needed.
[in] | OldNode | Pointer to the node to replace. Must be a data node or an object node. |
[in] | NewNode | The new node to insert. Must be a data node or an object node. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
STATIC EFI_STATUS EFIAPI AmlReplaceFixedArgument | ( | IN AML_OBJECT_NODE * | ParentNode, |
IN EAML_PARSE_INDEX | Index, | ||
IN AML_NODE_HEADER * | NewNode | ||
) |
Replace the fixed argument at the Index of the ParentNode with the NewNode.
Note: This function unlinks the OldNode from the tree. It is the callers responsibility to delete the OldNode if needed.
[in] | ParentNode | Pointer to the parent node. Must be an object node. |
[in] | Index | Index of the fixed argument to replace. |
[in] | NewNode | The new node to insert. Must be an object node or a data node. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlReplaceVariableArgument | ( | IN AML_NODE_HEADER * | OldNode, |
IN AML_NODE_HEADER * | NewNode | ||
) |
Replace the OldNode, which is in a variable list of arguments, with the NewNode.
Note: This function unlinks the OldNode from the tree. It is the callers responsibility to delete the OldNode if needed.
[in] | OldNode | Pointer to the node to replace. Must be a data node or an object node. |
[in] | NewNode | The new node to insert. Must be a data node or an object node. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlSetFixedArgument | ( | IN AML_OBJECT_NODE * | ObjectNode, |
IN EAML_PARSE_INDEX | Index, | ||
IN AML_NODE_HEADER * | NewNode | ||
) |
Set the fixed argument of the ObjectNode at the Index to the NewNode.
It is the caller's responsibility to save the old node, if desired, otherwise the reference to the old node will be lost. If NewNode is not NULL, set its parent to ObjectNode.
[in] | ObjectNode | Pointer to an object node. |
[in] | Index | Index in the fixed argument list of the ObjectNode to set. |
[in] | NewNode | Pointer to the NewNode. Can be NULL, a data node or an object node. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlVarListAddAfter | ( | IN AML_NODE_HEADER * | Node, |
IN AML_NODE_HEADER * | NewNode | ||
) |
Add the NewNode after the Node in the variable list of arguments of the Node's parent.
[in] | Node | Pointer to a node. Must be a root or an object node. |
[in] | NewNode | Pointer to the node to add. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlVarListAddBefore | ( | IN AML_NODE_HEADER * | Node, |
IN AML_NODE_HEADER * | NewNode | ||
) |
Add the NewNode before the Node in the list of variable arguments of the Node's parent.
[in] | Node | Pointer to a node. Must be a root or an object node. |
[in] | NewNode | Pointer to the node to add. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlVarListAddHead | ( | IN AML_NODE_HEADER * | ParentNode, |
IN AML_NODE_HEADER * | NewNode | ||
) |
Add the NewNode to the head of the variable list of arguments of the ParentNode.
[in] | ParentNode | Pointer to the parent node. Must be a root or an object node. |
[in] | NewNode | Pointer to the node to add. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlVarListAddTail | ( | IN AML_NODE_HEADER * | ParentNode, |
IN AML_NODE_HEADER * | NewNode | ||
) |
Add the NewNode to the tail of the variable list of arguments of the ParentNode.
[in] | ParentNode | Pointer to the parent node. Must be a root or an object node. |
[in] | NewNode | Pointer to the node to add. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_STATUS EFIAPI AmlVarListAddTailInternal | ( | IN AML_NODE_HEADER * | ParentNode, |
IN AML_NODE_HEADER * | NewNode | ||
) |
Add the NewNode to the tail of the variable list of arguments of the ParentNode.
NOTE: This is an internal function which does not propagate the size when a new node is added.
[in] | ParentNode | Pointer to the parent node. Must be a root or an object node. |
[in] | NewNode | Pointer to the node to add. |
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |