TianoCore EDK2 master
Loading...
Searching...
No Matches
AmlTreeTraversal.c File Reference

Go to the source code of this file.

Functions

AML_NODE_HEADER *EFIAPI AmlGetSiblingVariableArgument (IN AML_NODE_HEADER *VarArgNode)
 
AML_NODE_HEADER *EFIAPI AmlGetNextVariableArgument (IN AML_NODE_HEADER *Node, IN AML_NODE_HEADER *CurrVarArg)
 
AML_NODE_HEADER *EFIAPI AmlGetPreviousVariableArgument (IN AML_NODE_HEADER *Node, IN AML_NODE_HEADER *CurrVarArg)
 
AML_NODE_HEADER *EFIAPI AmlGetNextSibling (IN CONST AML_NODE_HEADER *Node, IN CONST AML_NODE_HEADER *ChildNode)
 
AML_NODE_HEADER *EFIAPI AmlGetPreviousSibling (IN CONST AML_NODE_HEADER *Node, IN CONST AML_NODE_HEADER *ChildNode)
 
AML_NODE_HEADER *EFIAPI AmlGetNextNode (IN CONST AML_NODE_HEADER *Node)
 
AML_NODE_HEADER *EFIAPI AmlGetPreviousNode (IN CONST AML_NODE_HEADER *Node)
 

Detailed Description

AML Tree Traversal.

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

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

Definition in file AmlTreeTraversal.c.

Function Documentation

◆ AmlGetNextNode()

AML_NODE_HEADER *EFIAPI AmlGetNextNode ( IN CONST AML_NODE_HEADER Node)

Iterate through the nodes in the same order as the AML bytestream.

The iteration is similar to a depth-first path.

(Node) /-i # Child of fixed argument b \ / |- [a][b][c][d] # Fixed Arguments |- {(e)->(f)->(g)} # Variable Arguments \ -h # Child of variable argument e

Traversal Order: a, b, i, c, d, e, h, f, g, NULL Note: The branch i and h will be traversed if it has any children.

Parameters
[in]NodePointer to a node.
Returns
The next node in the AML bytestream order. Return NULL if Node is the Node corresponding to the last bytecode of the tree.

Definition at line 429 of file AmlTreeTraversal.c.

◆ AmlGetNextSibling()

AML_NODE_HEADER *EFIAPI AmlGetNextSibling ( IN CONST AML_NODE_HEADER Node,
IN CONST AML_NODE_HEADER ChildNode 
)

Get the next sibling node among the children of the input Node.

This function traverses the FixedArguments followed by the VariableArguments at the same level in the hierarchy.

Fixed arguments are before variable arguments.

(Node) /-i # Child of fixed argument b \ / |- [a][b][c][d] # Fixed Arguments |- {(e)->(f)->(g)} # Variable Arguments \ -h # Child of variable argument e

Traversal Order: a, b, c, d, e, f, g, NULL

Parameters
[in]NodePointer to a root node or an object node.
[in]ChildNodeGet the node after the ChildNode.
Returns
The node after the ChildNode among the children of the input Node.
  • If ChildNode is NULL, return the first available node among the fixed argument list then variable list of arguments;
  • If ChildNode is the last node of the fixed argument list, return the first argument of the variable list of arguments;
  • If ChildNode is the last node of the variable list of arguments, return NULL.

Definition at line 247 of file AmlTreeTraversal.c.

◆ AmlGetNextVariableArgument()

AML_NODE_HEADER *EFIAPI AmlGetNextVariableArgument ( IN AML_NODE_HEADER Node,
IN AML_NODE_HEADER CurrVarArg 
)

Get the next variable argument.

(Node) /-i # Child of fixed argument b \ / |- [a][b][c][d] # Fixed Arguments |- {(e)->(f)->(g)} # Variable Arguments \ -h # Child of variable argument e

Traversal Order: e, f, g, NULL

Parameters
[in]NodePointer to a Root node or Object Node.
[in]CurrVarArgPointer to the Current Variable Argument.
Returns
The node after the CurrVarArg in the variable list of arguments. If CurrVarArg is NULL, return the first node of the variable argument list. Return NULL if
  • CurrVarArg is the last node of the list, or
  • Node does not have a variable list of arguments.

Definition at line 88 of file AmlTreeTraversal.c.

◆ AmlGetPreviousNode()

AML_NODE_HEADER *EFIAPI AmlGetPreviousNode ( IN CONST AML_NODE_HEADER Node)

Iterate through the nodes in the reverse order of the AML bytestream.

The iteration is similar to a depth-first path, but done in a reverse order.

(Node) /-i # Child of fixed argument b \ / |- [a][b][c][d] # Fixed Arguments |- {(e)->(f)->(g)} # Variable Arguments \ -h # Child of variable argument e

Traversal Order: g, f, h, e, d, c, i, b, a, NULL Note: The branch i and h will be traversed if it has any children.

Parameters
[in]NodePointer to a node.
Returns
The previous node in the AML bytestream order. Return NULL if Node is the Node corresponding to the last bytecode of the tree.

Definition at line 513 of file AmlTreeTraversal.c.

◆ AmlGetPreviousSibling()

AML_NODE_HEADER *EFIAPI AmlGetPreviousSibling ( IN CONST AML_NODE_HEADER Node,
IN CONST AML_NODE_HEADER ChildNode 
)

Get the previous sibling node among the children of the input Node.

This function traverses the FixedArguments followed by the VariableArguments at the same level in the hierarchy.

Fixed arguments are before variable arguments.

(Node) /-i # Child of fixed argument b \ / |- [a][b][c][d] # Fixed Arguments |- {(e)->(f)->(g)} # Variable Arguments \ -h # Child of variable argument e

Traversal Order: g, f, e, d, c, b, a, NULL

Parameters
[in]NodeThe node to get the fixed argument from.
[in]ChildNodeGet the node before the ChildNode.
Returns
The node before the ChildNode among the children of the input Node.
  • If ChildNode is NULL, return the last available node among the variable list of arguments then fixed argument list;
  • If ChildNode is the first node of the variable list of arguments, return the last argument of the fixed argument list;
  • If ChildNode is the first node of the fixed argument list, return NULL.

Definition at line 335 of file AmlTreeTraversal.c.

◆ AmlGetPreviousVariableArgument()

AML_NODE_HEADER *EFIAPI AmlGetPreviousVariableArgument ( IN AML_NODE_HEADER Node,
IN AML_NODE_HEADER CurrVarArg 
)

Get the previous variable argument.

(Node) /-i # Child of fixed argument b \ / |- [a][b][c][d] # Fixed Arguments |- {(e)->(f)->(g)} # Variable Arguments \ -h # Child of variable argument e

Traversal Order: g, f, e, NULL

Parameters
[in]NodePointer to a root node or an object node.
[in]CurrVarArgPointer to the Current Variable Argument.
Returns
The node before the CurrVarArg in the variable list of arguments. If CurrVarArg is NULL, return the last node of the variable list of arguments. Return NULL if:
  • CurrVarArg is the first node of the list, or
  • Node doesn't have a variable list of arguments.

Definition at line 164 of file AmlTreeTraversal.c.