FreeBSD/sys/contrib/dev/acpica/components/events/evevent.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiEvFixedEventDetect
 *
 * PARAMETERS:  None
 *
 * RETURN:      INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
 *
 * DESCRIPTION: Checks the PM status register for active fixed events
 *
 ******************************************************************************/




Checks the PM status register for active fixed events
Checks the PM status register for active fixed events
UINT32
AcpiEvFixedEventDetect (
    void)
{
    UINT32                  IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
    UINT32                  FixedStatus;
    UINT32                  FixedEnable;
    UINT32                  i;
    ACPI_FUNCTION_NAME (EvFixedEventDetect);
    (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus);
    (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable);
    ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
        "Fixed Event Block: Enable %08X Status %08X\n",
        FixedEnable, FixedStatus));
    for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
    {
        if ((FixedStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) &&
            (FixedEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask))
        {
            AcpiFixedEventCount[i]++;
            if (AcpiGbl_GlobalEventHandler)
            {
                AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_FIXED, NULL,
                     i, AcpiGbl_GlobalEventHandlerContext);
            }
            IntStatus |= AcpiEvFixedEventDispatch (i);
        }
    }
    return (IntStatus);
}
UINT32 AcpiEvFixedEventDetect ( void ) { UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED ; UINT32 FixedStatus ; UINT32 FixedEnable ; UINT32 i ; ACPI_FUNCTION_NAME ( EvFixedEventDetect ) ; ( void ) AcpiHwRegisterRead ( ACPI_REGISTER_PM1_STATUS , & FixedStatus ) ; ( void ) AcpiHwRegisterRead ( ACPI_REGISTER_PM1_ENABLE , & FixedEnable ) ; ACPI_DEBUG_PRINT ( ( ACPI_DB_INTERRUPTS , " \n " , FixedEnable , FixedStatus ) ) ; for ( i = 0 ; i < ACPI_NUM_FIXED_EVENTS ; i ++ ) { if ( ( FixedStatus & AcpiGbl_FixedEventInfo [ i ] . StatusBitMask ) && ( FixedEnable & AcpiGbl_FixedEventInfo [ i ] . EnableBitMask ) ) { AcpiFixedEventCount [ i ] ++ ; if ( AcpiGbl_GlobalEventHandler ) { AcpiGbl_GlobalEventHandler ( ACPI_EVENT_TYPE_FIXED , NULL , i , AcpiGbl_GlobalEventHandlerContext ) ; } IntStatus |= AcpiEvFixedEventDispatch ( i ) ; } } return ( IntStatus ) ; }
FUNCTION:    AcpiEvFixedEventDetect
 PARAMETERS:  None
FUNCTION : AcpiEvFixedEventDetect PARAMETERS : None
/*
     * Read the fixed feature status and enable registers, as all the cases
     * depend on their values. Ignore errors here.
     */ /*
     * Check for all possible Fixed Events and dispatch those that are active
     */ /* Both the status and enable bits must be on for this event */ /*
             * Found an active (signalled) event. Invoke global event
             * handler if present.
             */