/* Overwrite weak default sched_clock with more precise one */ unsigned long long notrace sched_clock(void) { static int is_mapped; /* * sched_clock is called earlier than .init of sys_timer * if we map timer memory in .init of sys_timer, system * will panic due to illegal memory access */ if (!is_mapped) { sirfsoc_of_timer_map(); is_mapped = 1; } return sirfsoc_timer_read(NULL) * (NSEC_PER_SEC / CLOCK_TICK_RATE); }
/* Overwrite weak default sched_clock with more precise one */ static u64 notrace sirfsoc_read_sched_clock(void) { return sirfsoc_timer_read(NULL); }