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