sys/contrib/dev/acpica-unix/events/evmisc.c
void
AcpiEvTerminate (
    void)
{
    UINT32                  i;
    ACPI_STATUS             Status;


    ACPI_FUNCTION_TRACE (EvTerminate);


    if (AcpiGbl_EventsInitialized)
    {
        /*
         * Disable all event-related functionality. In all cases, on error,
         * print a message but obviously we don't abort.
         */

        /* Disable all fixed events */

        for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
        {
            Status = AcpiDisableEvent (i, 0);
            if (ACPI_FAILURE (Status))
            {
                ACPI_ERROR ((AE_INFO,
                    "Could not disable fixed event %u", (UINT32) i));
            }
        }

        /* Disable all GPEs in all GPE blocks */

        Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);

        /* Remove SCI handler */

        Status = AcpiEvRemoveSciHandler ();
        if (ACPI_FAILURE(Status))
        {
            ACPI_ERROR ((AE_INFO,
                "Could not remove SCI handler"));
        }

        Status = AcpiEvRemoveGlobalLockHandler ();
        if (ACPI_FAILURE(Status))
        {
            ACPI_ERROR ((AE_INFO,
                "Could not remove Global Lock handler"));
        }
    }

    /* Deallocate all handler objects installed within GPE info structs */

    Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL);

    /* Return to original mode if necessary */

    if (AcpiGbl_OriginalMode == ACPI_SYS_MODE_LEGACY)
    {
        Status = AcpiDisable ();
        if (ACPI_FAILURE (Status))
        {
            ACPI_WARNING ((AE_INFO, "AcpiDisable failed"));
        }
    }
    return_VOID;
}
/******************************************************************************
 *
 * FUNCTION:    AcpiEvTerminate
 *
 * PARAMETERS:  none
 *
 * RETURN:      none
 *
 * DESCRIPTION: Disable events and free memory allocated for table storage.
 *
 ******************************************************************************/


none

Disable events and free memory allocated for table storage.
none Disable events and free memory allocated for table storage .
void
AcpiEvTerminate (
    void)
{
    UINT32                  i;
    ACPI_STATUS             Status;
    ACPI_FUNCTION_TRACE (EvTerminate);
    if (AcpiGbl_EventsInitialized)
    {
        for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
        {
            Status = AcpiDisableEvent (i, 0);
            if (ACPI_FAILURE (Status))
            {
                ACPI_ERROR ((AE_INFO,
                    "Could not disable fixed event %u", (UINT32) i));
            }
        }
        Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
        Status = AcpiEvRemoveSciHandler ();
        if (ACPI_FAILURE(Status))
        {
            ACPI_ERROR ((AE_INFO,
                "Could not remove SCI handler"));
        }
        Status = AcpiEvRemoveGlobalLockHandler ();
        if (ACPI_FAILURE(Status))
        {
            ACPI_ERROR ((AE_INFO,
                "Could not remove Global Lock handler"));
        }
    }
    Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL);
    if (AcpiGbl_OriginalMode == ACPI_SYS_MODE_LEGACY)
    {
        Status = AcpiDisable ();
        if (ACPI_FAILURE (Status))
        {
            ACPI_WARNING ((AE_INFO, "AcpiDisable failed"));
        }
    }
    return_VOID;
}
void AcpiEvTerminate ( void ) { UINT32 i ; ACPI_STATUS Status ; ACPI_FUNCTION_TRACE ( EvTerminate ) ; if ( AcpiGbl_EventsInitialized ) { for ( i = 0 ; i < ACPI_NUM_FIXED_EVENTS ; i ++ ) { Status = AcpiDisableEvent ( i , 0 ) ; if ( ACPI_FAILURE ( Status ) ) { ACPI_ERROR ( ( AE_INFO , " " , ( UINT32 ) i ) ) ; } } Status = AcpiEvWalkGpeList ( AcpiHwDisableGpeBlock , NULL ) ; Status = AcpiEvRemoveSciHandler ( ) ; if ( ACPI_FAILURE ( Status ) ) { ACPI_ERROR ( ( AE_INFO , " " ) ) ; } Status = AcpiEvRemoveGlobalLockHandler ( ) ; if ( ACPI_FAILURE ( Status ) ) { ACPI_ERROR ( ( AE_INFO , " " ) ) ; } } Status = AcpiEvWalkGpeList ( AcpiEvDeleteGpeHandlers , NULL ) ; if ( AcpiGbl_OriginalMode == ACPI_SYS_MODE_LEGACY ) { Status = AcpiDisable ( ) ; if ( ACPI_FAILURE ( Status ) ) { ACPI_WARNING ( ( AE_INFO , " " ) ) ; } } return_VOID ; }
FUNCTION:    AcpiEvTerminate
 PARAMETERS:  none
FUNCTION : AcpiEvTerminate PARAMETERS : none
/*
         * Disable all event-related functionality. In all cases, on error,
         * print a message but obviously we don't abort.
         */ /* Disable all fixed events */ /* Disable all GPEs in all GPE blocks */ /* Remove SCI handler */ /* Deallocate all handler objects installed within GPE info structs */ /* Return to original mode if necessary */