Go to the documentation of this file. 1 #ifndef _ASM_X86_BARRIER_H
2 #define _ASM_X86_BARRIER_H
18 #define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
19 #define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
20 #define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
22 #define mb() asm volatile("mfence":::"memory")
23 #define rmb() asm volatile("lfence":::"memory")
24 #define wmb() asm volatile("sfence" ::: "memory")
79 #define read_barrier_depends() do { } while (0)
83 #ifdef CONFIG_X86_PPRO_FENCE
84 # define smp_rmb() rmb()
86 # define smp_rmb() barrier()
88 #ifdef CONFIG_X86_OOSTORE
89 # define smp_wmb() wmb()
91 # define smp_wmb() barrier()
93 #define smp_read_barrier_depends() read_barrier_depends()
94 #define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
96 #define smp_mb() barrier()
97 #define smp_rmb() barrier()
98 #define smp_wmb() barrier()
99 #define smp_read_barrier_depends() do { } while (0)
100 #define set_mb(var, value) do { var = value; barrier(); } while (0)