aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-h8300
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-02-07 03:16:15 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:32 -0500
commitaebb77aef4b50a157bf0185de31d1aede3ca2312 (patch)
tree0f4b5f17120b93193d06dcf9f6ca270f2c06c5fc /include/asm-h8300
parent14e0cb3c60b89c4a2512852ffc18601c72314a0f (diff)
Add cmpxchg_local to h8300
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: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-h8300')
-rw-r--r--include/asm-h8300/system.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h
index 2c1e83f7b419..4b8e475908ae 100644
--- a/include/asm-h8300/system.h
+++ b/include/asm-h8300/system.h
@@ -138,6 +138,21 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
138 asm("jmp @@0"); \ 138 asm("jmp @@0"); \
139}) 139})
140 140
141#include <asm-generic/cmpxchg-local.h>
142
143/*
144 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
145 * them available.
146 */
147#define cmpxchg_local(ptr, o, n) \
148 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
149 (unsigned long)(n), sizeof(*(ptr))))
150#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
151
152#ifndef CONFIG_SMP
153#include <asm-generic/cmpxchg.h>
154#endif
155
141#define arch_align_stack(x) (x) 156#define arch_align_stack(x) (x)
142 157
143#endif /* _H8300_SYSTEM_H */ 158#endif /* _H8300_SYSTEM_H */