summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/cmpxchg.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/cmpxchg.h')
-rw-r--r--arch/mips/include/asm/cmpxchg.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index 516cb66f066b..a633bf845689 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -70,9 +70,16 @@ extern unsigned long __xchg_called_with_bad_pointer(void)
__ret; \
})
+extern unsigned long __xchg_small(volatile void *ptr, unsigned long val,
+ unsigned int size);
+
static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
{
switch (size) {
+ case 1:
+ case 2:
+ return __xchg_small(ptr, x, size);
+
case 4:
return __xchg_asm("ll", "sc", (volatile u32 *)ptr, x);
@@ -91,8 +98,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
({ \
__typeof__(*(ptr)) __res; \
\
- BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \
- \
smp_mb__before_llsc(); \
\
__res = (__typeof__(*(ptr))) \