public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.18-rt7 1/1] ARM: add latency timing support
@ 2006-11-07  0:21 Kevin Hilman
  2006-11-07 16:43 ` Kevin Hilman
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Hilman @ 2006-11-07  0:21 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

Add latency-timing support for IXP4xx.

Signed-off-by: Kevin Hilman <khilman@mvista.com>

Index: linux-2.6.18/include/asm-arm/arch-ixp4xx/timex.h
===================================================================
--- linux-2.6.18.orig/include/asm-arm/arch-ixp4xx/timex.h
+++ linux-2.6.18/include/asm-arm/arch-ixp4xx/timex.h
@@ -13,3 +13,11 @@
 #define FREQ 66666666
 #define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
 
+extern u64 ixp4xx_get_cycles(void);
+#define mach_read_cycles() ixp4xx_get_cycles()
+
+#ifdef CONFIG_LATENCY_TIMING
+#define mach_cycles_to_usecs(d) (((d) * ((1000000LL << 32) / CLOCK_TICK_RATE)) >> 32)
+#define mach_usecs_to_cycles(d) (((d) * (((long long)CLOCK_TICK_RATE << 32) / 1000000)) >> 32)
+#endif
+
Index: linux-2.6.18/include/asm-arm/timex.h
===================================================================
--- linux-2.6.18.orig/include/asm-arm/timex.h
+++ linux-2.6.18/include/asm-arm/timex.h
@@ -19,8 +19,12 @@ typedef unsigned long cycles_t;
 #ifndef mach_read_cycles
  #define mach_read_cycles() (0)
 #ifdef CONFIG_LATENCY_TIMING
- #define mach_cycles_to_usecs(d) (d)
- #define mach_usecs_to_cycles(d) (d)
+ #ifndef mach_cycles_to_usecs
+  #define mach_cycles_to_usecs(d) (d)
+ #endif
+ #ifndef mach_usecs_to_cycles
+  #define mach_usecs_to_cycles(d) (d)
+ #endif
 #endif
 #endif
 
--

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-07 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-07  0:21 [PATCH 2.6.18-rt7 1/1] ARM: add latency timing support Kevin Hilman
2006-11-07 16:43 ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox