FreeBSD/sys/contrib/dev/acpica/components/executer/exresop.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiExCheckObjectType
 *
 * PARAMETERS:  TypeNeeded          Object type needed
 *              ThisType            Actual object type
 *              Object              Object pointer
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Check required type against actual type
 *
 ******************************************************************************/
AcpiExCheckObjectType
PARAMETERS:  TypeNeeded          Object type needed
ThisType            Actual object type
Object              Object pointer

Status

Check required type against actual type
AcpiExCheckObjectType PARAMETERS : TypeNeeded Object type needed ThisType Actual object type Object Object pointer Status Check required type against actual type
static ACPI_STATUS
AcpiExCheckObjectType (
    ACPI_OBJECT_TYPE        TypeNeeded,
    ACPI_OBJECT_TYPE        ThisType,
    void                    *Object)
{
    ACPI_FUNCTION_ENTRY ();
    if (TypeNeeded == ACPI_TYPE_ANY)
    {
        return (AE_OK);
    }
    if (TypeNeeded == ACPI_TYPE_LOCAL_REFERENCE)
    {
        if ((ThisType == ACPI_TYPE_INTEGER) &&
            (((ACPI_OPERAND_OBJECT *) Object)->Common.Flags &
                AOPOBJ_AML_CONSTANT))
        {
            return (AE_OK);
        }
    }
    if (TypeNeeded != ThisType)
    {
        ACPI_ERROR ((AE_INFO,
            "Needed type [%s], found [%s] %p",
            AcpiUtGetTypeName (TypeNeeded),
            AcpiUtGetTypeName (ThisType), Object));
        return (AE_AML_OPERAND_TYPE);
    }
    return (AE_OK);
}
static ACPI_STATUS AcpiExCheckObjectType ( ACPI_OBJECT_TYPE TypeNeeded , ACPI_OBJECT_TYPE ThisType , void * Object ) { ACPI_FUNCTION_ENTRY ( ) ; if ( TypeNeeded == ACPI_TYPE_ANY ) { return ( AE_OK ) ; } if ( TypeNeeded == ACPI_TYPE_LOCAL_REFERENCE ) { if ( ( ThisType == ACPI_TYPE_INTEGER ) && ( ( ( ACPI_OPERAND_OBJECT * ) Object ) -> Common . Flags & AOPOBJ_AML_CONSTANT ) ) { return ( AE_OK ) ; } } if ( TypeNeeded != ThisType ) { ACPI_ERROR ( ( AE_INFO , " " , AcpiUtGetTypeName ( TypeNeeded ) , AcpiUtGetTypeName ( ThisType ) , Object ) ) ; return ( AE_AML_OPERAND_TYPE ) ; } return ( AE_OK ) ; }
FUNCTION:    AcpiExCheckObjectType
 PARAMETERS:  TypeNeeded          Object type needed
              ThisType            Actual object type
              Object              Object pointer
FUNCTION : AcpiExCheckObjectType PARAMETERS : TypeNeeded Object type needed ThisType Actual object type Object Object pointer
/* All types OK, so we don't perform any typechecks */ /*
         * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
         * objects and thus allow them to be targets. (As per the ACPI
         * specification, a store to a constant is a noop.)
         */