Thomas Gleixner | b4d0d23 | 2019-05-20 19:08:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Arnaldo Carvalho de Melo | c6e39db | 2015-05-07 17:04:06 -0300 | [diff] [blame] | 2 | /* |
| 3 | * Copied from the kernel sources to tools/perf/: |
| 4 | * |
David Howells | 739d875 | 2018-03-08 09:48:46 +0000 | [diff] [blame] | 5 | * Generic barrier definitions. |
Arnaldo Carvalho de Melo | c6e39db | 2015-05-07 17:04:06 -0300 | [diff] [blame] | 6 | * |
| 7 | * It should be possible to use these on really simple architectures, |
| 8 | * but it serves more as a starting point for new ports. |
| 9 | * |
| 10 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. |
| 11 | * Written by David Howells (dhowells@redhat.com) |
Arnaldo Carvalho de Melo | c6e39db | 2015-05-07 17:04:06 -0300 | [diff] [blame] | 12 | */ |
| 13 | #ifndef __TOOLS_LINUX_ASM_GENERIC_BARRIER_H |
| 14 | #define __TOOLS_LINUX_ASM_GENERIC_BARRIER_H |
| 15 | |
| 16 | #ifndef __ASSEMBLY__ |
| 17 | |
| 18 | #include <linux/compiler.h> |
| 19 | |
| 20 | /* |
| 21 | * Force strict CPU ordering. And yes, this is required on UP too when we're |
| 22 | * talking to devices. |
| 23 | * |
| 24 | * Fall back to compiler barriers if nothing better is provided. |
| 25 | */ |
| 26 | |
| 27 | #ifndef mb |
| 28 | #define mb() barrier() |
| 29 | #endif |
| 30 | |
| 31 | #ifndef rmb |
| 32 | #define rmb() mb() |
| 33 | #endif |
| 34 | |
| 35 | #ifndef wmb |
| 36 | #define wmb() mb() |
| 37 | #endif |
| 38 | |
| 39 | #endif /* !__ASSEMBLY__ */ |
| 40 | #endif /* __TOOLS_LINUX_ASM_GENERIC_BARRIER_H */ |