/* Add the NewNode to the head of the variable list of arguments of the ParentNode. */
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. */
EFI_STATUS EFIAPI AmlVarListAddHead(IN AML_NODE_HEADER *ParentNode, IN AML_NODE_HEADER *NewNode)
{
  EFI_STATUS  Status;
  UINT32      NewSize;
  LIST_ENTRY  *ChildrenList;
  if ((!IS_AML_ROOT_NODE (ParentNode)     &&
       !IS_AML_OBJECT_NODE (ParentNode))  ||
      (!IS_AML_DATA_NODE (NewNode)        &&
       !IS_AML_OBJECT_NODE (NewNode))     ||
      !AML_NODE_IS_DETACHED (NewNode))
  {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  ChildrenList = AmlNodeGetVariableArgList (ParentNode);
  if (ChildrenList == NULL) {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  InsertHeadList (ChildrenList, &NewNode->Link);
  NewNode->Parent = ParentNode;
  Status = AmlComputeSize (NewNode, &NewSize);
  if (EFI_ERROR (Status)) {
    ASSERT (0);
    return Status;
  }
  Status = AmlPropagateInformation (ParentNode, TRUE, NewSize, 1);
  ASSERT_EFI_ERROR (Status);
  return Status;
}