Rev 1498 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 2216 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | 6 | ||
7 | /****************************************************************************** |
7 | /****************************************************************************** |
8 | * |
8 | * |
9 | * 1. Copyright Notice |
9 | * 1. Copyright Notice |
10 | * |
10 | * |
11 | * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
12 | * All rights reserved. |
12 | * All rights reserved. |
13 | * |
13 | * |
14 | * 2. License |
14 | * 2. License |
15 | * |
15 | * |
Line 180... | Line 180... | ||
180 | if (ACPI_FAILURE (Status)) |
180 | if (ACPI_FAILURE (Status)) |
181 | { |
181 | { |
182 | return_ACPI_STATUS (Status); |
182 | return_ACPI_STATUS (Status); |
183 | } |
183 | } |
Line -... | Line 184... | ||
- | 184 | ||
- | 185 | /* Mutex for _OSI support */ |
|
- | 186 | Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex); |
|
- | 187 | if (ACPI_FAILURE (Status)) |
|
- | 188 | { |
|
- | 189 | return_ACPI_STATUS (Status); |
|
- | 190 | } |
|
184 | 191 | ||
Line 185... | Line 192... | ||
185 | /* Create the reader/writer lock for namespace access */ |
192 | /* Create the reader/writer lock for namespace access */ |
186 | 193 | ||
187 | Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock); |
194 | Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock); |
Line 217... | Line 224... | ||
217 | for (i = 0; i < ACPI_NUM_MUTEX; i++) |
224 | for (i = 0; i < ACPI_NUM_MUTEX; i++) |
218 | { |
225 | { |
219 | AcpiUtDeleteMutex (i); |
226 | AcpiUtDeleteMutex (i); |
220 | } |
227 | } |
Line -... | Line 228... | ||
- | 228 | ||
- | 229 | AcpiOsDeleteMutex (AcpiGbl_OsiMutex); |
|
221 | 230 | ||
Line 222... | Line 231... | ||
222 | /* Delete the spinlocks */ |
231 | /* Delete the spinlocks */ |
223 | 232 | ||
Line 337... | Line 346... | ||
337 | if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId) |
346 | if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId) |
338 | { |
347 | { |
339 | if (i == MutexId) |
348 | if (i == MutexId) |
340 | { |
349 | { |
341 | ACPI_ERROR ((AE_INFO, |
350 | ACPI_ERROR ((AE_INFO, |
342 | "Mutex [%s] already acquired by this thread [%p]", |
351 | "Mutex [%s] already acquired by this thread [%u]", |
343 | AcpiUtGetMutexName (MutexId), |
352 | AcpiUtGetMutexName (MutexId), |
344 | ACPI_CAST_PTR (void, ThisThreadId))); |
353 | (UINT32) ThisThreadId)); |
Line 345... | Line 354... | ||
345 | 354 | ||
346 | return (AE_ALREADY_ACQUIRED); |
355 | return (AE_ALREADY_ACQUIRED); |
Line 347... | Line 356... | ||
347 | } |
356 | } |
348 | 357 | ||
349 | ACPI_ERROR ((AE_INFO, |
358 | ACPI_ERROR ((AE_INFO, |
350 | "Invalid acquire order: Thread %p owns [%s], wants [%s]", |
359 | "Invalid acquire order: Thread %u owns [%s], wants [%s]", |
Line 351... | Line 360... | ||
351 | ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (i), |
360 | (UINT32) ThisThreadId, AcpiUtGetMutexName (i), |
352 | AcpiUtGetMutexName (MutexId))); |
361 | AcpiUtGetMutexName (MutexId))); |
353 | 362 | ||
354 | return (AE_ACQUIRE_DEADLOCK); |
363 | return (AE_ACQUIRE_DEADLOCK); |
355 | } |
364 | } |
Line 356... | Line 365... | ||
356 | } |
365 | } |
357 | } |
366 | } |
358 | #endif |
367 | #endif |
Line 359... | Line 368... | ||
359 | 368 | ||
360 | ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, |
369 | ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, |
361 | "Thread %p attempting to acquire Mutex [%s]\n", |
370 | "Thread %u attempting to acquire Mutex [%s]\n", |
362 | ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId))); |
371 | (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); |
363 | 372 | ||
364 | Status = AcpiOsAcquireMutex (AcpiGbl_MutexInfo[MutexId].Mutex, |
373 | Status = AcpiOsAcquireMutex (AcpiGbl_MutexInfo[MutexId].Mutex, |
Line 365... | Line 374... | ||
365 | ACPI_WAIT_FOREVER); |
374 | ACPI_WAIT_FOREVER); |
366 | if (ACPI_SUCCESS (Status)) |
375 | if (ACPI_SUCCESS (Status)) |
367 | { |
376 | { |
368 | ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %p acquired Mutex [%s]\n", |
377 | ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u acquired Mutex [%s]\n", |
369 | ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId))); |
378 | (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); |
370 | 379 | ||
371 | AcpiGbl_MutexInfo[MutexId].UseCount++; |
380 | AcpiGbl_MutexInfo[MutexId].UseCount++; |
372 | AcpiGbl_MutexInfo[MutexId].ThreadId = ThisThreadId; |
381 | AcpiGbl_MutexInfo[MutexId].ThreadId = ThisThreadId; |
373 | } |
382 | } |
Line 374... | Line 383... | ||
374 | else |
383 | else |
375 | { |
384 | { |
Line 403... | Line 412... | ||
403 | 412 | ||
Line 404... | Line 413... | ||
404 | ACPI_FUNCTION_NAME (UtReleaseMutex); |
413 | ACPI_FUNCTION_NAME (UtReleaseMutex); |
405 | 414 | ||
406 | 415 | ||
Line 407... | Line 416... | ||
407 | ThisThreadId = AcpiOsGetThreadId (); |
416 | ThisThreadId = AcpiOsGetThreadId (); |
408 | ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n", |
417 | ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n", |
409 | ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId))); |
418 | (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); |
410 | 419 |