From c1e028ef40b8d6943b767028ba17d4f2ba020edb Mon Sep 17 00:00:00 2001 From: Deng-Cheng Zhu Date: Tue, 12 Oct 2010 19:33:33 +0800 Subject: perf, MIPS: Support cross compiling of tools/perf for MIPS Changes: v4: Fix the cosmetic issue of redundant dot-ops v3: Change rmb() to use SYNC v2: Include mips unistd.h and define rmb()/cpu_relax() in tools/perf/perf.h Signed-off-by: Deng-Cheng Zhu Acked-by: Ralf Baechle Cc: David Daney Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker Cc: Paul Mackerras Signed-off-by: Ingo Molnar --- tools/perf/perf.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools/perf/perf.h') diff --git a/tools/perf/perf.h b/tools/perf/perf.h index ef7aa0a0c526..95aaf565c704 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -73,6 +73,18 @@ void get_term_dimensions(struct winsize *ws); #define cpu_relax() asm volatile("":::"memory") #endif +#ifdef __mips__ +#include "../../arch/mips/include/asm/unistd.h" +#define rmb() asm volatile( \ + ".set mips2\n\t" \ + "sync\n\t" \ + ".set mips0" \ + : /* no output */ \ + : /* no input */ \ + : "memory") +#define cpu_relax() asm volatile("" ::: "memory") +#endif + #include #include #include -- cgit v1.2.3-59-g8ed1b