summaryrefslogtreecommitdiff
path: root/arch/arm/mach-u300/timer.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-09-21 19:03:13 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-21 19:03:13 +0400
commit59b69e27ca9f6c6347b1ec07066a9250140cb9e8 (patch)
treed8ea8948c92bdfc7f3bdfc03a7b789243ffbaaa8 /arch/arm/mach-u300/timer.c
parent9c5e8fecc4a86adbf363f5cf344c0ccccdbb8982 (diff)
parentee2b805c8eb6459cf541ef141ff70dae17af59ca (diff)
downloadlinux-59b69e27ca9f6c6347b1ec07066a9250140cb9e8.tar.xz
Merge branch 'u300' into devel
Diffstat (limited to 'arch/arm/mach-u300/timer.c')
-rw-r--r--arch/arm/mach-u300/timer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index cce53204880e..26d26f5100fe 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/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.