diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-04-30 11:33:22 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-05-08 15:05:03 -0400 |
commit | 361c564eeff4b78f1303b86e8e8f07fc547bd2c9 (patch) | |
tree | 7a3d74423930cbc539766017a3ec9e88275e918b /tools/arch | |
parent | f8bffbf1222a64336a81974fc25fe846656ac53e (diff) |
perf tools: Move x86 barrier.h stuff to tools/arch/x86/include/asm/barrier.h
We will need it for atomic.h, so move it from the ad-hoc tools/perf/
place to a tools/ subset of the kernel arch/ hierarchy.
Other aches will follow, each in a cset.
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-vy6bqmsvm6puibpay2cy4wid@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/arch')
-rw-r--r-- | tools/arch/x86/include/asm/barrier.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/arch/x86/include/asm/barrier.h b/tools/arch/x86/include/asm/barrier.h new file mode 100644 index 000000000000..f366d8e550e4 --- /dev/null +++ b/tools/arch/x86/include/asm/barrier.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef _TOOLS_LINUX_ASM_X86_BARRIER_H | ||
2 | #define _TOOLS_LINUX_ASM_X86_BARRIER_H | ||
3 | |||
4 | /* | ||
5 | * Copied from the Linux kernel sources, and also moving code | ||
6 | * out from tools/perf/perf-sys.h so as to make it be located | ||
7 | * in a place similar as in the kernel sources. | ||
8 | * | ||
9 | * Force strict CPU ordering. | ||
10 | * And yes, this is required on UP too when we're talking | ||
11 | * to devices. | ||
12 | */ | ||
13 | |||
14 | #if defined(__i386__) | ||
15 | /* | ||
16 | * Some non-Intel clones support out of order store. wmb() ceases to be a | ||
17 | * nop for these. | ||
18 | */ | ||
19 | #define mb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory") | ||
20 | #define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory") | ||
21 | #define wmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory") | ||
22 | #elif defined(__x86_64__) | ||
23 | #define mb() asm volatile("mfence":::"memory") | ||
24 | #define rmb() asm volatile("lfence":::"memory") | ||
25 | #define wmb() asm volatile("sfence" ::: "memory") | ||
26 | #endif | ||
27 | |||
28 | #endif /* _TOOLS_LINUX_ASM_X86_BARRIER_H */ | ||