diff options
Diffstat (limited to 'arch/mips/include/asm/cmpxchg.h')
-rw-r--r-- | arch/mips/include/asm/cmpxchg.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h index 815a438a268d..2d28017e95d0 100644 --- a/arch/mips/include/asm/cmpxchg.h +++ b/arch/mips/include/asm/cmpxchg.h | |||
@@ -16,7 +16,7 @@ | |||
16 | ({ \ | 16 | ({ \ |
17 | __typeof(*(m)) __ret; \ | 17 | __typeof(*(m)) __ret; \ |
18 | \ | 18 | \ |
19 | if (kernel_uses_llsc && R10000_LLSC_WAR) { \ | 19 | if (kernel_uses_llsc && R10000_LLSC_WAR) { \ |
20 | __asm__ __volatile__( \ | 20 | __asm__ __volatile__( \ |
21 | " .set push \n" \ | 21 | " .set push \n" \ |
22 | " .set noat \n" \ | 22 | " .set noat \n" \ |
@@ -72,14 +72,14 @@ | |||
72 | */ | 72 | */ |
73 | extern void __cmpxchg_called_with_bad_pointer(void); | 73 | extern void __cmpxchg_called_with_bad_pointer(void); |
74 | 74 | ||
75 | #define __cmpxchg(ptr, old, new, barrier) \ | 75 | #define __cmpxchg(ptr, old, new, pre_barrier, post_barrier) \ |
76 | ({ \ | 76 | ({ \ |
77 | __typeof__(ptr) __ptr = (ptr); \ | 77 | __typeof__(ptr) __ptr = (ptr); \ |
78 | __typeof__(*(ptr)) __old = (old); \ | 78 | __typeof__(*(ptr)) __old = (old); \ |
79 | __typeof__(*(ptr)) __new = (new); \ | 79 | __typeof__(*(ptr)) __new = (new); \ |
80 | __typeof__(*(ptr)) __res = 0; \ | 80 | __typeof__(*(ptr)) __res = 0; \ |
81 | \ | 81 | \ |
82 | barrier; \ | 82 | pre_barrier; \ |
83 | \ | 83 | \ |
84 | switch (sizeof(*(__ptr))) { \ | 84 | switch (sizeof(*(__ptr))) { \ |
85 | case 4: \ | 85 | case 4: \ |
@@ -96,13 +96,13 @@ extern void __cmpxchg_called_with_bad_pointer(void); | |||
96 | break; \ | 96 | break; \ |
97 | } \ | 97 | } \ |
98 | \ | 98 | \ |
99 | barrier; \ | 99 | post_barrier; \ |
100 | \ | 100 | \ |
101 | __res; \ | 101 | __res; \ |
102 | }) | 102 | }) |
103 | 103 | ||
104 | #define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb()) | 104 | #define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_mb__before_llsc(), smp_llsc_mb()) |
105 | #define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, ) | 105 | #define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, , ) |
106 | 106 | ||
107 | #define cmpxchg64(ptr, o, n) \ | 107 | #define cmpxchg64(ptr, o, n) \ |
108 | ({ \ | 108 | ({ \ |