From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752628AbbEJHG7 (ORCPT ); Sun, 10 May 2015 03:06:59 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44741 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752367AbbEJHGz (ORCPT ); Sun, 10 May 2015 03:06:55 -0400 Date: Sun, 10 May 2015 00:06:40 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: eranian@google.com, dzickus@redhat.com, bp@suse.de, acme@redhat.com, adrian.hunter@intel.com, tglx@linutronix.de, hpa@zytor.com, dsahern@gmail.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, fweisbec@gmail.com, mingo@kernel.org, jolsa@redhat.com Reply-To: dsahern@gmail.com, linux-kernel@vger.kernel.org, mingo@kernel.org, jolsa@redhat.com, namhyung@kernel.org, fweisbec@gmail.com, bp@suse.de, acme@redhat.com, eranian@google.com, dzickus@redhat.com, adrian.hunter@intel.com, hpa@zytor.com, tglx@linutronix.de To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Move barrier() definition to tools/ include/linux/compiler.h Git-Commit-ID: 5ac69737dc5e25fb1c26d18059c8e17ce2671d5d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 5ac69737dc5e25fb1c26d18059c8e17ce2671d5d Gitweb: http://git.kernel.org/tip/5ac69737dc5e25fb1c26d18059c8e17ce2671d5d Author: Arnaldo Carvalho de Melo AuthorDate: Thu, 7 May 2015 13:38:16 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 8 May 2015 16:05:04 -0300 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 Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-qnjdqwu3vcnt14vqmr6wu788@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/include/linux/compiler.h | 4 ++++ tools/perf/perf-sys.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h index 88461f0..f0e7267 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 diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h index bf349ea..f44e53e 100644 --- a/tools/perf/perf-sys.h +++ b/tools/perf/perf-sys.h @@ -153,8 +153,6 @@ #define CPUINFO_PROC {"model name"} #endif -#define barrier() asm volatile ("" ::: "memory") - #ifndef cpu_relax #define cpu_relax() barrier() #endif