FreeBSD/sys/contrib/dev/acpica/compiler/asllength.c
/*******************************************************************************
 *
 * FUNCTION:    CgGenerateAmlOpcodeLength
 *
 * PARAMETERS:  Op          - Parse node whose AML opcode lengths will be
 *                            calculated
 *
 * RETURN:      None.
 *
 * DESCRIPTION: Calculate the AmlOpcodeLength, AmlPkgLenBytes, and AmlLength
 *              fields for this node.
 *
 ******************************************************************************/
CgGenerateAmlOpcodeLength
PARAMETERS:  Op          - Parse node whose AML opcode lengths will be
calculated

None.

Calculate the AmlOpcodeLength, AmlPkgLenBytes, and AmlLength
fields for this node.
CgGenerateAmlOpcodeLength PARAMETERS : Op - Parse node whose AML opcode lengths will be calculated None . Calculate the AmlOpcodeLength AmlPkgLenBytes and AmlLength fields for this node .
static void
CgGenerateAmlOpcodeLength (
    ACPI_PARSE_OBJECT       *Op)
{
    if (Op->Asl.AmlOpcode > 0x00FF)
    {
        Op->Asl.AmlOpcodeLength = 2;
    }
    else
    {
        Op->Asl.AmlOpcodeLength = 1;
    }
    Op->Asl.AmlPkgLenBytes = 0;
    if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
    {
        Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount (
            Op, Op->Asl.AmlSubtreeLength);
    }
    switch (Op->Asl.AmlOpcode)
    {
    case AML_BYTE_OP:
        Op->Asl.AmlLength = 1;
        break;
    case AML_WORD_OP:
        Op->Asl.AmlLength = 2;
        break;
    case AML_DWORD_OP:
        Op->Asl.AmlLength = 4;
        break;
    case AML_QWORD_OP:
        Op->Asl.AmlLength = 8;
        break;
    default:
        break;
    }
}
static void CgGenerateAmlOpcodeLength ( ACPI_PARSE_OBJECT * Op ) { if ( Op -> Asl . AmlOpcode > 0x00FF ) { Op -> Asl . AmlOpcodeLength = 2 ; } else { Op -> Asl . AmlOpcodeLength = 1 ; } Op -> Asl . AmlPkgLenBytes = 0 ; if ( Op -> Asl . CompileFlags & NODE_AML_PACKAGE ) { Op -> Asl . AmlPkgLenBytes = CgGetPackageLenByteCount ( Op , Op -> Asl . AmlSubtreeLength ) ; } switch ( Op -> Asl . AmlOpcode ) { case AML_BYTE_OP : Op -> Asl . AmlLength = 1 ; break ; case AML_WORD_OP : Op -> Asl . AmlLength = 2 ; break ; case AML_DWORD_OP : Op -> Asl . AmlLength = 4 ; break ; case AML_QWORD_OP : Op -> Asl . AmlLength = 8 ; break ; default : break ; } }
FUNCTION:    CgGenerateAmlOpcodeLength
 PARAMETERS:  Op          - Parse node whose AML opcode lengths will be
                            calculated
FUNCTION : CgGenerateAmlOpcodeLength PARAMETERS : Op - Parse node whose AML opcode lengths will be calculated
/* Check for two-byte opcode */ /* Does this opcode have an associated "PackageLength" field? */ /* Data opcode lengths are easy */ /* All data opcodes must be above */