FreeBSD/sys/contrib/dev/acpica/compiler/aslbtypes.c
/*******************************************************************************
 *
 * FUNCTION:    AnMapArgTypeToBtype
 *
 * PARAMETERS:  ArgType             - The ARGI required type(s) for this
 *                                    argument, from the opcode info table
 *
 * RETURN:      The corresponding Bit-encoded types
 *
 * DESCRIPTION: Convert an encoded ARGI required argument type code into a
 *              bitfield type code. Implements the implicit source conversion
 *              rules.
 *
 ******************************************************************************/
AnMapArgTypeToBtype
PARAMETERS:  ArgType             - The ARGI required type(s) for this
argument, from the opcode info table

The corresponding Bit-encoded types

Convert an encoded ARGI required argument type code into a
bitfield type code. Implements the implicit source conversion
rules.
AnMapArgTypeToBtype PARAMETERS : ArgType - The ARGI required type ( s ) for this argument from the opcode info table The corresponding Bit - encoded types Convert an encoded ARGI required argument type code into a bitfield type code . Implements the implicit source conversion rules .
UINT32
AnMapArgTypeToBtype (
    UINT32                  ArgType)
{
    switch (ArgType)
    {
    case ARGI_ANYTYPE:
        return (ACPI_BTYPE_OBJECTS_AND_REFS);
    case ARGI_PACKAGE:
        return (ACPI_BTYPE_PACKAGE);
    case ARGI_EVENT:
        return (ACPI_BTYPE_EVENT);
    case ARGI_MUTEX:
        return (ACPI_BTYPE_MUTEX);
    case ARGI_DDBHANDLE:
        return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE_OBJECT);
    case ARGI_INTEGER:
    case ARGI_STRING:
    case ARGI_BUFFER:
    case ARGI_BUFFER_OR_STRING:
    case ARGI_COMPUTEDATA:
        return (ACPI_BTYPE_COMPUTE_DATA);
    case ARGI_INTEGER_REF:
        return (ACPI_BTYPE_INTEGER);
    case ARGI_OBJECT_REF:
        return (ACPI_BTYPE_ALL_OBJECTS);
    case ARGI_DEVICE_REF:
        return (ACPI_BTYPE_DEVICE_OBJECTS);
    case ARGI_REFERENCE:
        return (ACPI_BTYPE_NAMED_REFERENCE); 
    case ARGI_TARGETREF:
        return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_DEBUG_OBJECT |
            ACPI_BTYPE_REFERENCE_OBJECT);
    case ARGI_STORE_TARGET:
        return (ACPI_BTYPE_DATA | ACPI_BTYPE_DEBUG_OBJECT |
            ACPI_BTYPE_REFERENCE_OBJECT);
    case ARGI_FIXED_TARGET:
    case ARGI_SIMPLE_TARGET:
        return (ACPI_BTYPE_OBJECTS_AND_REFS);
    case ARGI_DATAOBJECT:
        return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER |
            ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE_OBJECT);
    case ARGI_COMPLEXOBJ:
        return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER |
            ACPI_BTYPE_PACKAGE);
    case ARGI_REF_OR_STRING:
        return (ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE_OBJECT);
    case ARGI_REGION_OR_BUFFER:
        return (ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER |
            ACPI_BTYPE_FIELD_UNIT);
    case ARGI_DATAREFOBJ:
        return (ACPI_BTYPE_DATA_REFERENCE | ACPI_BTYPE_REFERENCE_OBJECT);
    default:
        break;
    }
    return (ACPI_BTYPE_OBJECTS_AND_REFS);
}
UINT32 AnMapArgTypeToBtype ( UINT32 ArgType ) { switch ( ArgType ) { case ARGI_ANYTYPE : return ( ACPI_BTYPE_OBJECTS_AND_REFS ) ; case ARGI_PACKAGE : return ( ACPI_BTYPE_PACKAGE ) ; case ARGI_EVENT : return ( ACPI_BTYPE_EVENT ) ; case ARGI_MUTEX : return ( ACPI_BTYPE_MUTEX ) ; case ARGI_DDBHANDLE : return ( ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE_OBJECT ) ; case ARGI_INTEGER : case ARGI_STRING : case ARGI_BUFFER : case ARGI_BUFFER_OR_STRING : case ARGI_COMPUTEDATA : return ( ACPI_BTYPE_COMPUTE_DATA ) ; case ARGI_INTEGER_REF : return ( ACPI_BTYPE_INTEGER ) ; case ARGI_OBJECT_REF : return ( ACPI_BTYPE_ALL_OBJECTS ) ; case ARGI_DEVICE_REF : return ( ACPI_BTYPE_DEVICE_OBJECTS ) ; case ARGI_REFERENCE : return ( ACPI_BTYPE_NAMED_REFERENCE ) ; case ARGI_TARGETREF : return ( ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_DEBUG_OBJECT | ACPI_BTYPE_REFERENCE_OBJECT ) ; case ARGI_STORE_TARGET : return ( ACPI_BTYPE_DATA | ACPI_BTYPE_DEBUG_OBJECT | ACPI_BTYPE_REFERENCE_OBJECT ) ; case ARGI_FIXED_TARGET : case ARGI_SIMPLE_TARGET : return ( ACPI_BTYPE_OBJECTS_AND_REFS ) ; case ARGI_DATAOBJECT : return ( ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE_OBJECT ) ; case ARGI_COMPLEXOBJ : return ( ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | ACPI_BTYPE_PACKAGE ) ; case ARGI_REF_OR_STRING : return ( ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE_OBJECT ) ; case ARGI_REGION_OR_BUFFER : return ( ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER | ACPI_BTYPE_FIELD_UNIT ) ; case ARGI_DATAREFOBJ : return ( ACPI_BTYPE_DATA_REFERENCE | ACPI_BTYPE_REFERENCE_OBJECT ) ; default : break ; } return ( ACPI_BTYPE_OBJECTS_AND_REFS ) ; }
FUNCTION:    AnMapArgTypeToBtype
 PARAMETERS:  ArgType             - The ARGI required type(s) for this
                                    argument, from the opcode info table
FUNCTION : AnMapArgTypeToBtype PARAMETERS : ArgType - The ARGI required type ( s ) for this argument from the opcode info table
/* Simple types */ /*
         * DDBHandleObject := SuperName
         * ACPI_BTYPE_REFERENCE_OBJECT:
         *      Index reference as parameter of Load/Unload
         */ /* Interchangeable types */ /*
     * Source conversion rules:
     * Integer, String, and Buffer are all interchangeable
     */ /* References */ /* Name or Namestring */ /*
         * Target operand for most math and logic operators.
         * Package objects not allowed as target.
         */ /* Special target for Store(), includes packages */ /* Complex types */ /*
         * Buffer, string, package or reference to a Op -
         * Used only by SizeOf operator
         */ /* Buffer, String, or package */ /* Used by DeRefOf operator only */ /* Used by Load() only. Allow buffers in addition to regions/fields */ /* Used by Store() only, as the source operand */