aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-02-07 03:16:14 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:31 -0500
commit7732ba3abc5a53e7e1d93afd5a5a6ccf74f2ce53 (patch)
tree0dec1b2b4457d0db2ccd04eab6999c3b84c711f7
parent10b8827068377a11ed0e396248f7d02751fe5f17 (diff)
Add cmpxchg_local to cris
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: Mikael Starvik <starvik@axis.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/asm-cris/system.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h
index fea0e8d57cb5..5bcfe5a10907 100644
--- a/include/asm-cris/system.h
+++ b/include/asm-cris/system.h
@@ -66,6 +66,21 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
66 return x; 66 return x;
67} 67}
68 68
69#include <asm-generic/cmpxchg-local.h>
70
71/*
72 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
73 * them available.
74 */
75#define cmpxchg_local(ptr, o, n) \
76 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
77 (unsigned long)(n), sizeof(*(ptr))))
78#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
79
80#ifndef CONFIG_SMP
81#include <asm-generic/cmpxchg.h>
82#endif
83
69#define arch_align_stack(x) (x) 84#define arch_align_stack(x) (x)
70 85
71void default_idle(void); 86void default_idle(void);