sys/contrib/dev/acpica/source/common/adwalk.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmInspectPossibleArgs
 *
 * PARAMETERS:  CurrentOpArgCount   - Which arg of the current op was the
 *                                    possible method invocation found
 *              TargetCount         - Number of targets (0,1,2) for this op
 *              Op                  - Parse op
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Examine following args and next ops for possible arguments
 *              for an unrecognized method invocation.
 *
 ******************************************************************************/
AcpiDmInspectPossibleArgs
PARAMETERS:  CurrentOpArgCount   - Which arg of the current op was the
possible method invocation found
TargetCount         - Number of targets (0,1,2) for this op
Op                  - Parse op

Status

Examine following args and next ops for possible arguments
for an unrecognized method invocation.
AcpiDmInspectPossibleArgs PARAMETERS : CurrentOpArgCount - Which arg of the current op was the possible method invocation found TargetCount - Number of targets ( 0 1 2 ) for this op Op - Parse op Status Examine following args and next ops for possible arguments for an unrecognized method invocation .
static UINT32
AcpiDmInspectPossibleArgs (
    UINT32                  CurrentOpArgCount,
    UINT32                  TargetCount,
    ACPI_PARSE_OBJECT       *Op)
{
    const ACPI_OPCODE_INFO  *OpInfo;
    UINT32                  i;
    UINT32                  ArgumentCount = 0;
    ACPI_PARSE_OBJECT       *NextOp;
    ACPI_PARSE_OBJECT       *ExecuteOp;
    if (!Op)
    {
        return (0);
    }
    NextOp = Op->Common.Next;
    for (i = 0; (i < ACPI_METHOD_NUM_ARGS) && NextOp; i++)
    {
        OpInfo = AcpiPsGetOpcodeInfo (NextOp->Common.AmlOpcode);
        if ((NextOp->Common.AmlOpcode == AML_STORE_OP) ||
            (NextOp->Common.AmlOpcode == AML_NOTIFY_OP) ||
            (OpInfo->Class == AML_CLASS_CONTROL) ||
            (OpInfo->Class == AML_CLASS_CREATE) ||
            (OpInfo->Class == AML_CLASS_NAMED_OBJECT))
        {
            break;
        }
        if (OpInfo->Class == AML_CLASS_EXECUTE)
        {
            ExecuteOp = NextOp->Common.Value.Arg;
            while (ExecuteOp)
            {
                if ((ExecuteOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
                    (ExecuteOp->Common.Value.Arg == NULL))
                {
                    break;
                }
                if (NextOp->Common.AmlOpcode == AML_REF_OF_OP)
                {
                    break;
                }
                ExecuteOp = ExecuteOp->Common.Next;
            }
            if (!ExecuteOp)
            {
                return (ArgumentCount);
            }
        }
        ArgumentCount++;
        NextOp = NextOp->Common.Next;
    }
    return (ArgumentCount);
}
static UINT32 AcpiDmInspectPossibleArgs ( UINT32 CurrentOpArgCount , UINT32 TargetCount , ACPI_PARSE_OBJECT * Op ) { const ACPI_OPCODE_INFO * OpInfo ; UINT32 i ; UINT32 ArgumentCount = 0 ; ACPI_PARSE_OBJECT * NextOp ; ACPI_PARSE_OBJECT * ExecuteOp ; if ( ! Op ) { return ( 0 ) ; } NextOp = Op -> Common . Next ; for ( i = 0 ; ( i < ACPI_METHOD_NUM_ARGS ) && NextOp ; i ++ ) { OpInfo = AcpiPsGetOpcodeInfo ( NextOp -> Common . AmlOpcode ) ; if ( ( NextOp -> Common . AmlOpcode == AML_STORE_OP ) || ( NextOp -> Common . AmlOpcode == AML_NOTIFY_OP ) || ( OpInfo -> Class == AML_CLASS_CONTROL ) || ( OpInfo -> Class == AML_CLASS_CREATE ) || ( OpInfo -> Class == AML_CLASS_NAMED_OBJECT ) ) { break ; } if ( OpInfo -> Class == AML_CLASS_EXECUTE ) { ExecuteOp = NextOp -> Common . Value . Arg ; while ( ExecuteOp ) { if ( ( ExecuteOp -> Common . AmlOpcode == AML_INT_NAMEPATH_OP ) && ( ExecuteOp -> Common . Value . Arg == NULL ) ) { break ; } if ( NextOp -> Common . AmlOpcode == AML_REF_OF_OP ) { break ; } ExecuteOp = ExecuteOp -> Common . Next ; } if ( ! ExecuteOp ) { return ( ArgumentCount ) ; } } ArgumentCount ++ ; NextOp = NextOp -> Common . Next ; } return ( ArgumentCount ) ; }
FUNCTION:    AcpiDmInspectPossibleArgs
 PARAMETERS:  CurrentOpArgCount   - Which arg of the current op was the
                                    possible method invocation found
              TargetCount         - Number of targets (0,1,2) for this op
              Op                  - Parse op
FUNCTION : AcpiDmInspectPossibleArgs PARAMETERS : CurrentOpArgCount - Which arg of the current op was the possible method invocation found TargetCount - Number of targets ( 0 1 2 ) for this op Op - Parse op
/* Lookahead for the maximum number of possible arguments */ /* Any one of these operators is "very probably" not a method arg */ /* Probable that this is method arg if there is no target */ /* No target, could be a method arg */ /* Has a target, not method arg */