diff --git a/sys/dev/acpi/acpica/Subsystem/acobject.h b/sys/dev/acpi/acpica/Subsystem/acobject.h index 4c462e640df8..ea3b2085c1ce 100644 --- a/sys/dev/acpi/acpica/Subsystem/acobject.h +++ b/sys/dev/acpi/acpica/Subsystem/acobject.h @@ -280,6 +280,7 @@ typedef struct acpi_object_mutex { ACPI_OBJECT_COMMON_HEADER UINT16 SyncLevel; + UINT16 PreviousSyncLevel; UINT16 AcquisitionDepth; struct acpi_thread_state *OwnerThread; void *Semaphore; diff --git a/sys/dev/acpi/acpica/Subsystem/exmutex.c b/sys/dev/acpi/acpica/Subsystem/exmutex.c index d5b333d10918..726513fc505e 100644 --- a/sys/dev/acpi/acpica/Subsystem/exmutex.c +++ b/sys/dev/acpi/acpica/Subsystem/exmutex.c @@ -116,7 +116,7 @@ *****************************************************************************/ #include -__KERNEL_RCSID(0, "$NetBSD: exmutex.c,v 1.12 2004/02/14 16:57:24 kochi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exmutex.c,v 1.13 2004/04/07 18:19:34 kochi Exp $"); #define __EXMUTEX_C__ @@ -288,6 +288,7 @@ AcpiExAcquireMutex ( ObjDesc->Mutex.OwnerThread = WalkState->Thread; ObjDesc->Mutex.AcquisitionDepth = 1; + ObjDesc->Mutex.PreviousSyncLevel = WalkState->Thread->CurrentSyncLevel; WalkState->Thread->CurrentSyncLevel = ObjDesc->Mutex.SyncLevel; /* Link the mutex to the current thread for force-unlock at method exit */ @@ -389,7 +390,7 @@ AcpiExReleaseMutex ( /* Update the mutex and walk state */ ObjDesc->Mutex.OwnerThread = NULL; - WalkState->Thread->CurrentSyncLevel = ObjDesc->Mutex.SyncLevel; + WalkState->Thread->CurrentSyncLevel = ObjDesc->Mutex.PreviousSyncLevel; return_ACPI_STATUS (Status); }