diff options
Diffstat (limited to 'sys/contrib/dev/acpica/evmisc.c')
-rw-r--r-- | sys/contrib/dev/acpica/evmisc.c | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/sys/contrib/dev/acpica/evmisc.c b/sys/contrib/dev/acpica/evmisc.c index aae63b2..86f91a5 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: 48 $ + * $Revision: 53 $ * *****************************************************************************/ @@ -118,7 +118,6 @@ #include "acevents.h" #include "acnamesp.h" #include "acinterp.h" -#include "achware.h" #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evmisc") @@ -273,7 +272,7 @@ AcpiEvQueueNotifyRequest ( } /* - * Get the notify object attached to the device Node + * Get the notify object attached to the NS Node */ ObjDesc = AcpiNsGetAttachedObject (Node); if (ObjDesc) @@ -283,29 +282,23 @@ AcpiEvQueueNotifyRequest ( switch (Node->Type) { case ACPI_TYPE_DEVICE: - - if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) - { - HandlerObj = ObjDesc->Device.SysHandler; - } - else - { - HandlerObj = ObjDesc->Device.DrvHandler; - } - break; - - case ACPI_TYPE_THERMAL: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_POWER: if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) { - HandlerObj = ObjDesc->ThermalZone.SysHandler; + HandlerObj = ObjDesc->CommonNotify.SysHandler; } else { - HandlerObj = ObjDesc->ThermalZone.DrvHandler; + HandlerObj = ObjDesc->CommonNotify.DrvHandler; } break; + + default: + /* All other types are not supported */ + return (AE_TYPE); } } @@ -434,6 +427,8 @@ static void ACPI_SYSTEM_XFACE AcpiEvGlobalLockThread ( void *Context) { + ACPI_STATUS Status; + /* Signal threads that are waiting for the lock */ @@ -441,8 +436,12 @@ AcpiEvGlobalLockThread ( { /* Send sufficient units to the semaphore */ - AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, + Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, AcpiGbl_GlobalLockThreadCount); + if (ACPI_FAILURE (Status)) + { + ACPI_REPORT_ERROR (("Could not signal Global Lock semaphore\n")); + } } } @@ -464,6 +463,7 @@ AcpiEvGlobalLockHandler ( void *Context) { BOOLEAN Acquired = FALSE; + ACPI_STATUS Status; /* @@ -480,8 +480,15 @@ AcpiEvGlobalLockHandler ( /* Run the Global Lock thread which will signal all waiting threads */ - AcpiOsQueueForExecution (OSD_PRIORITY_HIGH, AcpiEvGlobalLockThread, - Context); + Status = AcpiOsQueueForExecution (OSD_PRIORITY_HIGH, + AcpiEvGlobalLockThread, Context); + if (ACPI_FAILURE (Status)) + { + ACPI_REPORT_ERROR (("Could not queue Global Lock thread, %s\n", + AcpiFormatException (Status))); + + return (ACPI_INTERRUPT_NOT_HANDLED); + } } return (ACPI_INTERRUPT_HANDLED); @@ -604,10 +611,11 @@ AcpiEvAcquireGlobalLock ( * ******************************************************************************/ -void +ACPI_STATUS AcpiEvReleaseGlobalLock (void) { BOOLEAN Pending = FALSE; + ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE ("EvReleaseGlobalLock"); @@ -616,7 +624,7 @@ AcpiEvReleaseGlobalLock (void) if (!AcpiGbl_GlobalLockThreadCount) { ACPI_REPORT_WARNING(("Cannot release HW Global Lock, it has not been acquired\n")); - return_VOID; + return_ACPI_STATUS (AE_NOT_ACQUIRED); } /* One fewer thread has the global lock */ @@ -626,7 +634,7 @@ AcpiEvReleaseGlobalLock (void) { /* There are still some threads holding the lock, cannot release */ - return_VOID; + return_ACPI_STATUS (AE_OK); } /* @@ -642,10 +650,10 @@ AcpiEvReleaseGlobalLock (void) */ if (Pending) { - AcpiHwBitRegisterWrite (ACPI_BITREG_GLOBAL_LOCK_RELEASE, 1, ACPI_MTX_LOCK); + Status = AcpiSetRegister (ACPI_BITREG_GLOBAL_LOCK_RELEASE, 1, ACPI_MTX_LOCK); } - return_VOID; + return_ACPI_STATUS (Status); } |