diff options
Diffstat (limited to 'sys/kern/kern_time.c')
| -rw-r--r-- | sys/kern/kern_time.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index c24e9b009ba1..fd8621298614 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -386,78 +386,6 @@ settimeofday(td, uap) } return (error); } - -int tickdelta; /* current clock skew, us. per tick */ -long timedelta; /* unapplied time correction, us. */ -static long bigadj = 1000000; /* use 10x skew above bigadj us. */ - -#ifndef _SYS_SYSPROTO_H_ -struct adjtime_args { - struct timeval *delta; - struct timeval *olddelta; -}; -#endif -/* - * MPSAFE - */ -/* ARGSUSED */ -int -adjtime(td, uap) - struct thread *td; - register struct adjtime_args *uap; -{ - struct timeval atv; - register long ndelta, ntickdelta, odelta; - int s, error; - - mtx_lock(&Giant); - - if ((error = suser(td))) - goto done2; - error = copyin((caddr_t)uap->delta, (caddr_t)&atv, - sizeof(struct timeval)); - if (error) - goto done2; - - /* - * Compute the total correction and the rate at which to apply it. - * Round the adjustment down to a whole multiple of the per-tick - * delta, so that after some number of incremental changes in - * hardclock(), tickdelta will become zero, lest the correction - * overshoot and start taking us away from the desired final time. - */ - ndelta = atv.tv_sec * 1000000 + atv.tv_usec; - if (ndelta > bigadj || ndelta < -bigadj) - ntickdelta = 10 * tickadj; - else - ntickdelta = tickadj; - if (ndelta % ntickdelta) - ndelta = ndelta / ntickdelta * ntickdelta; - - /* - * To make hardclock()'s job easier, make the per-tick delta negative - * if we want time to run slower; then hardclock can simply compute - * tick + tickdelta, and subtract tickdelta from timedelta. - */ - if (ndelta < 0) - ntickdelta = -ntickdelta; - s = splclock(); - odelta = timedelta; - timedelta = ndelta; - tickdelta = ntickdelta; - splx(s); - - if (uap->olddelta) { - atv.tv_sec = odelta / 1000000; - atv.tv_usec = odelta % 1000000; - (void) copyout((caddr_t)&atv, (caddr_t)uap->olddelta, - sizeof(struct timeval)); - } -done2: - mtx_unlock(&Giant); - return (error); -} - /* * Get value of an interval timer. The process virtual and * profiling virtual time timers are kept in the p_stats area, since |
