1
2/******************************************************************************
3 *
4 * Module Name: exmutex - ASL Mutex Acquire/Release functions
5 * $Revision: 21 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
--- 239 unchanged lines hidden (view full) ---
253 ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect SyncLevel\n",
254 AcpiUtGetNodeName (ObjDesc->Mutex.Node)));
255 return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
256 }
257
258 /*
259 * Support for multiple acquires by the owning thread
260 */
261 if (ObjDesc->Mutex.OwnerThread)
262 {
263 /* Special case for Global Lock, allow all threads */
264
265 if ((ObjDesc->Mutex.OwnerThread->ThreadId == WalkState->Thread->ThreadId) ||
266 (ObjDesc->Mutex.Semaphore == AcpiGbl_GlobalLockSemaphore))
267 {
268 /*
269 * The mutex is already owned by this thread,
270 * just increment the acquisition depth
271 */
272 ObjDesc->Mutex.AcquisitionDepth++;
273 return_ACPI_STATUS (AE_OK);
274 }
275 }
276
277 /* Acquire the mutex, wait if necessary */
278
279 Status = AcpiExSystemAcquireMutex (TimeDesc, ObjDesc);
280 if (ACPI_FAILURE (Status))
281 {
282 /* Includes failure from a timeout on TimeDesc */
--- 57 unchanged lines hidden (view full) ---
340
341 if (!WalkState->Thread)
342 {
343 ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n",
344 AcpiUtGetNodeName (ObjDesc->Mutex.Node)));
345 return_ACPI_STATUS (AE_AML_INTERNAL);
346 }
347
348 /*
349 * The Mutex is owned, but this thread must be the owner.
350 * Special case for Global Lock, any thread can release
351 */
352 if ((ObjDesc->Mutex.OwnerThread->ThreadId != WalkState->Thread->ThreadId) &&
353 (ObjDesc->Mutex.Semaphore != AcpiGbl_GlobalLockSemaphore))
354
355 {
356 ACPI_REPORT_ERROR ((
357 "Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n",
358 WalkState->Thread->ThreadId,
359 AcpiUtGetNodeName (ObjDesc->Mutex.Node),
360 ObjDesc->Mutex.OwnerThread->ThreadId));
361 return_ACPI_STATUS (AE_AML_NOT_OWNER);
362 }
--- 91 unchanged lines hidden ---
2/******************************************************************************
3 *
4 * Module Name: exmutex - ASL Mutex Acquire/Release functions
5 * $Revision: 21 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
--- 239 unchanged lines hidden (view full) ---
253 ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect SyncLevel\n",
254 AcpiUtGetNodeName (ObjDesc->Mutex.Node)));
255 return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
256 }
257
258 /*
259 * Support for multiple acquires by the owning thread
260 */
261 if (ObjDesc->Mutex.OwnerThread)
262 {
263 /* Special case for Global Lock, allow all threads */
264
265 if ((ObjDesc->Mutex.OwnerThread->ThreadId == WalkState->Thread->ThreadId) ||
266 (ObjDesc->Mutex.Semaphore == AcpiGbl_GlobalLockSemaphore))
267 {
268 /*
269 * The mutex is already owned by this thread,
270 * just increment the acquisition depth
271 */
272 ObjDesc->Mutex.AcquisitionDepth++;
273 return_ACPI_STATUS (AE_OK);
274 }
275 }
276
277 /* Acquire the mutex, wait if necessary */
278
279 Status = AcpiExSystemAcquireMutex (TimeDesc, ObjDesc);
280 if (ACPI_FAILURE (Status))
281 {
282 /* Includes failure from a timeout on TimeDesc */
--- 57 unchanged lines hidden (view full) ---
340
341 if (!WalkState->Thread)
342 {
343 ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n",
344 AcpiUtGetNodeName (ObjDesc->Mutex.Node)));
345 return_ACPI_STATUS (AE_AML_INTERNAL);
346 }
347
348 /*
349 * The Mutex is owned, but this thread must be the owner.
350 * Special case for Global Lock, any thread can release
351 */
352 if ((ObjDesc->Mutex.OwnerThread->ThreadId != WalkState->Thread->ThreadId) &&
353 (ObjDesc->Mutex.Semaphore != AcpiGbl_GlobalLockSemaphore))
354
355 {
356 ACPI_REPORT_ERROR ((
357 "Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n",
358 WalkState->Thread->ThreadId,
359 AcpiUtGetNodeName (ObjDesc->Mutex.Node),
360 ObjDesc->Mutex.OwnerThread->ThreadId));
361 return_ACPI_STATUS (AE_AML_NOT_OWNER);
362 }
--- 91 unchanged lines hidden ---