X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-v850%2Fsystem.h;h=7daf1fdee1197f8726e0266edba249b4549d46e1;hb=7eafd25d9559bd0f652449c222d38d63412e3d4a;hp=da39916f10b0cc523eb2c0907f8579b5445fdc41;hpb=83b0fe818cd2f6cc03365440f2b7cca297a45b4f;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h index da39916f10b..7daf1fdee11 100644 --- a/include/asm-v850/system.h +++ b/include/asm-v850/system.h @@ -66,8 +66,7 @@ static inline int irqs_disabled (void) #define rmb() mb () #define wmb() mb () #define read_barrier_depends() ((void)0) -#define set_rmb(var, value) do { xchg (&var, value); } while (0) -#define set_mb(var, value) set_rmb (var, value) +#define set_mb(var, value) do { xchg (&var, value); } while (0) #define smp_mb() mb () #define smp_rmb() rmb () @@ -76,7 +75,6 @@ static inline int irqs_disabled (void) #define xchg(ptr, with) \ ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr)))) -#define tas(ptr) (xchg ((ptr), 1)) static inline unsigned long __xchg (unsigned long with, __volatile__ void *ptr, int size) @@ -105,6 +103,21 @@ static inline unsigned long __xchg (unsigned long with, return tmp; } +#include + +/* + * 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 +#endif + #define arch_align_stack(x) (x) #endif /* __V850_SYSTEM_H__ */