diff options
author | Aoi Shinkai <shinkoi2005@gmail.com> | 2009-06-10 20:15:42 +0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-11 10:31:55 +0400 |
commit | 4c7c99788631bab177bd51e15e893be4689bb085 (patch) | |
tree | 52e50e0b2a30b31dc8c6460e98279b3c1b47c476 /arch/sh/include/asm/atomic.h | |
parent | f168dd00a9440a6f644db73bda47718fd12008e4 (diff) | |
download | linux-4c7c99788631bab177bd51e15e893be4689bb085.tar.xz |
sh: Fix sh4a llsc-based cmpxchg()
This fixes up a typo in the ll/sc based cmpxchg code which apparently
wasn't getting a lot of testing due to the swapped old/new pair. With
that fixed up, the ll/sc code also starts using it and provides its own
atomic_add_unless().
Signed-off-by: Aoi Shinkai <shinkoi2005@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/atomic.h')
-rw-r--r-- | arch/sh/include/asm/atomic.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h index 6327ffbb1992..978b58efb1e9 100644 --- a/arch/sh/include/asm/atomic.h +++ b/arch/sh/include/asm/atomic.h @@ -45,7 +45,7 @@ #define atomic_inc(v) atomic_add(1,(v)) #define atomic_dec(v) atomic_sub(1,(v)) -#ifndef CONFIG_GUSA_RB +#if !defined(CONFIG_GUSA_RB) && !defined(CONFIG_CPU_SH4A) static inline int atomic_cmpxchg(atomic_t *v, int old, int new) { int ret; @@ -73,7 +73,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) return ret != u; } -#endif +#endif /* !CONFIG_GUSA_RB && !CONFIG_CPU_SH4A */ #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |