aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/system.h')
-rw-r--r--include/asm-powerpc/system.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index d075725bf444..4c9f5229e833 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -39,7 +39,6 @@
39#define read_barrier_depends() do { } while(0) 39#define read_barrier_depends() do { } while(0)
40 40
41#define set_mb(var, value) do { var = value; mb(); } while (0) 41#define set_mb(var, value) do { var = value; mb(); } while (0)
42#define set_wmb(var, value) do { var = value; wmb(); } while (0)
43 42
44#ifdef __KERNEL__ 43#ifdef __KERNEL__
45#ifdef CONFIG_SMP 44#ifdef CONFIG_SMP
@@ -54,6 +53,15 @@
54#define smp_read_barrier_depends() do { } while(0) 53#define smp_read_barrier_depends() do { } while(0)
55#endif /* CONFIG_SMP */ 54#endif /* CONFIG_SMP */
56 55
56/*
57 * This is a barrier which prevents following instructions from being
58 * started until the value of the argument x is known. For example, if
59 * x is a variable loaded from memory, this prevents following
60 * instructions from being executed until the load has been performed.
61 */
62#define data_barrier(x) \
63 asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory");
64
57struct task_struct; 65struct task_struct;
58struct pt_regs; 66struct pt_regs;
59 67
@@ -220,8 +228,8 @@ __xchg_u32(volatile void *p, unsigned long val)
220" stwcx. %3,0,%2 \n\ 228" stwcx. %3,0,%2 \n\
221 bne- 1b" 229 bne- 1b"
222 ISYNC_ON_SMP 230 ISYNC_ON_SMP
223 : "=&r" (prev), "=m" (*(volatile unsigned int *)p) 231 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
224 : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) 232 : "r" (p), "r" (val)
225 : "cc", "memory"); 233 : "cc", "memory");
226 234
227 return prev; 235 return prev;
@@ -240,8 +248,8 @@ __xchg_u64(volatile void *p, unsigned long val)
240" stdcx. %3,0,%2 \n\ 248" stdcx. %3,0,%2 \n\
241 bne- 1b" 249 bne- 1b"
242 ISYNC_ON_SMP 250 ISYNC_ON_SMP
243 : "=&r" (prev), "=m" (*(volatile unsigned long *)p) 251 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
244 : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) 252 : "r" (p), "r" (val)
245 : "cc", "memory"); 253 : "cc", "memory");
246 254
247 return prev; 255 return prev;
@@ -299,8 +307,8 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
299 ISYNC_ON_SMP 307 ISYNC_ON_SMP
300 "\n\ 308 "\n\
3012:" 3092:"
302 : "=&r" (prev), "=m" (*p) 310 : "=&r" (prev), "+m" (*p)
303 : "r" (p), "r" (old), "r" (new), "m" (*p) 311 : "r" (p), "r" (old), "r" (new)
304 : "cc", "memory"); 312 : "cc", "memory");
305 313
306 return prev; 314 return prev;
@@ -322,8 +330,8 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
322 ISYNC_ON_SMP 330 ISYNC_ON_SMP
323 "\n\ 331 "\n\
3242:" 3322:"
325 : "=&r" (prev), "=m" (*p) 333 : "=&r" (prev), "+m" (*p)
326 : "r" (p), "r" (old), "r" (new), "m" (*p) 334 : "r" (p), "r" (old), "r" (new)
327 : "cc", "memory"); 335 : "cc", "memory");
328 336
329 return prev; 337 return prev;