diff options
author | 2013-07-01 10:08:08 +0000 | |
---|---|---|
committer | 2013-07-01 10:08:08 +0000 | |
commit | c8e80a8a5895c0173a32ee7265e4a6b7ff63205f (patch) | |
tree | 6bd923ca9c2201bfdcc1780bc45566d8190a245b | |
parent | Link sqlite3(1) against libedit and add an empty history.h header for (diff) | |
download | wireguard-openbsd-c8e80a8a5895c0173a32ee7265e4a6b7ff63205f.tar.xz wireguard-openbsd-c8e80a8a5895c0173a32ee7265e4a6b7ff63205f.zip |
Make the acpi global lock functions actually work. Luckily these functions
were still unused.
ok millert@
-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); } |