public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ixp4xx: implement sched_clock()
@ 2009-12-29 15:27 Mikael Pettersson
  2010-01-08 17:27 ` Russell King - ARM Linux
  2010-01-08 21:07 ` Krzysztof Halasa
  0 siblings, 2 replies; 4+ messages in thread
From: Mikael Pettersson @ 2009-12-29 15:27 UTC (permalink / raw)
  To: linux-arm-kernel

Add a better sched_clock() to the ixp4xx platform,
implemented via its clocksource support.

This is based on the sched_clock() I implemented for
the IOP platform. Tested on a ds101 ixp420 machine.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
---
 arch/arm/mach-ixp4xx/common.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff -rupN linux-2.6.33-rc2/arch/arm/mach-ixp4xx/common.c linux-2.6.33-rc2.arm-ixp4xx-sched_clock/arch/arm/mach-ixp4xx/common.c
--- linux-2.6.33-rc2/arch/arm/mach-ixp4xx/common.c	2009-12-26 15:20:55.000000000 +0100
+++ linux-2.6.33-rc2.arm-ixp4xx-sched_clock/arch/arm/mach-ixp4xx/common.c	2009-12-26 15:39:01.000000000 +0100
@@ -427,6 +427,17 @@ static void __init ixp4xx_clocksource_in
 }
 
 /*
+ * sched_clock()
+ */
+unsigned long long sched_clock(void)
+{
+	cycle_t cyc = ixp4xx_get_cycles(NULL);
+	struct clocksource *cs = &clocksource_ixp4xx;
+
+	return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
+}
+
+/*
  * clockevents
  */
 static int ixp4xx_set_next_event(unsigned long evt,

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

end of thread, other threads:[~2010-01-09 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-29 15:27 [PATCH] ixp4xx: implement sched_clock() Mikael Pettersson
2010-01-08 17:27 ` Russell King - ARM Linux
2010-01-08 21:07 ` Krzysztof Halasa
2010-01-09 11:30   ` Mikael Pettersson

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