diff options
Diffstat (limited to 'sys/contrib/dev/acpica/evmisc.c')
-rw-r--r-- | sys/contrib/dev/acpica/evmisc.c | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/sys/contrib/dev/acpica/evmisc.c b/sys/contrib/dev/acpica/evmisc.c index ad4c637..5062112 100644 --- a/sys/contrib/dev/acpica/evmisc.c +++ b/sys/contrib/dev/acpica/evmisc.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evmisc - Miscellaneous event manager support functions - * $Revision: 56 $ + * $Revision: 57 $ * *****************************************************************************/ @@ -667,7 +667,7 @@ AcpiEvReleaseGlobalLock (void) * * RETURN: none * - * DESCRIPTION: free memory allocated for table storage. + * DESCRIPTION: Disable events and free memory allocated for table storage. * ******************************************************************************/ @@ -680,45 +680,49 @@ AcpiEvTerminate (void) ACPI_FUNCTION_TRACE ("EvTerminate"); - /* - * 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++) + if (AcpiGbl_EventsInitialized) { - Status = AcpiDisableEvent(i, ACPI_EVENT_FIXED, 0); - if (ACPI_FAILURE (Status)) + /* + * 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++) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable fixed event %d.\n", i)); + Status = AcpiDisableEvent(i, ACPI_EVENT_FIXED, 0); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable fixed event %d\n", i)); + } } - } - /* - * Disable all GPEs - */ - for (i = 0; i < AcpiGbl_GpeNumberMax; i++) - { - if (AcpiEvGetGpeNumberIndex(i) != ACPI_GPE_INVALID) + /* + * Disable all GPEs + */ + for (i = 0; i < AcpiGbl_GpeNumberMax; i++) { - Status = AcpiHwDisableGpe(i); - if (ACPI_FAILURE (Status)) + if (AcpiEvGetGpeNumberIndex(i) != ACPI_GPE_INVALID) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable GPE %d.\n", i)); + Status = AcpiHwDisableGpe(i); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable GPE %d\n", i)); + } } } - } - /* - * Remove SCI handler - */ - Status = AcpiEvRemoveSciHandler(); - if (ACPI_FAILURE(Status)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to remove SCI handler.\n")); + /* + * Remove SCI handler + */ + Status = AcpiEvRemoveSciHandler(); + if (ACPI_FAILURE(Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not remove SCI handler\n")); + } } /* @@ -729,7 +733,7 @@ AcpiEvTerminate (void) Status = AcpiDisable (); if (ACPI_FAILURE (Status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiDisable failed.\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiDisable failed\n")); } } |