Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
@@ -3,11 +3,11 @@
* Module Name: utmutex - local mutex support
*
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -94,11 +94,11 @@
{
return_ACPI_STATUS (Status);
}
}
- /* Create the spinlocks for use at interrupt level */
+ /* Create the spinlocks for use at interrupt level or for speed */
Status = AcpiOsCreateLock (&AcpiGbl_GpeLock);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -108,11 +108,18 @@
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
+ Status = AcpiOsCreateLock (&AcpiGbl_ReferenceCountLock);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
/* Mutex for _OSI support */
+
Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
@@ -158,10 +165,11 @@
/* Delete the spinlocks */
AcpiOsDeleteLock (AcpiGbl_GpeLock);
AcpiOsDeleteLock (AcpiGbl_HardwareLock);
+ AcpiOsDeleteLock (AcpiGbl_ReferenceCountLock);
/* Delete the reader/writer lock */
AcpiUtDeleteRwLock (&AcpiGbl_NamespaceRwLock);
return_VOID;
@@ -223,10 +231,12 @@
AcpiOsDeleteMutex (AcpiGbl_MutexInfo[MutexId].Mutex);
AcpiGbl_MutexInfo[MutexId].Mutex = NULL;
AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
+
+ return_VOID;
}
/*******************************************************************************
*
@@ -333,19 +343,15 @@
ACPI_STATUS
AcpiUtReleaseMutex (
ACPI_MUTEX_HANDLE MutexId)
{
- ACPI_THREAD_ID ThisThreadId;
-
-
ACPI_FUNCTION_NAME (UtReleaseMutex);
- ThisThreadId = AcpiOsGetThreadId ();
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n",
- (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
+ (UINT32) AcpiOsGetThreadId (), AcpiUtGetMutexName (MutexId)));
if (MutexId > ACPI_MAX_MUTEX)
{
return (AE_BAD_PARAMETER);
}
@@ -372,11 +378,11 @@
* ordering rule. This indicates a coding error somewhere in
* the ACPI subsystem code.
*/
for (i = MutexId; i < ACPI_NUM_MUTEX; i++)
{
- if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId)
+ if (AcpiGbl_MutexInfo[i].ThreadId == AcpiOsGetThreadId ())
{
if (i == MutexId)
{
continue;
}
@@ -396,7 +402,5 @@
AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
AcpiOsReleaseMutex (AcpiGbl_MutexInfo[MutexId].Mutex);
return (AE_OK);
}
-
-