aboutsummaryrefslogtreecommitdiff
path: root/arch/i386/kernel/acpi
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-12-16 00:45:07 -0500
committerLen Brown <len.brown@intel.com>2006-12-16 00:45:07 -0500
commit463e7c7cf9aaf95dd05e97e1a47854fdf5454cdc (patch)
tree1b9171c109496b7f4991fcae0a2e08ed3bbea10d /arch/i386/kernel/acpi
parent25c68a33b7b74b37793b1250007e5e21d621a7fc (diff)
parent7d63c6759188b9b35c789159f6e02cd02d49ec7d (diff)
Pull trivial into test branch
Conflicts: drivers/acpi/ec.c
Diffstat (limited to 'arch/i386/kernel/acpi')
-rw-r--r--arch/i386/kernel/acpi/boot.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index c8f96cff07c..094300b3a81 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -1327,3 +1327,25 @@ static int __init setup_acpi_sci(char *s)
return 0;
}
early_param("acpi_sci", setup_acpi_sci);
+
+int __acpi_acquire_global_lock(unsigned int *lock)
+{
+ unsigned int old, new, val;
+ do {
+ old = *lock;
+ new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
+ val = cmpxchg(lock, old, new);
+ } while (unlikely (val != old));
+ return (new < 3) ? -1 : 0;
+}
+
+int __acpi_release_global_lock(unsigned int *lock)
+{
+ unsigned int old, new, val;
+ do {
+ old = *lock;
+ new = old & ~0x3;
+ val = cmpxchg(lock, old, new);
+ } while (unlikely (val != old));
+ return old & 0x1;
+}