diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-02-07 00:16:11 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 08:42:31 -0800 |
commit | 176393d4232a89aaf8745b0726f4d212a20103f1 (patch) | |
tree | f5d64f19a7db6da5d694c209fa8ac2d6ce43dd29 /include | |
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')
-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 28425c473e7..6335de9a2bb 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 extern void disable_hlt(void); extern void enable_hlt(void); +#include <asm-generic/cmpxchg-local.h> + +/* + * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make + * them available. + */ +#define cmpxchg_local(ptr, o, n) \ + ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ + (unsigned long)(n), sizeof(*(ptr)))) +#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) + +#ifndef CONFIG_SMP +#include <asm-generic/cmpxchg.h> +#endif + #endif /* __ASSEMBLY__ */ #define arch_align_stack(x) (x) |