aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2009-12-23 16:18:54 -0500
committerRalf Baechle <ralf@linux-mips.org>2010-01-12 12:19:34 -0500
commitc6a3c851a287980e47b45bf191a3b78d9d8508e2 (patch)
treeb58339ebc32655ecff45e1f2d32c9ec26dc881f8 /arch
parent98bea6fc87390b6a12f595ad06fc686712435f94 (diff)
MIPS: Octeon: Add sched_clock() to csrc-octeon.c
With the advent of function graph tracing on MIPS, Octeon needs a high precision sched_clock() implementation. Without it, most timing numbers are reported as 0.000. This new sched_clock just uses the 64-bit cycle counter appropriately scaled. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Patchwork: http://patchwork.linux-mips.org/patch/805/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/cavium-octeon/csrc-octeon.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/cavium-octeon/csrc-octeon.c b/arch/mips/cavium-octeon/csrc-octeon.c
index 96110f217dcd..96df821fbd81 100644
--- a/arch/mips/cavium-octeon/csrc-octeon.c
+++ b/arch/mips/cavium-octeon/csrc-octeon.c
@@ -50,6 +50,13 @@ static struct clocksource clocksource_mips = {
50 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 50 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
51}; 51};
52 52
53unsigned long long notrace sched_clock(void)
54{
55 return clocksource_cyc2ns(read_c0_cvmcount(),
56 clocksource_mips.mult,
57 clocksource_mips.shift);
58}
59
53void __init plat_time_init(void) 60void __init plat_time_init(void)
54{ 61{
55 clocksource_mips.rating = 300; 62 clocksource_mips.rating = 300;