projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d95e731
)
rk_timer: support sched_clock
author
黄涛
<huangtao@rock-chips.com>
Tue, 22 Jan 2013 03:30:13 +0000
(11:30 +0800)
committer
黄涛
<huangtao@rock-chips.com>
Tue, 22 Jan 2013 03:31:55 +0000
(11:31 +0800)
arch/arm/plat-rk/rk_timer.c
patch
|
blob
|
history
diff --git
a/arch/arm/plat-rk/rk_timer.c
b/arch/arm/plat-rk/rk_timer.c
index 24dc1b508ce8afc1582b7fac6e66a6d38ccd6208..51e5e5934b8d672e00e5caa376e2a6a9db09371b 100644
(file)
--- a/
arch/arm/plat-rk/rk_timer.c
+++ b/
arch/arm/plat-rk/rk_timer.c
@@
-282,3
+282,18
@@
int local_timer_ack(void)
return 0;
}
#endif
+
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ */
+unsigned long long notrace sched_clock(void)
+{
+ const struct clocksource *cs = &rk_timer_clocksource;
+ cycle_t cyc;
+
+ if (!timer.cs_base)
+ return 0;
+
+ cyc = ~rk_timer_read_current_value(timer.cs_base);
+ return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
+}