Linux 4.16-rc1
[cris-mirror.git] / tools / arch / s390 / include / asm / barrier.h
blob5030c99f47d2057e916edd38a2d91ed15beb63c6
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copied from the kernel sources:
5 * Copyright IBM Corp. 1999, 2009
7 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
8 */
10 #ifndef __TOOLS_LINUX_ASM_BARRIER_H
11 #define __TOOLS_LINUX_ASM_BARRIER_H
14 * Force strict CPU ordering.
15 * And yes, this is required on UP too when we're talking
16 * to devices.
19 #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
20 /* Fast-BCR without checkpoint synchronization */
21 #define __ASM_BARRIER "bcr 14,0\n"
22 #else
23 #define __ASM_BARRIER "bcr 15,0\n"
24 #endif
26 #define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0)
28 #define rmb() mb()
29 #define wmb() mb()
31 #endif /* __TOOLS_LIB_ASM_BARRIER_H */