Lines Matching refs:clock
136 static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) in tk_setup_internals() argument
142 old_clock = tk->tkr_mono.clock; in tk_setup_internals()
143 tk->tkr_mono.clock = clock; in tk_setup_internals()
144 tk->tkr_mono.read = clock->read; in tk_setup_internals()
145 tk->tkr_mono.mask = clock->mask; in tk_setup_internals()
146 tk->tkr_mono.cycle_last = tk->tkr_mono.read(clock); in tk_setup_internals()
148 tk->tkr_raw.clock = clock; in tk_setup_internals()
149 tk->tkr_raw.read = clock->read; in tk_setup_internals()
150 tk->tkr_raw.mask = clock->mask; in tk_setup_internals()
155 tmp <<= clock->shift; in tk_setup_internals()
157 tmp += clock->mult/2; in tk_setup_internals()
158 do_div(tmp, clock->mult); in tk_setup_internals()
166 tk->xtime_interval = (u64) interval * clock->mult; in tk_setup_internals()
168 tk->raw_interval = interval * clock->mult; in tk_setup_internals()
172 int shift_change = clock->shift - old_clock->shift; in tk_setup_internals()
182 tk->tkr_mono.shift = clock->shift; in tk_setup_internals()
183 tk->tkr_raw.shift = clock->shift; in tk_setup_internals()
186 tk->ntp_error_shift = NTP_SCALE_SHIFT - clock->shift; in tk_setup_internals()
194 tk->tkr_mono.mult = clock->mult; in tk_setup_internals()
195 tk->tkr_raw.mult = clock->mult; in tk_setup_internals()
214 cycle_now = tkr->read(tkr->clock); in timekeeping_get_ns()
339 update_vsyscall_old(&xt, &wm, tk->tkr_mono.clock, tk->tkr_mono.mult, in update_vsyscall()
464 struct clocksource *clock = tk->tkr_mono.clock; in timekeeping_forward_now() local
467 cycle_now = tk->tkr_mono.read(clock); in timekeeping_forward_now()
869 old = tk->tkr_mono.clock; in change_clocksource()
893 int timekeeping_notify(struct clocksource *clock) in timekeeping_notify() argument
897 if (tk->tkr_mono.clock == clock) in timekeeping_notify()
899 stop_machine(change_clocksource, clock, NULL); in timekeeping_notify()
901 return tk->tkr_mono.clock == clock ? 0 : -1; in timekeeping_notify()
942 ret = tk->tkr_mono.clock->flags & CLOCK_SOURCE_VALID_FOR_HRES; in timekeeping_valid_for_hres()
961 ret = tk->tkr_mono.clock->max_idle_ns; in timekeeping_max_deferment()
1004 struct clocksource *clock; in timekeeping_init() local
1032 clock = clocksource_default_clock(); in timekeeping_init()
1033 if (clock->enable) in timekeeping_init()
1034 clock->enable(clock); in timekeeping_init()
1035 tk_setup_internals(tk, clock); in timekeeping_init()
1126 struct clocksource *clock = tk->tkr_mono.clock; in timekeeping_resume() local
1154 cycle_now = tk->tkr_mono.read(clock); in timekeeping_resume()
1155 if ((clock->flags & CLOCK_SOURCE_SUSPEND_NONSTOP) && in timekeeping_resume()
1158 u32 mult = clock->mult; in timekeeping_resume()
1159 u32 shift = clock->shift; in timekeeping_resume()
1407 if (unlikely(tk->tkr_mono.clock->maxadj && in timekeeping_adjust()
1408 (abs(tk->tkr_mono.mult - tk->tkr_mono.clock->mult) in timekeeping_adjust()
1409 > tk->tkr_mono.clock->maxadj))) { in timekeeping_adjust()
1412 tk->tkr_mono.clock->name, (long)tk->tkr_mono.mult, in timekeeping_adjust()
1413 (long)tk->tkr_mono.clock->mult + tk->tkr_mono.clock->maxadj); in timekeeping_adjust()
1542 offset = clocksource_delta(tk->tkr_mono.read(tk->tkr_mono.clock), in update_wall_time()