Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:logarithmic_accumulation - shifted accumulation of cycles* This functions accumulates a shifted interval of cycles into* into a shifted interval nanoseconds. Allows for O(log) accumulation* loop.* Returns the unconsumed cycles.

Proto:static u64 logarithmic_accumulation(struct timekeeper *tk, u64 offset, unsigned int shift, unsigned int *clock_set)

Type:u64

Parameter:

TypeParameterName
struct timekeeper *tk
u64offset
unsigned intshift
unsigned int *clock_set
2013  interval = The following members are for timekeeping internal use << shift
2017  If offset < interval Then Return offset
2021  offset -= interval
2022  cycle_last += interval
2023  cycle_last += interval
2025  xtime_nsec += xtime_interval << shift
2026  clock_set |= accumulate_nsecs_to_secs - Accumulates nsecs into secs* Helper function that accumulates the nsecs greater than a second* from the xtime_nsec field to the xtime_secs field.* It also calls into the NTP code to handle leapsecond processing.
2029  xtime_nsec += raw_interval << shift
2030  snsec_per_sec = NSEC_PER_SEC << shift
2031  When xtime_nsec >= snsec_per_sec cycle
2032  xtime_nsec -= snsec_per_sec
2033  raw_sec++
2037  Difference between accumulated time and NTP time in ntp* shifted nano seconds. += 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. << shift
2038  Difference between accumulated time and NTP time in ntp* shifted nano seconds. -= xtime_interval + xtime_remainder << ntp_error_shift + shift
2041  Return offset
Caller
NameDescribe
timekeeping_advancemekeeping_advance - Updates the timekeeper to the current time and* current NTP tick length