Print this page
acpica-unix2-20130823
PANKOVs restructure
*** 3,13 ****
* Module Name: utmutex - local mutex support
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2011, 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:
--- 3,13 ----
* Module Name: utmutex - local mutex support
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2013, 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,104 ****
{
return_ACPI_STATUS (Status);
}
}
! /* Create the spinlocks for use at interrupt level */
Status = AcpiOsCreateLock (&AcpiGbl_GpeLock);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
--- 94,104 ----
{
return_ACPI_STATUS (Status);
}
}
! /* Create the spinlocks for use at interrupt level or for speed */
Status = AcpiOsCreateLock (&AcpiGbl_GpeLock);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
*** 108,118 ****
--- 108,125 ----
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,167 ****
--- 165,175 ----
/* Delete the spinlocks */
AcpiOsDeleteLock (AcpiGbl_GpeLock);
AcpiOsDeleteLock (AcpiGbl_HardwareLock);
+ AcpiOsDeleteLock (AcpiGbl_ReferenceCountLock);
/* Delete the reader/writer lock */
AcpiUtDeleteRwLock (&AcpiGbl_NamespaceRwLock);
return_VOID;
*** 223,232 ****
--- 231,242 ----
AcpiOsDeleteMutex (AcpiGbl_MutexInfo[MutexId].Mutex);
AcpiGbl_MutexInfo[MutexId].Mutex = NULL;
AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
+
+ return_VOID;
}
/*******************************************************************************
*
*** 333,351 ****
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)));
if (MutexId > ACPI_MAX_MUTEX)
{
return (AE_BAD_PARAMETER);
}
--- 343,357 ----
ACPI_STATUS
AcpiUtReleaseMutex (
ACPI_MUTEX_HANDLE MutexId)
{
ACPI_FUNCTION_NAME (UtReleaseMutex);
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n",
! (UINT32) AcpiOsGetThreadId (), AcpiUtGetMutexName (MutexId)));
if (MutexId > ACPI_MAX_MUTEX)
{
return (AE_BAD_PARAMETER);
}
*** 372,382 ****
* 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 (i == MutexId)
{
continue;
}
--- 378,388 ----
* 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 == AcpiOsGetThreadId ())
{
if (i == MutexId)
{
continue;
}
*** 396,402 ****
AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
AcpiOsReleaseMutex (AcpiGbl_MutexInfo[MutexId].Mutex);
return (AE_OK);
}
-
-
--- 402,406 ----