diff options
author | Mikael Pettersson <mikpe@it.uu.se> | 2009-10-29 14:46:56 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-10-29 14:46:56 -0400 |
commit | 345a32296b1f9f6121379e0240915e0e2be2dbf5 (patch) | |
tree | 995ad5887af10b11b2cbc48e8936f7f7d9fbb109 /arch/arm/plat-iop | |
parent | 980f2296b5a8dfe589f023fd34229dcfdcf280fa (diff) |
iop: implement sched_clock()
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.
[dan.j.williams@intel.com: allow early cp6 access]
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'arch/arm/plat-iop')
-rw-r--r-- | arch/arm/plat-iop/time.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c index aaaef3b4bc65..6c8a02ad98e3 100644 --- a/arch/arm/plat-iop/time.c +++ b/arch/arm/plat-iop/time.c | |||
@@ -66,6 +66,17 @@ static void __init iop_clocksource_set_hz(struct clocksource *cs, unsigned int h | |||
66 | } | 66 | } |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * IOP sched_clock() implementation via its clocksource. | ||
70 | */ | ||
71 | unsigned long long sched_clock(void) | ||
72 | { | ||
73 | cycle_t cyc = iop_clocksource_read(NULL); | ||
74 | struct clocksource *cs = &iop_clocksource; | ||
75 | |||
76 | return clocksource_cyc2ns(cyc, cs->mult, cs->shift); | ||
77 | } | ||
78 | |||
79 | /* | ||
69 | * IOP clockevents (interrupting timer 0). | 80 | * IOP clockevents (interrupting timer 0). |
70 | */ | 81 | */ |
71 | static int iop_set_next_event(unsigned long delta, | 82 | static int iop_set_next_event(unsigned long delta, |