diff options
author | Stuart Menefy <stuart.menefy@st.com> | 2007-11-30 08:12:36 +0100 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-28 05:18:58 +0100 |
commit | 1efe4ce3ca126da77e450d5a83f7201949d76f62 (patch) | |
tree | fbae9902aa4103a9e86d06f841d580f24682e7b3 /include/asm-sh/system.h | |
parent | sh: Fix compile error of arch/sh/mm/pmb.c (diff) | |
download | linux-1efe4ce3ca126da77e450d5a83f7201949d76f62.tar.xz linux-1efe4ce3ca126da77e450d5a83f7201949d76f62.zip |
sh: GUSA atomic rollback support.
This implements kernel-level atomic rollback built on top of gUSA,
as an alternative non-IRQ based atomicity method. This is generally
a faster method for platforms that are lacking the LL/SC pairs that
SH-4A and later use, and is only supportable on legacy cores.
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to '')
-rw-r--r-- | include/asm-sh/system.h | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index ad3d2a636130..969f3d4afe2a 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h @@ -68,27 +68,11 @@ #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) -static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val) -{ - unsigned long flags, retval; - - local_irq_save(flags); - retval = *m; - *m = val; - local_irq_restore(flags); - return retval; -} - -static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val) -{ - unsigned long flags, retval; - - local_irq_save(flags); - retval = *m; - *m = val & 0xff; - local_irq_restore(flags); - return retval; -} +#ifdef CONFIG_GUSA_RB +#include <asm/cmpxchg-grb.h> +#else +#include <asm/cmpxchg-irq.h> +#endif extern void __xchg_called_with_bad_pointer(void); @@ -115,20 +99,6 @@ extern void __xchg_called_with_bad_pointer(void); #define xchg(ptr,x) \ ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr)))) -static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old, - unsigned long new) -{ - __u32 retval; - unsigned long flags; - - local_irq_save(flags); - retval = *m; - if (retval == old) - *m = new; - local_irq_restore(flags); /* implies memory barrier */ - return retval; -} - /* This function doesn't exist, so you'll get a linker error * if something tries to do an invalid cmpxchg(). */ extern void __cmpxchg_called_with_bad_pointer(void); |