FreeBSD/sys/contrib/dev/acpica/components/executer/exmisc.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiExDoLogicalNumericOp
 *
 * PARAMETERS:  Opcode              - AML opcode
 *              Integer0            - Integer operand #0
 *              Integer1            - Integer operand #1
 *              LogicalResult       - TRUE/FALSE result of the operation
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Execute a logical "Numeric" AML opcode. For these Numeric
 *              operators (LAnd and LOr), both operands must be integers.
 *
 *              Note: cleanest machine code seems to be produced by the code
 *              below, rather than using statements of the form:
 *                  Result = (Integer0 && Integer1);
 *
 ******************************************************************************/
AcpiExDoLogicalNumericOp
PARAMETERS:  Opcode              - AML opcode
Integer0            - Integer operand #0
Integer1            - Integer operand #1
LogicalResult       - TRUE/FALSE result of the operation

Status

Execute a logical "Numeric" AML opcode. For these Numeric
operators (LAnd and LOr), both operands must be integers.

cleanest machine code seems to be produced by the code
below, rather than using statements of the form:
Result = (Integer0 && Integer1).
AcpiExDoLogicalNumericOp PARAMETERS : Opcode - AML opcode Integer0 - Integer operand #0 Integer1 - Integer operand #1 LogicalResult - TRUE / FALSE result of the operation Status Execute a logical " Numeric " AML opcode . For these Numeric operators ( LAnd and LOr ) both operands must be integers . cleanest machine code seems to be produced by the code below rather than using statements of the form : Result = ( Integer0 && Integer1 ) .
ACPI_STATUS
AcpiExDoLogicalNumericOp (
    UINT16                  Opcode,
    UINT64                  Integer0,
    UINT64                  Integer1,
    BOOLEAN                 *LogicalResult)
{
    ACPI_STATUS             Status = AE_OK;
    BOOLEAN                 LocalResult = FALSE;
    ACPI_FUNCTION_TRACE (ExDoLogicalNumericOp);
    switch (Opcode)
    {
    case AML_LAND_OP:               
        if (Integer0 && Integer1)
        {
            LocalResult = TRUE;
        }
        break;
    case AML_LOR_OP:                
        if (Integer0 || Integer1)
        {
            LocalResult = TRUE;
        }
        break;
    default:
        Status = AE_AML_INTERNAL;
        break;
    }
    *LogicalResult = LocalResult;
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiExDoLogicalNumericOp ( UINT16 Opcode , UINT64 Integer0 , UINT64 Integer1 , BOOLEAN * LogicalResult ) { ACPI_STATUS Status = AE_OK ; BOOLEAN LocalResult = FALSE ; ACPI_FUNCTION_TRACE ( ExDoLogicalNumericOp ) ; switch ( Opcode ) { case AML_LAND_OP : if ( Integer0 && Integer1 ) { LocalResult = TRUE ; } break ; case AML_LOR_OP : if ( Integer0 || Integer1 ) { LocalResult = TRUE ; } break ; default : Status = AE_AML_INTERNAL ; break ; } * LogicalResult = LocalResult ; return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiExDoLogicalNumericOp
 PARAMETERS:  Opcode              - AML opcode
              Integer0            - Integer operand #0
              Integer1            - Integer operand #1
              LogicalResult       - TRUE/FALSE result of the operation
FUNCTION : AcpiExDoLogicalNumericOp PARAMETERS : Opcode - AML opcode Integer0 - Integer operand #0 Integer1 - Integer operand #1 LogicalResult - TRUE / FALSE result of the operation
/* LAnd (Integer0, Integer1) */ /* LOr (Integer0, Integer1) */ /* Return the logical result and status */