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 <dengcheng.zhu@gmail.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: David Daney <ddaney@caviumnetworks.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Deng-Cheng Zhu and committed by Ingo Molnar c1e028ef ad0cf347

+12
+12
tools/perf/perf.h
··· 73 73 #define cpu_relax() asm volatile("":::"memory") 74 74 #endif 75 75 76 + #ifdef __mips__ 77 + #include "../../arch/mips/include/asm/unistd.h" 78 + #define rmb() asm volatile( \ 79 + ".set mips2\n\t" \ 80 + "sync\n\t" \ 81 + ".set mips0" \ 82 + : /* no output */ \ 83 + : /* no input */ \ 84 + : "memory") 85 + #define cpu_relax() asm volatile("" ::: "memory") 86 + #endif 87 + 76 88 #include <time.h> 77 89 #include <unistd.h> 78 90 #include <sys/types.h>