From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Desnoyers Subject: [RFC patch 03/15] get_cycles() : sparc64 HAVE_GET_CYCLES Date: Thu, 16 Oct 2008 19:27:32 -0400 Message-ID: <20081016234655.893647148@polymtl.ca> References: <20081016232729.699004293@polymtl.ca> Return-path: Content-Disposition: inline; filename=get-cycles-sparc64-have-get-cycles.patch Sender: linux-kernel-owner@vger.kernel.org To: Linus Torvalds , Andrew Morton , Ingo Molnar , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Steve Cc: David Miller , Mathieu Desnoyers , Ingo Molnar List-Id: linux-arch.vger.kernel.org This patch selects HAVE_GET_CYCLES and makes sure get_cycles_barrier() and get_cycles_rate() are implemented. Signed-off-by: Mathieu Desnoyers CC: David Miller CC: Linus Torvalds CC: Andrew Morton CC: Ingo Molnar CC: Peter Zijlstra CC: Thomas Gleixner CC: Steven Rostedt 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca ([132.207.4.11]:54283 "EHLO smtp.polymtl.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbYJQAFD (ORCPT ); Thu, 16 Oct 2008 20:05:03 -0400 Message-ID: <20081016234655.893647148@polymtl.ca> References: <20081016232729.699004293@polymtl.ca> Date: Thu, 16 Oct 2008 19:27:32 -0400 From: Mathieu Desnoyers Subject: [RFC patch 03/15] get_cycles() : sparc64 HAVE_GET_CYCLES Content-Disposition: inline; filename=get-cycles-sparc64-have-get-cycles.patch Sender: linux-arch-owner@vger.kernel.org List-ID: To: Linus Torvalds , Andrew Morton , Ingo Molnar , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Steven Rostedt , Peter Zijlstra , Thomas Gleixner Cc: David Miller , Mathieu Desnoyers , Ingo Molnar Message-ID: <20081016232732.5NgWw01_-KBMP494uan3IkS3kFP4Kc_dbMg2Wikkvwo@z> This patch selects HAVE_GET_CYCLES and makes sure get_cycles_barrier() and get_cycles_rate() are implemented. Signed-off-by: Mathieu Desnoyers CC: David Miller CC: Linus Torvalds CC: Andrew Morton CC: Ingo Molnar CC: Peter Zijlstra CC: Thomas Gleixner CC: Steven Rostedt 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