aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64
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-x86_64
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-x86_64')
-rw-r--r--include/asm-x86_64/acpi.h26
1 files changed, 2 insertions, 24 deletions
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index ed59aa4c6ff9..1371e88666ed 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -54,30 +54,8 @@
54#define ACPI_ENABLE_IRQS() local_irq_enable() 54#define ACPI_ENABLE_IRQS() local_irq_enable()
55#define ACPI_FLUSH_CPU_CACHE() wbinvd() 55#define ACPI_FLUSH_CPU_CACHE() wbinvd()
56 56
57 57int __acpi_acquire_global_lock(unsigned int *lock);
58static inline int 58int __acpi_release_global_lock(unsigned int *lock);
59__acpi_acquire_global_lock (unsigned int *lock)
60{
61 unsigned int old, new, val;
62 do {
63 old = *lock;
64 new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
65 val = cmpxchg(lock, old, new);
66 } while (unlikely (val != old));
67 return (new < 3) ? -1 : 0;
68}
69
70static inline int
71__acpi_release_global_lock (unsigned int *lock)
72{
73 unsigned int old, new, val;
74 do {
75 old = *lock;
76 new = old & ~0x3;
77 val = cmpxchg(lock, old, new);
78 } while (unlikely (val != old));
79 return old & 0x1;
80}
81 59
82#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 60#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
83 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 61 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr))