Deleted Added
full compact
exmutex.c (126372) exmutex.c (127175)
1
2/******************************************************************************
3 *
4 * Module Name: exmutex - ASL Mutex Acquire/Release functions
1
2/******************************************************************************
3 *
4 * Module Name: exmutex - ASL Mutex Acquire/Release functions
5 * $Revision: 20 $
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 */
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
262 if ((ObjDesc->Mutex.OwnerThread) &&
263 (ObjDesc->Mutex.OwnerThread->ThreadId == WalkState->Thread->ThreadId))
261 if (ObjDesc->Mutex.OwnerThread)
264 {
262 {
265 /*
266 * The mutex is already owned by this thread,
267 * just increment the acquisition depth
268 */
269 ObjDesc->Mutex.AcquisitionDepth++;
270 return_ACPI_STATUS (AE_OK);
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 }
271 }
272
273 /* Acquire the mutex, wait if necessary */
274
275 Status = AcpiExSystemAcquireMutex (TimeDesc, ObjDesc);
276 if (ACPI_FAILURE (Status))
277 {
278 /* Includes failure from a timeout on TimeDesc */

--- 57 unchanged lines hidden (view full) ---

336
337 if (!WalkState->Thread)
338 {
339 ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n",
340 AcpiUtGetNodeName (ObjDesc->Mutex.Node)));
341 return_ACPI_STATUS (AE_AML_INTERNAL);
342 }
343
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
344 /* The Mutex is owned, but this thread must be the owner */
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))
345
354
346 if (ObjDesc->Mutex.OwnerThread->ThreadId != WalkState->Thread->ThreadId)
347 {
348 ACPI_REPORT_ERROR ((
349 "Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n",
350 WalkState->Thread->ThreadId,
351 AcpiUtGetNodeName (ObjDesc->Mutex.Node),
352 ObjDesc->Mutex.OwnerThread->ThreadId));
353 return_ACPI_STATUS (AE_AML_NOT_OWNER);
354 }

--- 91 unchanged lines hidden ---
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 ---