Commit 053a7b5b authored by Russell King's avatar Russell King Committed by Russell King

[PATCH] ARM SMP: __xchg support

This enables the existing __xchg implementation to be used on SMP.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4b0ef3b1
...@@ -290,7 +290,6 @@ do { \ ...@@ -290,7 +290,6 @@ do { \
}) })
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#error SMP not supported
#define smp_mb() mb() #define smp_mb() mb()
#define smp_rmb() rmb() #define smp_rmb() rmb()
...@@ -304,6 +303,8 @@ do { \ ...@@ -304,6 +303,8 @@ do { \
#define smp_wmb() barrier() #define smp_wmb() barrier()
#define smp_read_barrier_depends() do { } while(0) #define smp_read_barrier_depends() do { } while(0)
#endif /* CONFIG_SMP */
#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110) #if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
/* /*
* On the StrongARM, "swp" is terminally broken since it bypasses the * On the StrongARM, "swp" is terminally broken since it bypasses the
...@@ -316,9 +317,16 @@ do { \ ...@@ -316,9 +317,16 @@ do { \
* *
* We choose (1) since its the "easiest" to achieve here and is not * We choose (1) since its the "easiest" to achieve here and is not
* dependent on the processor type. * dependent on the processor type.
*
* NOTE that this solution won't work on an SMP system, so explcitly
* forbid it here.
*/ */
#ifdef CONFIG_SMP
#error SMP is not supported on SA1100/SA110
#else
#define swp_is_buggy #define swp_is_buggy
#endif #endif
#endif
static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
{ {
...@@ -361,8 +369,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size ...@@ -361,8 +369,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
return ret; return ret;
} }
#endif /* CONFIG_SMP */
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define arch_align_stack(x) (x) #define arch_align_stack(x) (x)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment