irqchip: Fix dependencies for archs w/o HAS_IOMEM
[linux/fpc-iii.git] / arch / s390 / include / asm / barrier.h
blob7ffd0b19135c8d46770f1f37ca6d4da19e352de0
1 /*
2 * Copyright IBM Corp. 1999, 2009
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
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
13 * to devices.
16 #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
17 /* Fast-BCR without checkpoint synchronization */
18 #define __ASM_BARRIER "bcr 14,0\n"
19 #else
20 #define __ASM_BARRIER "bcr 15,0\n"
21 #endif
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()
29 #define smp_mb() 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) \
42 do { \
43 compiletime_assert_atomic_type(*p); \
44 barrier(); \
45 WRITE_ONCE(*p, v); \
46 } while (0)
48 #define smp_load_acquire(p) \
49 ({ \
50 typeof(*p) ___p1 = READ_ONCE(*p); \
51 compiletime_assert_atomic_type(*p); \
52 barrier(); \
53 ___p1; \
56 #endif /* __ASM_BARRIER_H */