Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:his routine handles the overflow of the microsecond field* The tricky bits of code to handle the accurate clock support* were provided by Dave Mills (Mills@UDEL.EDU) of NTP fame.* They were originally developed for SUN and DEC kernels.

Proto:int second_overflow(time64_t secs)

Type:int

Parameter:

TypeParameterName
time64_tsecs
403  leap = 0
412  Case clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock) == clock synchronized, no leap second
422  Break
423  Case clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock) == sert leap second
424  If Not (clock status bits: & sert leap (rw) ) Then
428  leap = -1
433  Break
434  Case clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock) == delete leap second
435  If Not (clock status bits: & delete leap (rw) ) Then
439  leap = 1
445  Break
446  Case clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock) == leap second in progress
447  second value of the next pending leapsecond, or TIME64_MAX if no leap = Located here for timespec[64]_valid_strict
448  clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock) = leap second has occurred
449  Break
450  Case clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock) == leap second has occurred
451  If Not (clock status bits: & (sert leap (rw) | delete leap (rw) )) Then clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock) = clock synchronized, no leap second
453  Break
458  maximum error (usecs): += max frequency error (ns/s) / NSEC_PER_USEC
459  If maximum error (usecs): > yond max. dispersion Then
460  maximum error (usecs): = yond max. dispersion
461  clock status bits: |= clock unsynchronized (rw)
465  tick_length = tick_length_base
467  delta = ntp_offset_chunk(ime adjustment (nsecs): )
468  ime adjustment (nsecs): -= delta
469  tick_length += delta
472  pps_dec_valid()
474  If Not time_adjust Then Go to out
477  If time_adjust > usecs Then
478  time_adjust -= usecs
479  tick_length += MAX_TICKADJ_SCALED
480  Go to out
483  If time_adjust < -usecs Then
484  time_adjust += usecs
485  tick_length -= MAX_TICKADJ_SCALED
486  Go to out
489  tick_length += time_adjust * NSEC_PER_USEC / NTP_INTERVAL_FREQ << NTP_SCALE_SHIFT
491  time_adjust = 0
493  out :
494  Return leap
Caller
NameDescribe
accumulate_nsecs_to_secsaccumulate_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.