2 * Copyright IBM Corp. 1999, 2009
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 #ifndef __ASM_BARRIER_H
8 #define __ASM_BARRIER_H
11 * Force strict CPU ordering.
12 * And yes, this is required on UP too when we're talking
16 #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
17 /* Fast-BCR without checkpoint synchronization */
18 #define __ASM_BARRIER "bcr 14,0\n"
20 #define __ASM_BARRIER "bcr 15,0\n"
23 #define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0)
25 #define rmb() barrier()
26 #define wmb() barrier()
27 #define dma_rmb() mb()
28 #define dma_wmb() mb()
30 #define smp_rmb() rmb()
31 #define smp_wmb() wmb()
33 #define read_barrier_depends() do { } while (0)
34 #define smp_read_barrier_depends() do { } while (0)
36 #define smp_mb__before_atomic() smp_mb()
37 #define smp_mb__after_atomic() smp_mb()
39 #define smp_store_mb(var, value) do { WRITE_ONCE(var, value); smp_mb(); } while (0)
41 #define smp_store_release(p, v) \
43 compiletime_assert_atomic_type(*p); \
48 #define smp_load_acquire(p) \
50 typeof(*p) ___p1 = READ_ONCE(*p); \
51 compiletime_assert_atomic_type(*p); \
56 #endif /* __ASM_BARRIER_H */