diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-02-07 03:16:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:31 -0500 |
commit | 176393d4232a89aaf8745b0726f4d212a20103f1 (patch) | |
tree | f5d64f19a7db6da5d694c209fa8ac2d6ce43dd29 /include/asm-arm | |
parent | 32f49eab5e893007c0064f465c857ac7c4d40b77 (diff) |
Add cmpxchg_local to arm
Use the new generic cmpxchg_local (disables interrupt). Also use the generic
cmpxchg as fallback if SMP is not set.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/system.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 28425c473e71..6335de9a2bb3 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -363,6 +363,21 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size | |||
363 | extern void disable_hlt(void); | 363 | extern void disable_hlt(void); |
364 | extern void enable_hlt(void); | 364 | extern void enable_hlt(void); |
365 | 365 | ||
366 | #include <asm-generic/cmpxchg-local.h> | ||
367 | |||
368 | /* | ||
369 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
370 | * them available. | ||
371 | */ | ||
372 | #define cmpxchg_local(ptr, o, n) \ | ||
373 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
374 | (unsigned long)(n), sizeof(*(ptr)))) | ||
375 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
376 | |||
377 | #ifndef CONFIG_SMP | ||
378 | #include <asm-generic/cmpxchg.h> | ||
379 | #endif | ||
380 | |||
366 | #endif /* __ASSEMBLY__ */ | 381 | #endif /* __ASSEMBLY__ */ |
367 | 382 | ||
368 | #define arch_align_stack(x) (x) | 383 | #define arch_align_stack(x) (x) |