FreeBSD/sys/contrib/dev/acpica/compiler/asloperands.c
/*******************************************************************************
 *
 * FUNCTION:    OpnDoMethod
 *
 * PARAMETERS:  Op        - The parent parse node
 *
 * RETURN:      None
 *
 * DESCRIPTION: Construct the operands for the METHOD ASL keyword.
 *
 ******************************************************************************/
OpnDoMethod
PARAMETERS:  Op        - The parent parse node

None

Construct the operands for the METHOD ASL keyword.
OpnDoMethod PARAMETERS : Op - The parent parse node None Construct the operands for the METHOD ASL keyword .
static void
OpnDoMethod (
    ACPI_PARSE_OBJECT       *Op)
{
    ACPI_PARSE_OBJECT       *Next;
    UINT8                   NumArgs = 0;
    UINT8                   Serialized = 0;
    UINT8                   Concurrency = 0;
    UINT8                   MethodFlags;
    Next = Op->Asl.Child;
    Next = Next->Asl.Next;
    if (Next->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
    {
        NumArgs = (UINT8) Next->Asl.Value.Integer;
        Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
    }
    Next = Next->Asl.Next;
    if (Next->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
    {
        Serialized = (UINT8) Next->Asl.Value.Integer;
        Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
    }
    Next = Next->Asl.Next;
    if (Next->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
    {
        OpcAmlConstantWalk (Next, 0, NULL);
        if (Next->Asl.Value.Integer > 15)
        {
            AslError (ASL_ERROR, ASL_MSG_SYNC_LEVEL, Next, NULL);
        }
        Concurrency = (UINT8) Next->Asl.Value.Integer;
    }
    MethodFlags = (UINT8)
        ((NumArgs & 0x7) |
        ((Serialized & 0x1) << 3) |
        ((Concurrency & 0xF) << 4));
    Next->Asl.Value.Integer = MethodFlags;
    Next->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
    Next->Asl.AmlLength = 1;
    Next->Asl.ParseOpcode = PARSEOP_RAW_DATA;
    Op->Asl.Extra = NumArgs;
}
static void OpnDoMethod ( ACPI_PARSE_OBJECT * Op ) { ACPI_PARSE_OBJECT * Next ; UINT8 NumArgs = 0 ; UINT8 Serialized = 0 ; UINT8 Concurrency = 0 ; UINT8 MethodFlags ; Next = Op -> Asl . Child ; Next = Next -> Asl . Next ; if ( Next -> Asl . ParseOpcode != PARSEOP_DEFAULT_ARG ) { NumArgs = ( UINT8 ) Next -> Asl . Value . Integer ; Next -> Asl . ParseOpcode = PARSEOP_DEFAULT_ARG ; } Next = Next -> Asl . Next ; if ( Next -> Asl . ParseOpcode != PARSEOP_DEFAULT_ARG ) { Serialized = ( UINT8 ) Next -> Asl . Value . Integer ; Next -> Asl . ParseOpcode = PARSEOP_DEFAULT_ARG ; } Next = Next -> Asl . Next ; if ( Next -> Asl . ParseOpcode != PARSEOP_DEFAULT_ARG ) { OpcAmlConstantWalk ( Next , 0 , NULL ) ; if ( Next -> Asl . Value . Integer > 15 ) { AslError ( ASL_ERROR , ASL_MSG_SYNC_LEVEL , Next , NULL ) ; } Concurrency = ( UINT8 ) Next -> Asl . Value . Integer ; } MethodFlags = ( UINT8 ) ( ( NumArgs & 0x7 ) | ( ( Serialized & 0x1 ) << 3 ) | ( ( Concurrency & 0xF ) << 4 ) ) ; Next -> Asl . Value . Integer = MethodFlags ; Next -> Asl . AmlOpcode = AML_RAW_DATA_BYTE ; Next -> Asl . AmlLength = 1 ; Next -> Asl . ParseOpcode = PARSEOP_RAW_DATA ; Op -> Asl . Extra = NumArgs ; }
FUNCTION:    OpnDoMethod
 PARAMETERS:  Op        - The parent parse node
FUNCTION : OpnDoMethod PARAMETERS : Op - The parent parse node
/* Optional arguments for this opcode with defaults */ /* Opcode and package length first */ /* Method name */ /* Num args */ /* Serialized Flag */ /* Concurrency value (valid values are 0-15) */ /* This is a ByteConstExpr, so eval the constant now */ /* Put the bits in their proper places */ /* Use the last node for the combined flags byte */ /* Save the arg count in the first node */