WIP FPC-III support
[linux/fpc-iii.git] / arch / x86 / um / asm / barrier.h
blob165be7f9a96447bc87138e0e4392d7b33f4868d8
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_UM_BARRIER_H_
3 #define _ASM_UM_BARRIER_H_
5 #include <asm/alternative.h>
7 /*
8 * Force strict CPU ordering.
9 * And yes, this is required on UP too when we're talking
10 * to devices.
12 #ifdef CONFIG_X86_32
14 #define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
15 #define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
16 #define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
18 #else /* CONFIG_X86_32 */
20 #define mb() asm volatile("mfence" : : : "memory")
21 #define rmb() asm volatile("lfence" : : : "memory")
22 #define wmb() asm volatile("sfence" : : : "memory")
24 #endif /* CONFIG_X86_32 */
26 #include <asm-generic/barrier.h>
28 #endif