Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\timekeeping.c Create Date:2022-07-28 10:41:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:k_setup_internals - Set up internals to use clocksource clock

Proto:static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)

Type:void

Parameter:

TypeParameterName
struct timekeeper *tk
struct clocksource *clock
293  ++cs_was_changed_seq
294  old_clock = clock
295  clock = clock
296  mask = mask
297  cycle_last = k_clock_read - atomic clocksource read() helper* This helper is necessary to use in the read paths because, while the* seqlock ensures we don't return a bad value while structures are updated,* it doesn't protect from potential crashes
299  clock = clock
300  mask = mask
301  cycle_last = cycle_last
304  tmp = NTP_INTERVAL_LENGTH
305  tmp <<= shift
306  ntpinterval = tmp
307  tmp += mult / 2
308  do_div() is NOT a C function(tmp, mult)
309  If tmp == 0 Then tmp = 1
312  interval = tmp
313  The following members are for timekeeping internal use = interval
316  xtime_interval = interval * mult
317  xtime_remainder = ntpinterval - xtime_interval
318  raw_interval = interval * mult
321  If old_clock Then
322  shift_change = shift - shift
323  If shift_change < 0 Then
326  Else
332  shift = shift
333  shift = shift
335  Difference between accumulated time and NTP time in ntp* shifted nano seconds. = 0
336  ntp_error_shift = NTP_SCALE_SHIFT - shift
337  The ntp_tick_length() value currently being used.* This cached copy ensures we consistently apply the tick* length for an entire tick, as ntp_tick_length may change* mid-tick, and we don't want to apply that new value to* the tick in progress. = ntpinterval << ntp_error_shift
344  mult = mult
345  mult = mult
346  ntp_err_mult = 0
347  Flag used to avoid updating NTP twice with same second = 0
Caller
NameDescribe
change_clocksourcehange_clocksource - Swaps clocksources if a new one is available* Accumulates current time interval and initializes new clocksource
timekeeping_initmekeeping_init - Initializes the clocksource and common timekeeping values