sys/contrib/dev/acpica-unix/compiler/aslopcodes.c
void
OpcGenerateAmlOpcode (
    ACPI_PARSE_OBJECT       *Op)
{

    UINT16                  Index;


    Index = (UINT16) (Op->Asl.ParseOpcode - ASL_PARSE_OPCODE_BASE);

    Op->Asl.AmlOpcode     = AslKeywordMapping[Index].AmlOpcode;
    Op->Asl.AcpiBtype     = AslKeywordMapping[Index].AcpiBtype;
    Op->Asl.CompileFlags |= AslKeywordMapping[Index].Flags;

    if (!Op->Asl.Value.Integer)
    {
        Op->Asl.Value.Integer = AslKeywordMapping[Index].Value;
    }

    /* Special handling for some opcodes */

    switch (Op->Asl.ParseOpcode)
    {
    case PARSEOP_INTEGER:
        /*
         * Set the opcode based on the size of the integer
         */
        (void) OpcSetOptimalIntegerSize (Op);
        break;

    case PARSEOP_OFFSET:

        Op->Asl.AmlOpcodeLength = 1;
        break;

    case PARSEOP_ACCESSAS:

        OpcDoAccessAs (Op);
        break;

    case PARSEOP_EISAID:

        OpcDoEisaId (Op);
        break;

    case PARSEOP_TOUUID:

        OpcDoUuId (Op);
        break;

    case PARSEOP_UNICODE:

        OpcDoUnicode (Op);
        break;

    case PARSEOP_INCLUDE:

        Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
        Gbl_HasIncludeFiles = TRUE;
        break;

    case PARSEOP_EXTERNAL:

        Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
        Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
        break;

    default:
        /* Nothing to do for other opcodes */
        break;
    }

    return;
}
/*******************************************************************************
 *
 * FUNCTION:    OpcGenerateAmlOpcode
 *
 * PARAMETERS:  Op        - Parse node
 *
 * RETURN:      None
 *
 * DESCRIPTION: Generate the AML opcode associated with the node and its
 *              parse (lex/flex) keyword opcode.  Essentially implements
 *              a mapping between the parse opcodes and the actual AML opcodes.
 *
 ******************************************************************************/
OpcGenerateAmlOpcode
PARAMETERS:  Op        - Parse node

None

Generate the AML opcode associated with the node and its
parse (lex/flex) keyword opcode.  Essentially implements
a mapping between the parse opcodes and the actual AML opcodes.
OpcGenerateAmlOpcode PARAMETERS : Op - Parse node None Generate the AML opcode associated with the node and its parse ( lex / flex ) keyword opcode . Essentially implements a mapping between the parse opcodes and the actual AML opcodes .
void
OpcGenerateAmlOpcode (
    ACPI_PARSE_OBJECT       *Op)
{
    UINT16                  Index;
    Index = (UINT16) (Op->Asl.ParseOpcode - ASL_PARSE_OPCODE_BASE);
    Op->Asl.AmlOpcode     = AslKeywordMapping[Index].AmlOpcode;
    Op->Asl.AcpiBtype     = AslKeywordMapping[Index].AcpiBtype;
    Op->Asl.CompileFlags |= AslKeywordMapping[Index].Flags;
    if (!Op->Asl.Value.Integer)
    {
        Op->Asl.Value.Integer = AslKeywordMapping[Index].Value;
    }
    switch (Op->Asl.ParseOpcode)
    {
    case PARSEOP_INTEGER:
        (void) OpcSetOptimalIntegerSize (Op);
        break;
    case PARSEOP_OFFSET:
        Op->Asl.AmlOpcodeLength = 1;
        break;
    case PARSEOP_ACCESSAS:
        OpcDoAccessAs (Op);
        break;
    case PARSEOP_EISAID:
        OpcDoEisaId (Op);
        break;
    case PARSEOP_TOUUID:
        OpcDoUuId (Op);
        break;
    case PARSEOP_UNICODE:
        OpcDoUnicode (Op);
        break;
    case PARSEOP_INCLUDE:
        Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
        Gbl_HasIncludeFiles = TRUE;
        break;
    case PARSEOP_EXTERNAL:
        Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
        Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
        break;
    default:
        break;
    }
    return;
}
void OpcGenerateAmlOpcode ( ACPI_PARSE_OBJECT * Op ) { UINT16 Index ; Index = ( UINT16 ) ( Op -> Asl . ParseOpcode - ASL_PARSE_OPCODE_BASE ) ; Op -> Asl . AmlOpcode = AslKeywordMapping [ Index ] . AmlOpcode ; Op -> Asl . AcpiBtype = AslKeywordMapping [ Index ] . AcpiBtype ; Op -> Asl . CompileFlags |= AslKeywordMapping [ Index ] . Flags ; if ( ! Op -> Asl . Value . Integer ) { Op -> Asl . Value . Integer = AslKeywordMapping [ Index ] . Value ; } switch ( Op -> Asl . ParseOpcode ) { case PARSEOP_INTEGER : ( void ) OpcSetOptimalIntegerSize ( Op ) ; break ; case PARSEOP_OFFSET : Op -> Asl . AmlOpcodeLength = 1 ; break ; case PARSEOP_ACCESSAS : OpcDoAccessAs ( Op ) ; break ; case PARSEOP_EISAID : OpcDoEisaId ( Op ) ; break ; case PARSEOP_TOUUID : OpcDoUuId ( Op ) ; break ; case PARSEOP_UNICODE : OpcDoUnicode ( Op ) ; break ; case PARSEOP_INCLUDE : Op -> Asl . Child -> Asl . ParseOpcode = PARSEOP_DEFAULT_ARG ; Gbl_HasIncludeFiles = TRUE ; break ; case PARSEOP_EXTERNAL : Op -> Asl . Child -> Asl . ParseOpcode = PARSEOP_DEFAULT_ARG ; Op -> Asl . Child -> Asl . Next -> Asl . ParseOpcode = PARSEOP_DEFAULT_ARG ; break ; default : break ; } return ; }
FUNCTION:    OpcGenerateAmlOpcode
 PARAMETERS:  Op        - Parse node
FUNCTION : OpcGenerateAmlOpcode PARAMETERS : Op - Parse node
/* Special handling for some opcodes */ /*
         * Set the opcode based on the size of the integer
         */ /* Nothing to do for other opcodes */