aboutsummaryrefslogtreecommitdiff
path: root/tools/include/linux
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <[email protected]>2015-05-07 13:38:16 -0300
committerArnaldo Carvalho de Melo <[email protected]>2015-05-08 16:05:04 -0300
commit5ac69737dc5e25fb1c26d18059c8e17ce2671d5d (patch)
tree391e80d406a2021c18e74354397775a3f21b888f /tools/include/linux
parent07d207ac0c55a413c358153bd3012c5fa51a0554 (diff)
perf tools: Move barrier() definition to tools/include/linux/compiler.h
To make it generally accessible by other tools/ projects, also will be used in the tools/arch/*/include/asm/barrier.h files that are being introduced now. Cc: Adrian Hunter <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Cc: Don Zickus <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/include/linux')
-rw-r--r--tools/include/linux/compiler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 88461f09cc86..f0e72674c52d 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -1,6 +1,10 @@
#ifndef _TOOLS_LINUX_COMPILER_H_
#define _TOOLS_LINUX_COMPILER_H_
+/* Optimization barrier */
+/* The "volatile" is due to gcc bugs */
+#define barrier() __asm__ __volatile__("": : :"memory")
+
#ifndef __always_inline
# define __always_inline inline __attribute__((always_inline))
#endif