Lines Matching defs:ntv
238 ntp_gettime(struct ntptimeval *ntv)
240 memset(ntv, 0, sizeof(*ntv));
243 nanotime(&ntv->time);
244 ntv->maxerror = time_maxerror;
245 ntv->esterror = time_esterror;
246 ntv->tai = time_tai;
247 ntv->time_state = time_state;
261 struct timex ntv;
264 error = copyin((void *)SCARG(uap, tp), (void *)&ntv, sizeof(ntv));
268 if (ntv.modes != 0 && (error = kauth_authorize_system(l->l_cred,
273 ntp_adjtime1(&ntv);
275 error = copyout((void *)&ntv, (void *)SCARG(uap, tp), sizeof(ntv));
283 ntp_adjtime1(struct timex *ntv)
293 * from the ntv.constant member, depending on the mode bits. If
298 modes = ntv->modes;
303 time_maxerror = ntv->maxerror;
305 time_esterror = ntv->esterror;
307 if (time_status & STA_PLL && !(ntv->status & STA_PLL)) {
315 time_status |= ntv->status & ~STA_RONLY;
318 if (ntv->constant < 0)
320 else if (ntv->constant > MAXTC)
323 time_constant = ntv->constant;
326 if (ntv->constant > 0) /* XXX zero & negative numbers ? */
327 time_tai = ntv->constant;
331 if (ntv->shift < PPS_FAVG)
333 else if (ntv->shift > PPS_FAVGMAX)
336 pps_shiftmax = ntv->shift;
348 freq = MIN(INT32_MAX, MAX(INT32_MIN, ntv->freq));
356 * ntv.freq is [PPM * 2^16] = [us/s * 2^16]
359 time_freq = ntv->freq * 1000LL * 65536LL;
367 hardupdate(ntv->offset);
369 long offset = ntv->offset;
381 ntv->offset = L_GINT(time_offset);
383 ntv->offset = L_GINT(time_offset) / 1000; /* XXX rounding ? */
385 ntv->freq = L_GINT(-((-time_freq / 1000LL) << 16));
387 ntv->freq = L_GINT((time_freq / 1000LL) << 16);
388 ntv->maxerror = time_maxerror;
389 ntv->esterror = time_esterror;
390 ntv->status = time_status;
391 ntv->constant = time_constant;
393 ntv->precision = time_precision;
395 ntv->precision = time_precision / 1000;
396 ntv->tolerance = MAXFREQ * SCALE_PPM;
398 ntv->shift = pps_shift;
399 ntv->ppsfreq = L_GINT((pps_freq / 1000LL) << 16);
401 ntv->jitter = pps_jitter;
403 ntv->jitter = pps_jitter / 1000;
404 ntv->stabil = pps_stabil;
405 ntv->calcnt = pps_calcnt;
406 ntv->errcnt = pps_errcnt;
407 ntv->jitcnt = pps_jitcnt;
408 ntv->stbcnt = pps_stbcnt;
943 struct ntptimeval ntv;
947 ntp_gettime(&ntv);
949 error = copyout((void *)&ntv, (void *)SCARG(uap, ntvp),
950 sizeof(ntv));
965 struct ntptimeval ntv;
967 ntp_gettime(&ntv);
970 node.sysctl_data = &ntv;
971 node.sysctl_size = sizeof(ntv);