[RFC patch 03/15] get_cycles() : sparc64 HAVE_GET_CYCLES
From: Mathieu Desnoyers <hidden>
Date: 2008-10-16 23:57:46
Also in:
lkml
This patch selects HAVE_GET_CYCLES and makes sure get_cycles_barrier() and get_cycles_rate() are implemented. Signed-off-by: Mathieu Desnoyers <redacted> CC: David Miller <davem@davemloft.net> CC: Linus Torvalds <torvalds@linux-foundation.org> CC: Andrew Morton <akpm@linux-foundation.org> CC: Ingo Molnar <mingo@redhat.com> CC: Peter Zijlstra <redacted> CC: Thomas Gleixner <redacted> CC: Steven Rostedt <rostedt@goodmis.org> CC: linux-arch@vger.kernel.org --- arch/sparc/include/asm/timex_64.h | 17 ++++++++++++++++- arch/sparc64/Kconfig | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) Index: linux-2.6-lttng/arch/sparc64/Kconfig ===================================================================
--- linux-2.6-lttng.orig/arch/sparc64/Kconfig 2008-10-16 13:07:04.000000000 -0400
+++ linux-2.6-lttng/arch/sparc64/Kconfig 2008-10-16 18:14:45.000000000 -0400@@ -14,6 +14,7 @@ config SPARC64 select HAVE_DYNAMIC_FTRACE select HAVE_FTRACE select HAVE_IDE + select HAVE_GET_CYCLES select HAVE_LMB select HAVE_ARCH_KGDB select USE_GENERIC_SMP_HELPERS if SMP
Index: linux-2.6-lttng/arch/sparc/include/asm/timex_64.h ===================================================================
--- linux-2.6-lttng.orig/arch/sparc/include/asm/timex_64.h 2008-10-16 13:07:04.000000000 -0400
+++ linux-2.6-lttng/arch/sparc/include/asm/timex_64.h 2008-10-16 18:14:25.000000000 -0400@@ -12,7 +12,22 @@ /* Getting on the cycle counter on sparc64. */ typedef unsigned long cycles_t; -#define get_cycles() tick_ops->get_tick() + +static inline cycles_t get_cycles(void) +{ + return tick_ops->get_tick(); +} + +/* get_cycles instruction is synchronized on sparc64 */ +static inline void get_cycles_barrier(void) +{ + return; +} + +static inline cycles_t get_cycles_rate(void) +{ + return CLOCK_TICK_RATE; +} #define ARCH_HAS_READ_CURRENT_TIMER
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68