diff options
author | Andrew Morton <akpm@osdl.org> | 2006-10-20 17:30:27 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-10-21 01:22:43 -0400 |
commit | d0a9081b1e75ba62bb4450c5b8e8299a41d25278 (patch) | |
tree | abed939f2d35a78621206b50d2b4c9b4fd923dab /arch/i386/kernel/acpi/boot.c | |
parent | 965a3d447276491b7ed053b25679c062beb04194 (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 'arch/i386/kernel/acpi/boot.c')
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index ab974ff9707..bf7099ca41a 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) | |||
1319 | return 0; | 1319 | return 0; |
1320 | } | 1320 | } |
1321 | early_param("acpi_sci", setup_acpi_sci); | 1321 | early_param("acpi_sci", setup_acpi_sci); |
1322 | |||
1323 | int __acpi_acquire_global_lock(unsigned int *lock) | ||
1324 | { | ||
1325 | unsigned int old, new, val; | ||
1326 | do { | ||
1327 | old = *lock; | ||
1328 | new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); | ||
1329 | val = cmpxchg(lock, old, new); | ||
1330 | } while (unlikely (val != old)); | ||
1331 | return (new < 3) ? -1 : 0; | ||
1332 | } | ||
1333 | |||
1334 | int __acpi_release_global_lock(unsigned int *lock) | ||
1335 | { | ||
1336 | unsigned int old, new, val; | ||
1337 | do { | ||
1338 | old = *lock; | ||
1339 | new = old & ~0x3; | ||
1340 | val = cmpxchg(lock, old, new); | ||
1341 | } while (unlikely (val != old)); | ||
1342 | return old & 0x1; | ||
1343 | } | ||