Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:adjtimex mainly allows reading (and writing, if superuser) of* kernel time-keeping variables. used by xntpd.

Proto:int __do_adjtimex(struct __kernel_timex *txc, const struct timespec64 *ts, s32 *time_tai, struct audit_ntp_data *ad)

Type:int

Parameter:

TypeParameterName
struct __kernel_timex *txc
const struct timespec64 *ts
s32 *time_tai
struct audit_ntp_data *ad
719  If mode selector & switch between adjtime/adjtimex modes Then
720  save_adjust = time_adjust
722  If Not ( mode selector & ad-only adjtime ) Then
730  time offset (usec) = save_adjust
731  Else
733  If mode selector Then
749  time offset (usec) = Required to safely shift negative values (ime adjustment (nsecs): * NTP_INTERVAL_FREQ, NTP_SCALE_SHIFT)
751  If Not (clock status bits: & solution (0 = us, 1 = ns) (ro) ) Then time offset (usec) = time offset (usec) / NSEC_PER_USEC
755  result = clock synchronization status* (TIME_ERROR prevents overwriting the CMOS clock)
757  If is_error_status(clock status bits: ) Then result = clock not synchronized
760  frequency offset (scaled ppm) = Required to safely shift negative values ((quency offset (scaled nsecs/secs): >> PPM_SCALE_INV_SHIFT) * PPM_SCALE_INV, NTP_SCALE_SHIFT)
762  maximum error (usec) = maximum error (usecs):
763  estimated error (usec) = stimated error (usecs):
764  clock command/status = clock status bits:
765  pll time constant = pll time constant:
766  clock precision (usec) (read only) = 1
767  clock frequency tolerance (ppm) * (read only) = MAXFREQ_SCALED / PPM_SCALE
768  (modified) usecs between clock ticks = USER_HZ period (usecs):
769  TAI offset (ro) = time_tai
772  pps_fill_timex(txc)
774  tv_sec = seconds
775  tv_usec = nanoseconds
776  If Not (clock status bits: & solution (0 = us, 1 = ns) (ro) ) Then tv_usec = nanoseconds / NSEC_PER_USEC
780  If Value for the false possibility is greater at compile time( seconds >= second value of the next pending leapsecond, or TIME64_MAX if no leap ) Then
784  tv_sec--
789  tv_sec++
797  Return result