summaryrefslogtreecommitdiff
path: root/arch/i386/kernel/acpi
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-10-20 21:30:27 (GMT)
committerLen Brown <len.brown@intel.com>2006-10-21 05:22:43 (GMT)
commitd0a9081b1e75ba62bb4450c5b8e8299a41d25278 (patch)
treeabed939f2d35a78621206b50d2b4c9b4fd923dab /arch/i386/kernel/acpi
parent965a3d447276491b7ed053b25679c062beb04194 (diff)
downloadlinux-d0a9081b1e75ba62bb4450c5b8e8299a41d25278.tar.xz
ACPI: uninline ACPI global locking functions
- Fixes a build problem with CONFIG_M386=y (include file dependencies get messy). - Share the implementation between x86 and x86_64 - These are too big to inline anyway. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
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 ab974ff..bf7099c 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -1319,3 +1319,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;
+}