xref: /linux/tools/arch/s390/include/asm/barrier.h (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 /*
2  * Copied from the kernel sources:
3  *
4  * Copyright IBM Corp. 1999, 2009
5  *
6  * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7  */
8 
9 #ifndef __TOOLS_LINUX_ASM_BARRIER_H
10 #define __TOOLS_LINUX_ASM_BARRIER_H
11 
12 /*
13  * Force strict CPU ordering.
14  * And yes, this is required on UP too when we're talking
15  * to devices.
16  */
17 
18 #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
19 /* Fast-BCR without checkpoint synchronization */
20 #define __ASM_BARRIER "bcr 14,0\n"
21 #else
22 #define __ASM_BARRIER "bcr 15,0\n"
23 #endif
24 
25 #define mb() do {  asm volatile(__ASM_BARRIER : : : "memory"); } while (0)
26 
27 #define rmb()				mb()
28 #define wmb()				mb()
29 
30 #endif /* __TOOLS_LIB_ASM_BARRIER_H */
31