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

Go to the source code of this file.

Functions

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.h.

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.

◆ 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.