diff options
author | Mikael Pettersson <mikpe@it.uu.se> | 2010-01-09 07:03:59 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-01-27 17:04:18 -0500 |
commit | e00d9d4b1796dae3adf6e39c9a766e760dd1c796 (patch) | |
tree | f866c0a50fabe57f321bb1161265a2e63086d3d9 /arch/arm/mach-ixp4xx | |
parent | 74d2e4f8d79ae0c4b6ec027958d5b18058662eea (diff) |
ARM: 5869/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.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp4xx')
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 3bbf40f6d964..71728d36d501 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -427,6 +427,17 @@ static void __init ixp4xx_clocksource_init(void) | |||
427 | } | 427 | } |
428 | 428 | ||
429 | /* | 429 | /* |
430 | * sched_clock() | ||
431 | */ | ||
432 | unsigned long long sched_clock(void) | ||
433 | { | ||
434 | cycle_t cyc = ixp4xx_get_cycles(NULL); | ||
435 | struct clocksource *cs = &clocksource_ixp4xx; | ||
436 | |||
437 | return clocksource_cyc2ns(cyc, cs->mult, cs->shift); | ||
438 | } | ||
439 | |||
440 | /* | ||
430 | * clockevents | 441 | * clockevents |
431 | */ | 442 | */ |
432 | static int ixp4xx_set_next_event(unsigned long evt, | 443 | static int ixp4xx_set_next_event(unsigned long evt, |