This source file contains the implementation of ntp_gettime(), ntp_adjtime(), adjtime(), and _Timecounter_NTP_update_second().
More...
#include <sys/cdefs.h>
#include "opt_ntp.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/time.h>
#include <sys/timex.h>
#include <sys/timetc.h>
#include <sys/timepps.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
|
|
| MTX_SYSINIT (ntp, &ntp_lock, "ntp", MTX_SPIN) |
|
int | sys_ntp_gettime (struct thread *td, struct ntp_gettime_args *uap) |
|
| SYSCTL_NODE (_kern, OID_AUTO, ntp_pll, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "") |
|
| SYSCTL_PROC (_kern_ntp_pll, OID_AUTO, gettime, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, sizeof(struct ntptimeval), ntp_sysctl, "S,ntptimeval", "") |
|
int | kern_ntp_adjtime (struct thread *td, struct timex *ntv, int *retvalp) |
|
int | sys_ntp_adjtime (struct thread *td, struct ntp_adjtime_args *uap) |
|
void | ntp_update_second (int64_t *adjustment, time_t *newsec) |
|
int | sys_adjtime (struct thread *td, struct adjtime_args *uap) |
|
int | kern_adjtime (struct thread *td, struct timeval *delta, struct timeval *olddelta) |
|
| SYSCTL_PROC (_machdep, OID_AUTO, rtc_save_period, CTLTYPE_INT|CTLFLAG_RWTUN|CTLFLAG_MPSAFE, &resettodr_period, 1800, sysctl_resettodr_period, "I", "Save system time to RTC with this period (in seconds)") |
|
| SYSINIT (periodic_resettodr, SI_SUB_LAST, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL) |
|
|
int | time_status = STA_UNSYNC |
|
long | time_esterror = MAXPHASE / 1000 |
This source file contains the implementation of ntp_gettime(), ntp_adjtime(), adjtime(), and _Timecounter_NTP_update_second().
◆ L_ADD
◆ L_ADDHI
Value:((v) += (int64_t)(a) << 32)
◆ L_CLR
◆ L_GINT
Value:((v) < 0 ? -(-(v) >> 32) : (v) >> 32)
◆ L_ISNEG
◆ L_LINT
Value:do { \
if ((a) < 0) \
((v) = -((int64_t)(-(a)) << 32)); \
else \
((v) = (int64_t)(a) << 32); \
} while (0)
◆ L_MPY
◆ L_NEG
◆ L_RSHIFT
| #define L_RSHIFT |
( |
| v, |
|
|
| n ) |
Value:do { \
if ((v) < 0) \
(v) = -(-(v) >> (n)); \
else \
(v) = (v) >> (n); \
} while (0)
◆ L_SUB
◆ NTP_ASSERT_LOCKED
| #define NTP_ASSERT_LOCKED |
( |
| ) |
|
Value:mtx_assert(&ntp_lock, MA_OWNED)
◆ NTP_LOCK
◆ NTP_UNLOCK
Value:mtx_unlock_spin(&ntp_lock)