Skip to contentSkip to conversation

ixp4xx: implement sched_clock()

PATCH New Mikael Pettersson 3 participants 4 messages Dec 29, 2009 – Jan 9, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixp4xx: implement sched_clock()

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.

---
 arch/arm/mach-ixp4xx/common.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/mach-ixp4xx/common.c +11 -0
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
@@ -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,
#1 lore raw

PATCH 1/1 ixp4xx: implement sched_clock()

Quoted 5 lines · Mikael Pettersson

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.

Great, patch system please? Thanks.

#2 lore raw

PATCH 1/1 ixp4xx: implement sched_clock()

In reply to Mikael Pettersson
Quoted 5 lines · Mikael Pettersson

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.

Good to see the confirmation, I know next to nothing about the clocksource matter. I can pick this up if you wish, of course, or you can send it through Russell.

Signature · 1 line
Krzysztof Halasa
#3 lore raw

PATCH 1/1 ixp4xx: implement sched_clock()

Quoted 11 lines · Krzysztof Halasa
Quoted 5 lines · Mikael Pettersson

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.

Good to see the confirmation, I know next to nothing about the clocksource matter. I can pick this up if you wish, of course, or you can send it through Russell.

I'll send it to the patch system later today.

/Mikael