FreeBSD/sys/contrib/dev/acpica/components/executer/exoparg6.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiExDoMatch
 *
 * PARAMETERS:  MatchOp         - The AML match operand
 *              PackageObj      - Object from the target package
 *              MatchObj        - Object to be matched
 *
 * RETURN:      TRUE if the match is successful, FALSE otherwise
 *
 * DESCRIPTION: Implements the low-level match for the ASL Match operator.
 *              Package elements will be implicitly converted to the type of
 *              the match object (Integer/Buffer/String).
 *
 ******************************************************************************/
AcpiExDoMatch
PARAMETERS:  MatchOp         - The AML match operand
PackageObj      - Object from the target package
MatchObj        - Object to be matched

TRUE if the match is successful, FALSE otherwise

Implements the low-level match for the ASL Match operator.
Package elements will be implicitly converted to the type of
the match object (Integer/Buffer/String).
AcpiExDoMatch PARAMETERS : MatchOp - The AML match operand PackageObj - Object from the target package MatchObj - Object to be matched TRUE if the match is successful FALSE otherwise Implements the low - level match for the ASL Match operator . Package elements will be implicitly converted to the type of the match object ( Integer / Buffer / String ) .
static BOOLEAN
AcpiExDoMatch (
    UINT32                  MatchOp,
    ACPI_OPERAND_OBJECT     *PackageObj,
    ACPI_OPERAND_OBJECT     *MatchObj)
{
    BOOLEAN                 LogicalResult = TRUE;
    ACPI_STATUS             Status;
    switch (MatchOp)
    {
    case MATCH_MTR:
        break;
    case MATCH_MEQ:
        Status = AcpiExDoLogicalOp (
            AML_LEQUAL_OP, MatchObj, PackageObj, &LogicalResult);
        if (ACPI_FAILURE (Status))
        {
            return (FALSE);
        }
        break;
    case MATCH_MLE:
        Status = AcpiExDoLogicalOp (
            AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
        if (ACPI_FAILURE (Status))
        {
            return (FALSE);
        }
        LogicalResult = (BOOLEAN) !LogicalResult;
        break;
    case MATCH_MLT:
        Status = AcpiExDoLogicalOp (
            AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
        if (ACPI_FAILURE (Status))
        {
            return (FALSE);
        }
        break;
    case MATCH_MGE:
        Status = AcpiExDoLogicalOp (
            AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
        if (ACPI_FAILURE (Status))
        {
            return (FALSE);
        }
        LogicalResult = (BOOLEAN)!LogicalResult;
        break;
    case MATCH_MGT:
        Status = AcpiExDoLogicalOp (
            AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
        if (ACPI_FAILURE (Status))
        {
            return (FALSE);
        }
        break;
    default:
        return (FALSE);
    }
    return (LogicalResult);
}
static BOOLEAN AcpiExDoMatch ( UINT32 MatchOp , ACPI_OPERAND_OBJECT * PackageObj , ACPI_OPERAND_OBJECT * MatchObj ) { BOOLEAN LogicalResult = TRUE ; ACPI_STATUS Status ; switch ( MatchOp ) { case MATCH_MTR : break ; case MATCH_MEQ : Status = AcpiExDoLogicalOp ( AML_LEQUAL_OP , MatchObj , PackageObj , & LogicalResult ) ; if ( ACPI_FAILURE ( Status ) ) { return ( FALSE ) ; } break ; case MATCH_MLE : Status = AcpiExDoLogicalOp ( AML_LLESS_OP , MatchObj , PackageObj , & LogicalResult ) ; if ( ACPI_FAILURE ( Status ) ) { return ( FALSE ) ; } LogicalResult = ( BOOLEAN ) ! LogicalResult ; break ; case MATCH_MLT : Status = AcpiExDoLogicalOp ( AML_LGREATER_OP , MatchObj , PackageObj , & LogicalResult ) ; if ( ACPI_FAILURE ( Status ) ) { return ( FALSE ) ; } break ; case MATCH_MGE : Status = AcpiExDoLogicalOp ( AML_LGREATER_OP , MatchObj , PackageObj , & LogicalResult ) ; if ( ACPI_FAILURE ( Status ) ) { return ( FALSE ) ; } LogicalResult = ( BOOLEAN ) ! LogicalResult ; break ; case MATCH_MGT : Status = AcpiExDoLogicalOp ( AML_LLESS_OP , MatchObj , PackageObj , & LogicalResult ) ; if ( ACPI_FAILURE ( Status ) ) { return ( FALSE ) ; } break ; default : return ( FALSE ) ; } return ( LogicalResult ) ; }
FUNCTION:    AcpiExDoMatch
 PARAMETERS:  MatchOp         - The AML match operand
              PackageObj      - Object from the target package
              MatchObj        - Object to be matched
FUNCTION : AcpiExDoMatch PARAMETERS : MatchOp - The AML match operand PackageObj - Object from the target package MatchObj - Object to be matched
/*
     * Note: Since the PackageObj/MatchObj ordering is opposite to that of
     * the standard logical operators, we have to reverse them when we call
     * DoLogicalOp in order to make the implicit conversion rules work
     * correctly. However, this means we have to flip the entire equation
     * also. A bit ugly perhaps, but overall, better than fussing the
     * parameters around at runtime, over and over again.
     *
     * Below, P[i] refers to the package element, M refers to the Match object.
     */ /* Always true */ /*
         * True if equal: (P[i] == M)
         * Change to:     (M == P[i])
         */ /*
         * True if less than or equal: (P[i] <= M) (P[i] NotGreater than M)
         * Change to:                  (M >= P[i]) (M NotLess than P[i])
         */ /*
         * True if less than: (P[i] < M)
         * Change to:         (M > P[i])
         */ /*
         * True if greater than or equal: (P[i] >= M) (P[i] NotLess than M)
         * Change to:                     (M <= P[i]) (M NotGreater than P[i])
         */ /*
         * True if greater than: (P[i] > M)
         * Change to:            (M < P[i])
         */ /* Undefined */