Go to the documentation of this file. 1 #ifndef _ASM_UM_BARRIER_H_
2 #define _ASM_UM_BARRIER_H_
5 #include <asm/segment.h>
6 #include <asm/cpufeature.h>
7 #include <asm/cmpxchg.h>
10 #include <linux/kernel.h>
20 #define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
21 #define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
22 #define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
26 #define mb() asm volatile("mfence" : : : "memory")
27 #define rmb() asm volatile("lfence" : : : "memory")
28 #define wmb() asm volatile("sfence" : : : "memory")
32 #define read_barrier_depends() do { } while (0)
37 #ifdef CONFIG_X86_PPRO_FENCE
38 #define smp_rmb() rmb()
40 #define smp_rmb() barrier()
43 #ifdef CONFIG_X86_OOSTORE
44 #define smp_wmb() wmb()
46 #define smp_wmb() barrier()
49 #define smp_read_barrier_depends() read_barrier_depends()
50 #define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
54 #define smp_mb() barrier()
55 #define smp_rmb() barrier()
56 #define smp_wmb() barrier()
57 #define smp_read_barrier_depends() do { } while (0)
58 #define set_mb(var, value) do { var = value; barrier(); } while (0)
69 static inline void rdtsc_barrier(
void)