Skip to content

Commit

Permalink
ARM: 5869/1: ixp4xx: implement sched_clock()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Mikael Pettersson authored and Russell King committed Jan 27, 2010
1 parent 74d2e4f commit e00d9d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/arm/mach-ixp4xx/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,17 @@ static void __init ixp4xx_clocksource_init(void)
clocksource_register(&clocksource_ixp4xx);
}

/*
* 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
*/
Expand Down

0 comments on commit e00d9d4

Please sign in to comment.