diff options
author | Deng-Cheng Zhu <dengcheng.zhu@imgtec.com> | 2015-03-07 13:30:34 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-01 11:21:33 -0400 |
commit | 262f1c92912fcf4150cafb1b1e78a2e4e646d008 (patch) | |
tree | 89f284c735770ee55f77b09da48876de4423869b /arch/mips/kernel/csrc-sb1250.c | |
parent | 0dc886aba2c170118da8986c8ec73cc9902f7340 (diff) |
MIPS: csrc-sb1250: Implement read_sched_clock
Use sb1250 hpt for sched_clock source. This implementation will give high
resolution cputime accounting.
Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: macro@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9488/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/csrc-sb1250.c')
-rw-r--r-- | arch/mips/kernel/csrc-sb1250.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/mips/kernel/csrc-sb1250.c b/arch/mips/kernel/csrc-sb1250.c index 1ecfa4bc842a..d915652b4d56 100644 --- a/arch/mips/kernel/csrc-sb1250.c +++ b/arch/mips/kernel/csrc-sb1250.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | */ | 13 | */ |
14 | #include <linux/clocksource.h> | 14 | #include <linux/clocksource.h> |
15 | #include <linux/sched_clock.h> | ||
15 | 16 | ||
16 | #include <asm/addrspace.h> | 17 | #include <asm/addrspace.h> |
17 | #include <asm/io.h> | 18 | #include <asm/io.h> |
@@ -53,6 +54,11 @@ struct clocksource bcm1250_clocksource = { | |||
53 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 54 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
54 | }; | 55 | }; |
55 | 56 | ||
57 | static u64 notrace sb1250_read_sched_clock(void) | ||
58 | { | ||
59 | return sb1250_hpt_get_cycles(); | ||
60 | } | ||
61 | |||
56 | void __init sb1250_clocksource_init(void) | 62 | void __init sb1250_clocksource_init(void) |
57 | { | 63 | { |
58 | struct clocksource *cs = &bcm1250_clocksource; | 64 | struct clocksource *cs = &bcm1250_clocksource; |
@@ -69,4 +75,6 @@ void __init sb1250_clocksource_init(void) | |||
69 | R_SCD_TIMER_CFG))); | 75 | R_SCD_TIMER_CFG))); |
70 | 76 | ||
71 | clocksource_register_hz(cs, V_SCD_TIMER_FREQ); | 77 | clocksource_register_hz(cs, V_SCD_TIMER_FREQ); |
78 | |||
79 | sched_clock_register(sb1250_read_sched_clock, 23, V_SCD_TIMER_FREQ); | ||
72 | } | 80 | } |