/* Get the root node from any node of the tree. This is done by climbing up the tree until the root node is reached. */
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. */
AML_ROOT_NODE* EFIAPI AmlGetRootNode(IN CONST AML_NODE_HEADER *Node)
{
  if (!IS_AML_NODE_VALID (Node)) {
    ASSERT (0);
    return NULL;
  }
  while (!IS_AML_ROOT_NODE (Node)) {
    Node = Node->Parent;
    if (!IS_AML_NODE_VALID (Node)) {
      ASSERT (0);
      return NULL;
    }
  }
  return (AML_ROOT_NODE *)Node;
}