FreeBSD/sys/contrib/dev/acpica/compiler/asltree.c
/*******************************************************************************
 *
 * FUNCTION:    TrUpdateNode
 *
 * PARAMETERS:  ParseOpcode         - New opcode to be assigned to the node
 *              Op                  - An existing parse node
 *
 * RETURN:      The updated node
 *
 * DESCRIPTION: Change the parse opcode assigned to a node. Usually used to
 *              change an opcode to DEFAULT_ARG so that the node is ignored
 *              during the code generation. Also used to set generic integers
 *              to a specific size (8, 16, 32, or 64 bits)
 *
 ******************************************************************************/
TrUpdateNode
PARAMETERS:  ParseOpcode         - New opcode to be assigned to the node
Op                  - An existing parse node

The updated node

Change the parse opcode assigned to a node. Usually used to
change an opcode to DEFAULT_ARG so that the node is ignored
during the code generation. Also used to set generic integers
to a specific size (8, 16, 32, or 64 bits)
TrUpdateNode PARAMETERS : ParseOpcode - New opcode to be assigned to the node Op - An existing parse node The updated node Change the parse opcode assigned to a node . Usually used to change an opcode to DEFAULT_ARG so that the node is ignored during the code generation . Also used to set generic integers to a specific size ( 8 16 32 or 64 bits )
ACPI_PARSE_OBJECT *
TrUpdateNode (
    UINT32                  ParseOpcode,
    ACPI_PARSE_OBJECT       *Op)
{
    if (!Op)
    {
        return (NULL);
    }
    DbgPrint (ASL_PARSE_OUTPUT,
        "\nUpdateNode: Old - %s, New - %s\n",
        UtGetOpName (Op->Asl.ParseOpcode),
        UtGetOpName (ParseOpcode));
    if (Op->Asl.ParseOpcode == PARSEOP_ONES)
    {
        switch (ParseOpcode)
        {
        case PARSEOP_BYTECONST:
            Op->Asl.Value.Integer = ACPI_UINT8_MAX;
            break;
        case PARSEOP_WORDCONST:
            Op->Asl.Value.Integer = ACPI_UINT16_MAX;
            break;
        case PARSEOP_DWORDCONST:
            Op->Asl.Value.Integer = ACPI_UINT32_MAX;
            break;
        default:
            break;
        }
    }
    Op->Asl.ParseOpcode = (UINT16) ParseOpcode;
    UtSetParseOpName (Op);
    switch (ParseOpcode)
    {
    case PARSEOP_BYTECONST:
        UtCheckIntegerRange (Op, 0x00, ACPI_UINT8_MAX);
        Op->Asl.Value.Integer &= ACPI_UINT8_MAX;
        break;
    case PARSEOP_WORDCONST:
        UtCheckIntegerRange (Op, 0x00, ACPI_UINT16_MAX);
        Op->Asl.Value.Integer &= ACPI_UINT16_MAX;
        break;
    case PARSEOP_DWORDCONST:
        UtCheckIntegerRange (Op, 0x00, ACPI_UINT32_MAX);
        Op->Asl.Value.Integer &= ACPI_UINT32_MAX;
        break;
    default:
        break;
    }
    return (Op);
}
ACPI_PARSE_OBJECT * TrUpdateNode ( UINT32 ParseOpcode , ACPI_PARSE_OBJECT * Op ) { if ( ! Op ) { return ( NULL ) ; } DbgPrint ( ASL_PARSE_OUTPUT , " \n \n " , UtGetOpName ( Op -> Asl . ParseOpcode ) , UtGetOpName ( ParseOpcode ) ) ; if ( Op -> Asl . ParseOpcode == PARSEOP_ONES ) { switch ( ParseOpcode ) { case PARSEOP_BYTECONST : Op -> Asl . Value . Integer = ACPI_UINT8_MAX ; break ; case PARSEOP_WORDCONST : Op -> Asl . Value . Integer = ACPI_UINT16_MAX ; break ; case PARSEOP_DWORDCONST : Op -> Asl . Value . Integer = ACPI_UINT32_MAX ; break ; default : break ; } } Op -> Asl . ParseOpcode = ( UINT16 ) ParseOpcode ; UtSetParseOpName ( Op ) ; switch ( ParseOpcode ) { case PARSEOP_BYTECONST : UtCheckIntegerRange ( Op , 0x00 , ACPI_UINT8_MAX ) ; Op -> Asl . Value . Integer &= ACPI_UINT8_MAX ; break ; case PARSEOP_WORDCONST : UtCheckIntegerRange ( Op , 0x00 , ACPI_UINT16_MAX ) ; Op -> Asl . Value . Integer &= ACPI_UINT16_MAX ; break ; case PARSEOP_DWORDCONST : UtCheckIntegerRange ( Op , 0x00 , ACPI_UINT32_MAX ) ; Op -> Asl . Value . Integer &= ACPI_UINT32_MAX ; break ; default : break ; } return ( Op ) ; }
FUNCTION:    TrUpdateNode
 PARAMETERS:  ParseOpcode         - New opcode to be assigned to the node
              Op                  - An existing parse node
FUNCTION : TrUpdateNode PARAMETERS : ParseOpcode - New opcode to be assigned to the node Op - An existing parse node
/* Assign new opcode and name */ /* Don't need to do the QWORD case */ /* Don't care about others */ /*
     * For the BYTE, WORD, and DWORD constants, make sure that the integer
     * that was passed in will actually fit into the data type
     */ /* Don't care about others, don't need to check QWORD */