diff options
author | jkim <jkim@FreeBSD.org> | 2007-09-24 17:12:36 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2007-09-24 17:12:36 +0000 |
commit | 18e70fea3e78dcdc73e361725353986b492d0736 (patch) | |
tree | 610da95801aa705ea53a4fdbc686c8571fd54db0 /sys/contrib/dev/acpica | |
parent | b50224d3f971f0d6b457b18b153cd76336d32ff7 (diff) | |
parent | f7e7ed217a2b7448cff8a8a04a276fb8f8be8209 (diff) | |
download | FreeBSD-src-18e70fea3e78dcdc73e361725353986b492d0736.zip FreeBSD-src-18e70fea3e78dcdc73e361725353986b492d0736.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r172314,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'sys/contrib/dev/acpica')
-rw-r--r-- | sys/contrib/dev/acpica/evmisc.c | 14 | ||||
-rw-r--r-- | sys/contrib/dev/acpica/evxface.c | 11 |
2 files changed, 15 insertions, 10 deletions
diff --git a/sys/contrib/dev/acpica/evmisc.c b/sys/contrib/dev/acpica/evmisc.c index 881519f..7000543 100644 --- a/sys/contrib/dev/acpica/evmisc.c +++ b/sys/contrib/dev/acpica/evmisc.c @@ -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. */ diff --git a/sys/contrib/dev/acpica/evxface.c b/sys/contrib/dev/acpica/evxface.c index 021ebf7..15fbc9c 100644 --- a/sys/contrib/dev/acpica/evxface.c +++ b/sys/contrib/dev/acpica/evxface.c @@ -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; } |