Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Deng-Cheng Zhu and committed by
Ralf Baechle
262f1c92 0dc886ab

+8
+8
arch/mips/kernel/csrc-sb1250.c
··· 12 12 * GNU General Public License for more details. 13 13 */ 14 14 #include <linux/clocksource.h> 15 + #include <linux/sched_clock.h> 15 16 16 17 #include <asm/addrspace.h> 17 18 #include <asm/io.h> ··· 54 53 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 55 54 }; 56 55 56 + static u64 notrace sb1250_read_sched_clock(void) 57 + { 58 + return sb1250_hpt_get_cycles(); 59 + } 60 + 57 61 void __init sb1250_clocksource_init(void) 58 62 { 59 63 struct clocksource *cs = &bcm1250_clocksource; ··· 75 69 R_SCD_TIMER_CFG))); 76 70 77 71 clocksource_register_hz(cs, V_SCD_TIMER_FREQ); 72 + 73 + sched_clock_register(sb1250_read_sched_clock, 23, V_SCD_TIMER_FREQ); 78 74 }