diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-07-01 10:08:09 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-07-01 10:08:09 +0000 |
commit | edf8f1a3cc8488fe0d20424ec56742005a0fed0a (patch) | |
tree | f7173d0777403a050ef6ff50ca99a3d9bd37ef5f /sys/arch | |
parent | 91ae6bb2d409595b0afa8e06b019af6af401f734 (diff) |
Make the acpi global lock functions actually work. Luckily these functions
were still unused.
ok millert@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/acpi_machdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c index a8486017adc..8be34857637 100644 --- a/sys/arch/amd64/amd64/acpi_machdep.c +++ b/sys/arch/amd64/amd64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.54 2013/03/20 21:23:05 kettenis Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.55 2013/07/01 10:08:08 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -183,7 +183,7 @@ acpi_acquire_glk(uint32_t *lock) new = (old & ~GL_BIT_PENDING) | GL_BIT_OWNED; if ((old & GL_BIT_OWNED) != 0) new |= GL_BIT_PENDING; - } while (x86_atomic_cas_int32(lock, old, new) == 0); + } while (x86_atomic_cas_int32(lock, old, new) != old); return ((new & GL_BIT_PENDING) == 0); } @@ -201,7 +201,7 @@ acpi_release_glk(uint32_t *lock) do { old = *lock; new = old & ~(GL_BIT_PENDING | GL_BIT_OWNED); - } while (x86_atomic_cas_int32(lock, old, new) == 0); + } while (x86_atomic_cas_int32(lock, old, new) != old); return ((old & GL_BIT_PENDING) != 0); } |