aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-10-20 17:30:27 -0400
committerLen Brown <len.brown@intel.com>2006-10-21 01:22:43 -0400
commitd0a9081b1e75ba62bb4450c5b8e8299a41d25278 (patch)
treeabed939f2d35a78621206b50d2b4c9b4fd923dab /include/asm-i386
parent965a3d447276491b7ed053b25679c062beb04194 (diff)
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 'include/asm-i386')
-rw-r--r--include/asm-i386/acpi.h26
1 files changed, 2 insertions, 24 deletions
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index 6016632d032f..29bee1dcde72 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -56,30 +56,8 @@
56#define ACPI_ENABLE_IRQS() local_irq_enable() 56#define ACPI_ENABLE_IRQS() local_irq_enable()
57#define ACPI_FLUSH_CPU_CACHE() wbinvd() 57#define ACPI_FLUSH_CPU_CACHE() wbinvd()
58 58
59 59int __acpi_acquire_global_lock(unsigned int *lock);
60static inline int 60int __acpi_release_global_lock(unsigned int *lock);
61__acpi_acquire_global_lock (unsigned int *lock)
62{
63 unsigned int old, new, val;
64 do {
65 old = *lock;
66 new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
67 val = cmpxchg(lock, old, new);
68 } while (unlikely (val != old));
69 return (new < 3) ? -1 : 0;
70}
71
72static inline int
73__acpi_release_global_lock (unsigned int *lock)
74{
75 unsigned int old, new, val;
76 do {
77 old = *lock;
78 new = old & ~0x3;
79 val = cmpxchg(lock, old, new);
80 } while (unlikely (val != old));
81 return old & 0x1;
82}
83 61
84#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 62#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
85 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 63 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr))