FreeBSD/sys/contrib/dev/acpica/compiler/asltree.c
/*******************************************************************************
 *
 * FUNCTION:    TrLinkChildNode
 *
 * PARAMETERS:  Op1           - Parent node
 *              Op2           - Op to become a child
 *
 * RETURN:      The parent node
 *
 * DESCRIPTION: Link two nodes together as a parent and child
 *
 ******************************************************************************/
TrLinkChildNode
PARAMETERS:  Op1           - Parent node
Op2           - Op to become a child

The parent node

Link two nodes together as a parent and child
TrLinkChildNode PARAMETERS : Op1 - Parent node Op2 - Op to become a child The parent node Link two nodes together as a parent and child
ACPI_PARSE_OBJECT *
TrLinkChildNode (
    ACPI_PARSE_OBJECT       *Op1,
    ACPI_PARSE_OBJECT       *Op2)
{
    ACPI_PARSE_OBJECT       *Next;
    DbgPrint (ASL_PARSE_OUTPUT,
        "\nLinkChildNode: Parent=%p (%s), Child=%p (%s)\n",
        Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode): NULL,
        Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode): NULL);
    if (!Op1 || !Op2)
    {
        return (Op1);
    }
    Op1->Asl.Child = Op2;
    Next = Op2;
    while (Next)
    {
        Next->Asl.Parent = Op1;
        Next = Next->Asl.Next;
    }
    return (Op1);
}
ACPI_PARSE_OBJECT * TrLinkChildNode ( ACPI_PARSE_OBJECT * Op1 , ACPI_PARSE_OBJECT * Op2 ) { ACPI_PARSE_OBJECT * Next ; DbgPrint ( ASL_PARSE_OUTPUT , " \n \n " , Op1 , Op1 ? UtGetOpName ( Op1 -> Asl . ParseOpcode ) : NULL , Op2 , Op2 ? UtGetOpName ( Op2 -> Asl . ParseOpcode ) : NULL ) ; if ( ! Op1 || ! Op2 ) { return ( Op1 ) ; } Op1 -> Asl . Child = Op2 ; Next = Op2 ; while ( Next ) { Next -> Asl . Parent = Op1 ; Next = Next -> Asl . Next ; } return ( Op1 ) ; }
FUNCTION:    TrLinkChildNode
 PARAMETERS:  Op1           - Parent node
              Op2           - Op to become a child
FUNCTION : TrLinkChildNode PARAMETERS : Op1 - Parent node Op2 - Op to become a child
/* Set the child and all peers of the child to point to the parent */