diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
commit | 1824f192010fc0c0826e9889892e534075b58793 (patch) | |
tree | bbc04a2733724f3f0ab5cecb259948ac9a9723d7 /sys/contrib/dev/acpica/evmisc.c | |
parent | 3f86517f16a9cf970e93e483e90066da6eb323dd (diff) | |
download | FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.zip FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.tar.gz |
Vendor import of the Intel ACPI CA 20020815 drop.
Diffstat (limited to 'sys/contrib/dev/acpica/evmisc.c')
-rw-r--r-- | sys/contrib/dev/acpica/evmisc.c | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/sys/contrib/dev/acpica/evmisc.c b/sys/contrib/dev/acpica/evmisc.c index 86f91a5..ad4c637 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: 53 $ + * $Revision: 56 $ * *****************************************************************************/ @@ -480,7 +480,7 @@ AcpiEvGlobalLockHandler ( /* Run the Global Lock thread which will signal all waiting threads */ - Status = AcpiOsQueueForExecution (OSD_PRIORITY_HIGH, + Status = AcpiOsQueueForExecution (OSD_PRIORITY_HIGH, AcpiEvGlobalLockThread, Context); if (ACPI_FAILURE (Status)) { @@ -556,12 +556,14 @@ AcpiEvAcquireGlobalLock ( ACPI_FUNCTION_TRACE ("EvAcquireGlobalLock"); +#ifndef ACPI_APPLICATION /* Make sure that we actually have a global lock */ if (!AcpiGbl_GlobalLockPresent) { return_ACPI_STATUS (AE_NO_GLOBAL_LOCK); } +#endif /* One more thread wants the global lock */ @@ -672,9 +674,64 @@ AcpiEvReleaseGlobalLock (void) void AcpiEvTerminate (void) { + NATIVE_UINT_MAX32 i; + ACPI_STATUS Status; + 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++) + { + Status = AcpiDisableEvent(i, ACPI_EVENT_FIXED, 0); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable fixed event %d.\n", i)); + } + } + + /* + * Disable all GPEs + */ + for (i = 0; i < AcpiGbl_GpeNumberMax; i++) + { + if (AcpiEvGetGpeNumberIndex(i) != ACPI_GPE_INVALID) + { + Status = AcpiHwDisableGpe(i); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to 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")); + } + + /* + * Return to original mode if necessary + */ + if (AcpiGbl_OriginalMode == ACPI_SYS_MODE_LEGACY) + { + Status = AcpiDisable (); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiDisable failed.\n")); + } + } /* * Free global tables, etc. |