diff options
Diffstat (limited to 'sys/contrib/dev/acpica/components/utilities/utmutex.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/utilities/utmutex.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/sys/contrib/dev/acpica/components/utilities/utmutex.c b/sys/contrib/dev/acpica/components/utilities/utmutex.c index c7b162b..7f25642 100644 --- a/sys/contrib/dev/acpica/components/utilities/utmutex.c +++ b/sys/contrib/dev/acpica/components/utilities/utmutex.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -124,6 +124,24 @@ AcpiUtMutexInitialize ( /* Create the reader/writer lock for namespace access */ Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + +#ifdef ACPI_DEBUGGER + + /* Debugger Support */ + + Status = AcpiOsCreateMutex (&AcpiGbl_DbCommandReady); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + Status = AcpiOsCreateMutex (&AcpiGbl_DbCommandComplete); +#endif + return_ACPI_STATUS (Status); } @@ -169,6 +187,12 @@ AcpiUtMutexTerminate ( /* Delete the reader/writer lock */ AcpiUtDeleteRwLock (&AcpiGbl_NamespaceRwLock); + +#ifdef ACPI_DEBUGGER + AcpiOsDeleteMutex (AcpiGbl_DbCommandReady); + AcpiOsDeleteMutex (AcpiGbl_DbCommandComplete); +#endif + return_VOID; } @@ -305,11 +329,12 @@ AcpiUtAcquireMutex ( "Thread %u attempting to acquire Mutex [%s]\n", (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); - Status = AcpiOsAcquireMutex (AcpiGbl_MutexInfo[MutexId].Mutex, - ACPI_WAIT_FOREVER); + Status = AcpiOsAcquireMutex ( + AcpiGbl_MutexInfo[MutexId].Mutex, ACPI_WAIT_FOREVER); if (ACPI_SUCCESS (Status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u acquired Mutex [%s]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, + "Thread %u acquired Mutex [%s]\n", (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); AcpiGbl_MutexInfo[MutexId].UseCount++; |