From 6548f88495f4b2e20cb15e21b8ad99add530eaae Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 17 Sep 2009 13:10:50 +0100 Subject: [PATCH] --- yaml --- r: 166121 b: refs/heads/master c: a2ca00ea9398265a26eabb358bba83c8b75c463d h: refs/heads/master i: 166119: fbdc5b992e0056c8aa9106a172351aeb9c7bfca9 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-u300/timer.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f496126870b1..a601619b347a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6be2a0cacc1ed6899a53172e2e9b7a3587be0bea +refs/heads/master: a2ca00ea9398265a26eabb358bba83c8b75c463d diff --git a/trunk/arch/arm/mach-u300/timer.c b/trunk/arch/arm/mach-u300/timer.c index cce53204880e..26d26f5100fe 100644 --- a/trunk/arch/arm/mach-u300/timer.c +++ b/trunk/arch/arm/mach-u300/timer.c @@ -346,6 +346,21 @@ static struct clocksource clocksource_u300_1mhz = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; +/* + * Override the global weak sched_clock symbol with this + * local implementation which uses the clocksource to get some + * better resolution when scheduling the kernel. We accept that + * this wraps around for now, since it is just a relative time + * stamp. (Inspired by OMAP implementation.) + */ +unsigned long long notrace sched_clock(void) +{ + return clocksource_cyc2ns(clocksource_u300_1mhz.read( + &clocksource_u300_1mhz), + clocksource_u300_1mhz.mult, + clocksource_u300_1mhz.shift); +} + /* * This sets up the system timers, clock source and clock event.