xref: /OK3568_Linux_fs/kernel/tools/arch/mips/include/asm/barrier.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef _TOOLS_LINUX_ASM_MIPS_BARRIER_H
3*4882a593Smuzhiyun #define _TOOLS_LINUX_ASM_MIPS_BARRIER_H
4*4882a593Smuzhiyun /*
5*4882a593Smuzhiyun  * FIXME: This came from tools/perf/perf-sys.h, where it was first introduced
6*4882a593Smuzhiyun  * in c1e028ef40b8d6943b767028ba17d4f2ba020edb, more work needed to make it
7*4882a593Smuzhiyun  * more closely follow the Linux kernel arch/mips/include/asm/barrier.h file.
8*4882a593Smuzhiyun  * Probably when we continue work on tools/ Kconfig support to have all the
9*4882a593Smuzhiyun  * CONFIG_ needed for properly doing that.
10*4882a593Smuzhiyun  */
11*4882a593Smuzhiyun #define mb()		asm volatile(					\
12*4882a593Smuzhiyun 				".set	mips2\n\t"			\
13*4882a593Smuzhiyun 				"sync\n\t"				\
14*4882a593Smuzhiyun 				".set	mips0"				\
15*4882a593Smuzhiyun 				: /* no output */			\
16*4882a593Smuzhiyun 				: /* no input */			\
17*4882a593Smuzhiyun 				: "memory")
18*4882a593Smuzhiyun #define wmb()	mb()
19*4882a593Smuzhiyun #define rmb()	mb()
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun #endif /* _TOOLS_LINUX_ASM_MIPS_BARRIER_H */
22