diff options
Diffstat (limited to 'include/asm-alpha/barrier.h')
-rw-r--r-- | include/asm-alpha/barrier.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h new file mode 100644 index 000000000000..681ff581afa5 --- /dev/null +++ b/include/asm-alpha/barrier.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef __BARRIER_H | ||
2 | #define __BARRIER_H | ||
3 | |||
4 | #include <asm/compiler.h> | ||
5 | |||
6 | #define mb() \ | ||
7 | __asm__ __volatile__("mb": : :"memory") | ||
8 | |||
9 | #define rmb() \ | ||
10 | __asm__ __volatile__("mb": : :"memory") | ||
11 | |||
12 | #define wmb() \ | ||
13 | __asm__ __volatile__("wmb": : :"memory") | ||
14 | |||
15 | #define read_barrier_depends() \ | ||
16 | __asm__ __volatile__("mb": : :"memory") | ||
17 | |||
18 | #ifdef CONFIG_SMP | ||
19 | #define smp_mb() mb() | ||
20 | #define smp_rmb() rmb() | ||
21 | #define smp_wmb() wmb() | ||
22 | #define smp_read_barrier_depends() read_barrier_depends() | ||
23 | #else | ||
24 | #define smp_mb() barrier() | ||
25 | #define smp_rmb() barrier() | ||
26 | #define smp_wmb() barrier() | ||
27 | #define smp_read_barrier_depends() barrier() | ||
28 | #endif | ||
29 | |||
30 | #define set_mb(var, value) \ | ||
31 | do { var = value; mb(); } while (0) | ||
32 | |||
33 | #define set_wmb(var, value) \ | ||
34 | do { var = value; wmb(); } while (0) | ||
35 | |||
36 | #endif /* __BARRIER_H */ | ||