Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-qnjdqwu3vcnt14vqmr6wu788@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+4 -2
+4
tools/include/linux/compiler.h
··· 1 1 #ifndef _TOOLS_LINUX_COMPILER_H_ 2 2 #define _TOOLS_LINUX_COMPILER_H_ 3 3 4 + /* Optimization barrier */ 5 + /* The "volatile" is due to gcc bugs */ 6 + #define barrier() __asm__ __volatile__("": : :"memory") 7 + 4 8 #ifndef __always_inline 5 9 # define __always_inline inline __attribute__((always_inline)) 6 10 #endif
-2
tools/perf/perf-sys.h
··· 153 153 #define CPUINFO_PROC {"model name"} 154 154 #endif 155 155 156 - #define barrier() asm volatile ("" ::: "memory") 157 - 158 156 #ifndef cpu_relax 159 157 #define cpu_relax() barrier() 160 158 #endif