Skip to content

Commit

Permalink
perf, MIPS: Support cross compiling of tools/perf for MIPS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Deng-Cheng Zhu authored and Ingo Molnar committed Oct 12, 2010
1 parent ad0cf34 commit c1e028e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/perf/perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <time.h>
#include <unistd.h>
#include <sys/types.h>
Expand Down

0 comments on commit c1e028e

Please sign in to comment.