diff options
author | Len Brown <len.brown@intel.com> | 2006-12-16 00:45:07 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-12-16 00:45:07 -0500 |
commit | 463e7c7cf9aaf95dd05e97e1a47854fdf5454cdc (patch) | |
tree | 1b9171c109496b7f4991fcae0a2e08ed3bbea10d /include/asm-x86_64 | |
parent | 25c68a33b7b74b37793b1250007e5e21d621a7fc (diff) | |
parent | 7d63c6759188b9b35c789159f6e02cd02d49ec7d (diff) |
Pull trivial into test branch
Conflicts:
drivers/acpi/ec.c
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/acpi.h | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index 9d1916e59c04..6b6fc6f8be7e 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 | 57 | int __acpi_acquire_global_lock(unsigned int *lock); | |
58 | static inline int | 58 | int __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 | |||
70 | static 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)) |