TianoCore EDK2 master
Loading...
Searching...
No Matches
AmlTree.h File Reference
#include <AmlNodeDefines.h>

Go to the source code of this file.

Functions

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)
 
EFI_STATUS EFIAPI AmlSetFixedArgument (IN AML_OBJECT_NODE *ObjectNode, IN EAML_PARSE_INDEX Index, IN AML_NODE_HEADER *NewNode)
 
LIST_ENTRY *EFIAPI AmlNodeGetVariableArgList (IN CONST AML_NODE_HEADER *Node)
 
EFI_STATUS EFIAPI AmlVarListAddTailInternal (IN AML_NODE_HEADER *ParentNode, IN AML_NODE_HEADER *NewNode)
 
EFI_STATUS EFIAPI AmlReplaceArgument (IN AML_NODE_HEADER *OldNode, IN AML_NODE_HEADER *NewNode)
 

Detailed Description

AML Tree.

Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AmlTree.h.

Function Documentation

◆ AmlGetRootNode()

AML_ROOT_NODE *EFIAPI AmlGetRootNode ( IN CONST AML_NODE_HEADER Node)

Get the root node from any node of the tree. This is done by climbing up the tree until the root node is reached.

Parameters
[in]NodePointer to a node.
Returns
The root node of the tree. NULL if error.

Definition at line 48 of file AmlTree.c.

◆ AmlIsNodeFixedArgument()

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.

Parameters
[in]NodePointer to a Node.
[out]IndexPtrPointer holding the Index of the Node in its parent's fixed argument list.
Return values
TRUEThe node is a fixed argument and the index in IndexPtr is valid.
FALSEThe node is not a fixed argument.

Definition at line 110 of file AmlTree.c.

◆ AmlNodeGetVariableArgList()

LIST_ENTRY *EFIAPI AmlNodeGetVariableArgList ( IN CONST AML_NODE_HEADER Node)

If the given AML_NODE_HEADER has a variable list of arguments, return a pointer to this list. Return NULL otherwise.

Parameters
[in]NodePointer to the AML_NODE_HEADER to check.
Returns
The list of variable arguments if there is one. NULL otherwise.

Definition at line 205 of file AmlTree.c.

◆ AmlReplaceArgument()

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.

Parameters
[in]OldNodePointer to the node to replace. Must be a data node or an object node.
[in]NewNodeThe new node to insert. Must be a data node or an object node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 915 of file AmlTree.c.

◆ AmlSetFixedArgument()

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.

Parameters
[in]ObjectNodePointer to an object node.
[in]IndexIndex in the fixed argument list of the ObjectNode to set.
[in]NewNodePointer to the NewNode. Can be NULL, a data node or an object node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 168 of file AmlTree.c.

◆ AmlVarListAddTailInternal()

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.

Parameters
[in]ParentNodePointer to the parent node. Must be a root or an object node.
[in]NewNodePointer to the node to add.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 379 of file AmlTree.c.