All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 4/4] iop: implement sched_clock()
@ 2009-10-16 22:00 Mikael Pettersson
  2009-10-22 21:49 ` Dan Williams
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael Pettersson @ 2009-10-16 22:00 UTC (permalink / raw)
  To: linux-arm-kernel

This adds a better sched_clock() to the IOP platform,
implemented using its new clocksource support.

Tested on n2100, compile-tested for all plat-iop machines.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
---
Changes v2 -> v3:
* bug fix: open-code cyc2ns() and use cs->mult_orig not cs->mult
* rebased on 2.6.32-rc5, use new clocksource_cyc2ns()

Changes v1 -> v2:
* implemented sched_clock()

 arch/arm/plat-iop/time.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff -rupN linux-2.6.32-rc5.arm-iop-3-generictime-v3/arch/arm/plat-iop/time.c linux-2.6.32-rc5.arm-iop-4-sched_clock-v3/arch/arm/plat-iop/time.c
--- linux-2.6.32-rc5.arm-iop-3-generictime-v3/arch/arm/plat-iop/time.c	2009-10-16 21:36:55.000000000 +0200
+++ linux-2.6.32-rc5.arm-iop-4-sched_clock-v3/arch/arm/plat-iop/time.c	2009-10-16 21:39:16.000000000 +0200
@@ -66,6 +66,17 @@ static void __init iop_clocksource_set_h
 }
 
 /*
+ * IOP sched_clock() implementation via its clocksource.
+ */
+unsigned long long sched_clock(void)
+{
+	cycle_t cyc = iop_clocksource_read(NULL);
+	struct clocksource *cs = &iop_clocksource;
+
+	return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
+}
+
+/*
  * IOP clockevents (interrupting timer 0).
  */
 static int iop_set_next_event(unsigned long delta,

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

end of thread, other threads:[~2009-10-27 23:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-16 22:00 [PATCH v3 4/4] iop: implement sched_clock() Mikael Pettersson
2009-10-22 21:49 ` Dan Williams
2009-10-22 22:17   ` Mikael Pettersson
2009-10-23 12:04     ` Mikael Pettersson
2009-10-26 18:34       ` Dan Williams
2009-10-27 10:52         ` Mikael Pettersson
2009-10-27 23:43           ` Dan Williams
2009-10-23 17:12     ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.