FreeBSD/sys/contrib/dev/acpica/compiler/aslmaputils.c
/*******************************************************************************
 *
 * FUNCTION:    MpGetConnectionInfo
 *
 * PARAMETERS:  Op                      - Parse Op to be examined
 *              PinIndex                - Index into GPIO PinList
 *              TargetNode              - Where the field node is returned
 *              TargetName              - Where the node path is returned
 *
 * RETURN:      A substitute _HID string, indicating that the name is actually
 *              a field. NULL if the Op does not refer to a Connection.
 *
 * DESCRIPTION: Get the Field Unit that corresponds to the PinIndex after
 *              a Connection() invocation.
 *
 ******************************************************************************/
MpGetConnectionInfo
PARAMETERS:  Op                      - Parse Op to be examined
PinIndex                - Index into GPIO PinList
TargetNode              - Where the field node is returned
TargetName              - Where the node path is returned

A substitute _HID string, indicating that the name is actually
a field. NULL if the Op does not refer to a Connection.

Get the Field Unit that corresponds to the PinIndex after
a Connection() invocation.
MpGetConnectionInfo PARAMETERS : Op - Parse Op to be examined PinIndex - Index into GPIO PinList TargetNode - Where the field node is returned TargetName - Where the node path is returned A substitute _HID string indicating that the name is actually a field . NULL if the Op does not refer to a Connection . Get the Field Unit that corresponds to the PinIndex after a Connection () invocation .
char *
MpGetConnectionInfo (
    ACPI_PARSE_OBJECT       *Op,
    UINT32                  PinIndex,
    ACPI_NAMESPACE_NODE     **TargetNode,
    char                    **TargetName)
{
    ACPI_PARSE_OBJECT       *NextOp;
    UINT32                  i;
    if ((Op->Asl.AmlOpcode == AML_INT_CONNECTION_OP) ||
        (Op->Asl.ParseOpcode == PARSEOP_CONNECTION))
    {
        NextOp = Op;
        for (i = 0; i <= PinIndex;)
        {
            NextOp = NextOp->Asl.Next;
            while (NextOp &&
                (NextOp->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
                (NextOp->Asl.AmlOpcode != AML_INT_NAMEDFIELD_OP))
            {
                NextOp = NextOp->Asl.Next;
            }
            if (!NextOp)
            {
                return ("UNKNOWN");
            }
            if (NextOp->Asl.ParseOpcode == PARSEOP_NAMESEG)
            {
                i += (UINT32) NextOp->Asl.Child->Asl.Value.Integer;
            }
            else 
            {
                i += (UINT32) NextOp->Asl.Value.Integer;
            }
        }
        *TargetNode = NextOp->Asl.Node;
        *TargetName = AcpiNsGetExternalPathname (*TargetNode);
        return ("-Field-");
    }
    return (NULL);
}
char * MpGetConnectionInfo ( ACPI_PARSE_OBJECT * Op , UINT32 PinIndex , ACPI_NAMESPACE_NODE * * TargetNode , char * * TargetName ) { ACPI_PARSE_OBJECT * NextOp ; UINT32 i ; if ( ( Op -> Asl . AmlOpcode == AML_INT_CONNECTION_OP ) || ( Op -> Asl . ParseOpcode == PARSEOP_CONNECTION ) ) { NextOp = Op ; for ( i = 0 ; i <= PinIndex ; ) { NextOp = NextOp -> Asl . Next ; while ( NextOp && ( NextOp -> Asl . ParseOpcode != PARSEOP_NAMESEG ) && ( NextOp -> Asl . AmlOpcode != AML_INT_NAMEDFIELD_OP ) ) { NextOp = NextOp -> Asl . Next ; } if ( ! NextOp ) { return ( " " ) ; } if ( NextOp -> Asl . ParseOpcode == PARSEOP_NAMESEG ) { i += ( UINT32 ) NextOp -> Asl . Child -> Asl . Value . Integer ; } else { i += ( UINT32 ) NextOp -> Asl . Value . Integer ; } } * TargetNode = NextOp -> Asl . Node ; * TargetName = AcpiNsGetExternalPathname ( * TargetNode ) ; return ( " " ) ; } return ( NULL ) ; }
FUNCTION:    MpGetConnectionInfo
 PARAMETERS:  Op                      - Parse Op to be examined
              PinIndex                - Index into GPIO PinList
              TargetNode              - Where the field node is returned
              TargetName              - Where the node path is returned
FUNCTION : MpGetConnectionInfo PARAMETERS : Op - Parse Op to be examined PinIndex - Index into GPIO PinList TargetNode - Where the field node is returned TargetName - Where the node path is returned
/*
     * Handle Connection() here. Find the next named FieldUnit.
     * Note: we look at the ParseOpcode for the compiler, look
     * at the AmlOpcode for the disassembler.
     */ /* Find the correct field unit definition */ /* Add length of this field to the current pin index */ /* AML_INT_NAMEDFIELD_OP */ /* Return the node and pathname for the field unit */