--- src/sys/contrib/dev/acpica/evmisc.c.orig 2007-09-10 14:45:14.000000000 -0400 +++ src/sys/contrib/dev/acpica/evmisc.c 2007-09-19 19:07:46.000000000 -0400 @@ -568,6 +568,20 @@ AcpiEvAcquireGlobalLock ( } /* + * Update the global lock handle and check for wraparound. The handle is + * only used for the external global lock interfaces, but it is updated + * here to properly handle the case where a single thread may acquire the + * lock via both the AML and the AcpiAcquireGlobalLock interfaces. The + * handle is therefore updated on the first acquire from a given thread + * regardless of where the acquisition request originated. + */ + AcpiGbl_GlobalLockHandle++; + if (AcpiGbl_GlobalLockHandle == 0) + { + AcpiGbl_GlobalLockHandle = 1; + } + + /* * Make sure that a global lock actually exists. If not, just treat * the lock as a standard mutex. */ --- src/sys/contrib/dev/acpica/evxface.c.orig 2007-09-10 14:45:14.000000000 -0400 +++ src/sys/contrib/dev/acpica/evxface.c 2007-09-19 19:07:46.000000000 -0400 @@ -921,16 +921,7 @@ AcpiAcquireGlobalLock ( if (ACPI_SUCCESS (Status)) { - /* - * If this was the first acquisition of the Global Lock by this thread, - * create a new handle. Otherwise, return the existing handle. - */ - if (AcpiGbl_GlobalLockMutex->Mutex.AcquisitionDepth == 1) - { - AcpiGbl_GlobalLockHandle++; - } - - /* Return the global lock handle */ + /* Return the global lock handle (updated in AcpiEvAcquireGlobalLock) */ *Handle = AcpiGbl_GlobalLockHandle; }