blob: 10fe17df45a0319398d26d49c032ef1663735166 [file] [log] [blame]
john stultz4c7ee8d2006-09-30 23:28:22 -07001/*
2 * linux/kernel/time/ntp.c
3 *
4 * NTP state machine interfaces and logic.
5 *
6 * This code was mainly moved from kernel/timer.c and kernel/time.c
7 * Please see those files for relevant copyright info and historical
8 * changelogs.
9 */
10
11#include <linux/mm.h>
12#include <linux/time.h>
Thomas Gleixner82644452007-07-21 04:37:37 -070013#include <linux/timer.h>
john stultz4c7ee8d2006-09-30 23:28:22 -070014#include <linux/timex.h>
Alexey Dobriyane8edc6e2007-05-21 01:22:52 +040015#include <linux/jiffies.h>
16#include <linux/hrtimer.h>
Alexey Dobriyanaa0ac362007-07-15 23:40:39 -070017#include <linux/capability.h>
Roman Zippel71abb3a2008-05-01 04:34:26 -070018#include <linux/math64.h>
john stultz4c7ee8d2006-09-30 23:28:22 -070019#include <asm/timex.h>
20
Roman Zippelb0ee7552006-09-30 23:28:22 -070021/*
22 * Timekeeping variables
23 */
24unsigned long tick_usec = TICK_USEC; /* USER_HZ period (usec) */
25unsigned long tick_nsec; /* ACTHZ period (nsec) */
26static u64 tick_length, tick_length_base;
27
Roman Zippel8f807f82006-09-30 23:28:25 -070028#define MAX_TICKADJ 500 /* microsecs */
29#define MAX_TICKADJ_SCALED (((u64)(MAX_TICKADJ * NSEC_PER_USEC) << \
john stultzf4304ab2007-02-16 01:27:26 -080030 TICK_LENGTH_SHIFT) / NTP_INTERVAL_FREQ)
john stultz4c7ee8d2006-09-30 23:28:22 -070031
32/*
33 * phase-lock loop variables
34 */
35/* TIME_ERROR prevents overwriting the CMOS clock */
Adrian Bunk70bc42f2006-09-30 23:28:29 -070036static int time_state = TIME_OK; /* clock synchronization status */
john stultz4c7ee8d2006-09-30 23:28:22 -070037int time_status = STA_UNSYNC; /* clock status bits */
Roman Zippel153b5d02008-05-01 04:34:37 -070038static long time_tai; /* TAI offset (s) */
Roman Zippelee9851b2008-05-01 04:34:32 -070039static s64 time_offset; /* time adjustment (ns) */
Adrian Bunk70bc42f2006-09-30 23:28:29 -070040static long time_constant = 2; /* pll time constant */
john stultz4c7ee8d2006-09-30 23:28:22 -070041long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */
42long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */
Roman Zippel074b3b82008-05-01 04:34:34 -070043static s64 time_freq; /* frequency offset (scaled ns/s)*/
Adrian Bunk70bc42f2006-09-30 23:28:29 -070044static long time_reftime; /* time at last adjustment (s) */
john stultz4c7ee8d2006-09-30 23:28:22 -070045long time_adjust;
Roman Zippel10a398d2008-03-04 15:14:26 -080046static long ntp_tick_adj;
john stultz4c7ee8d2006-09-30 23:28:22 -070047
Adrian Bunk70bc42f2006-09-30 23:28:29 -070048static void ntp_update_frequency(void)
49{
john stultzf4304ab2007-02-16 01:27:26 -080050 u64 second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ)
51 << TICK_LENGTH_SHIFT;
Roman Zippel10a398d2008-03-04 15:14:26 -080052 second_length += (s64)ntp_tick_adj << TICK_LENGTH_SHIFT;
Roman Zippel074b3b82008-05-01 04:34:34 -070053 second_length += time_freq;
Adrian Bunk70bc42f2006-09-30 23:28:29 -070054
john stultzf4304ab2007-02-16 01:27:26 -080055 tick_length_base = second_length;
Adrian Bunk70bc42f2006-09-30 23:28:29 -070056
Roman Zippel71abb3a2008-05-01 04:34:26 -070057 tick_nsec = div_u64(second_length, HZ) >> TICK_LENGTH_SHIFT;
58 tick_length_base = div_u64(tick_length_base, NTP_INTERVAL_FREQ);
Adrian Bunk70bc42f2006-09-30 23:28:29 -070059}
60
Roman Zippelee9851b2008-05-01 04:34:32 -070061static void ntp_update_offset(long offset)
62{
63 long mtemp;
64 s64 freq_adj;
65
66 if (!(time_status & STA_PLL))
67 return;
68
Roman Zippeleea83d82008-05-01 04:34:33 -070069 if (!(time_status & STA_NANO))
Roman Zippel9f14f662008-05-01 04:34:36 -070070 offset *= NSEC_PER_USEC;
Roman Zippelee9851b2008-05-01 04:34:32 -070071
72 /*
73 * Scale the phase adjustment and
74 * clamp to the operating range.
75 */
Roman Zippel9f14f662008-05-01 04:34:36 -070076 offset = min(offset, MAXPHASE);
77 offset = max(offset, -MAXPHASE);
Roman Zippelee9851b2008-05-01 04:34:32 -070078
79 /*
80 * Select how the frequency is to be controlled
81 * and in which mode (PLL or FLL).
82 */
83 if (time_status & STA_FREQHOLD || time_reftime == 0)
84 time_reftime = xtime.tv_sec;
85 mtemp = xtime.tv_sec - time_reftime;
86 time_reftime = xtime.tv_sec;
87
Roman Zippel9f14f662008-05-01 04:34:36 -070088 freq_adj = (s64)offset * mtemp;
Roman Zippel074b3b82008-05-01 04:34:34 -070089 freq_adj <<= TICK_LENGTH_SHIFT - 2 * (SHIFT_PLL + 2 + time_constant);
Roman Zippeleea83d82008-05-01 04:34:33 -070090 time_status &= ~STA_MODE;
91 if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) {
Roman Zippel9f14f662008-05-01 04:34:36 -070092 freq_adj += div_s64((s64)offset << (TICK_LENGTH_SHIFT - SHIFT_FLL),
Roman Zippel074b3b82008-05-01 04:34:34 -070093 mtemp);
Roman Zippeleea83d82008-05-01 04:34:33 -070094 time_status |= STA_MODE;
95 }
Roman Zippelee9851b2008-05-01 04:34:32 -070096 freq_adj += time_freq;
Roman Zippel074b3b82008-05-01 04:34:34 -070097 freq_adj = min(freq_adj, MAXFREQ_SCALED);
98 time_freq = max(freq_adj, -MAXFREQ_SCALED);
Roman Zippel9f14f662008-05-01 04:34:36 -070099
100 time_offset = div_s64((s64)offset << TICK_LENGTH_SHIFT, NTP_INTERVAL_FREQ);
Roman Zippelee9851b2008-05-01 04:34:32 -0700101}
102
Roman Zippelb0ee7552006-09-30 23:28:22 -0700103/**
104 * ntp_clear - Clears the NTP state variables
105 *
106 * Must be called while holding a write on the xtime_lock
107 */
108void ntp_clear(void)
109{
110 time_adjust = 0; /* stop active adjtime() */
111 time_status |= STA_UNSYNC;
112 time_maxerror = NTP_PHASE_LIMIT;
113 time_esterror = NTP_PHASE_LIMIT;
114
115 ntp_update_frequency();
116
117 tick_length = tick_length_base;
Roman Zippel3d3675c2006-09-30 23:28:25 -0700118 time_offset = 0;
Roman Zippelb0ee7552006-09-30 23:28:22 -0700119}
120
john stultz4c7ee8d2006-09-30 23:28:22 -0700121/*
122 * this routine handles the overflow of the microsecond field
123 *
124 * The tricky bits of code to handle the accurate clock support
125 * were provided by Dave Mills (Mills@UDEL.EDU) of NTP fame.
126 * They were originally developed for SUN and DEC kernels.
127 * All the kudos should go to Dave for this stuff.
128 */
129void second_overflow(void)
130{
Roman Zippel9f14f662008-05-01 04:34:36 -0700131 s64 time_adj;
john stultz4c7ee8d2006-09-30 23:28:22 -0700132
133 /* Bump the maxerror field */
Roman Zippel074b3b82008-05-01 04:34:34 -0700134 time_maxerror += MAXFREQ / NSEC_PER_USEC;
john stultz4c7ee8d2006-09-30 23:28:22 -0700135 if (time_maxerror > NTP_PHASE_LIMIT) {
136 time_maxerror = NTP_PHASE_LIMIT;
137 time_status |= STA_UNSYNC;
138 }
139
140 /*
141 * Leap second processing. If in leap-insert state at the end of the
142 * day, the system clock is set back one second; if in leap-delete
143 * state, the system clock is set ahead one second. The microtime()
144 * routine or external clock driver will insure that reported time is
145 * always monotonic. The ugly divides should be replaced.
146 */
147 switch (time_state) {
148 case TIME_OK:
149 if (time_status & STA_INS)
150 time_state = TIME_INS;
151 else if (time_status & STA_DEL)
152 time_state = TIME_DEL;
153 break;
154 case TIME_INS:
155 if (xtime.tv_sec % 86400 == 0) {
156 xtime.tv_sec--;
157 wall_to_monotonic.tv_sec++;
john stultz4c7ee8d2006-09-30 23:28:22 -0700158 time_state = TIME_OOP;
john stultz4c7ee8d2006-09-30 23:28:22 -0700159 printk(KERN_NOTICE "Clock: inserting leap second "
160 "23:59:60 UTC\n");
161 }
162 break;
163 case TIME_DEL:
164 if ((xtime.tv_sec + 1) % 86400 == 0) {
165 xtime.tv_sec++;
Roman Zippel153b5d02008-05-01 04:34:37 -0700166 time_tai--;
john stultz4c7ee8d2006-09-30 23:28:22 -0700167 wall_to_monotonic.tv_sec--;
john stultz4c7ee8d2006-09-30 23:28:22 -0700168 time_state = TIME_WAIT;
john stultz4c7ee8d2006-09-30 23:28:22 -0700169 printk(KERN_NOTICE "Clock: deleting leap second "
170 "23:59:59 UTC\n");
171 }
172 break;
173 case TIME_OOP:
Roman Zippel153b5d02008-05-01 04:34:37 -0700174 time_tai++;
john stultz4c7ee8d2006-09-30 23:28:22 -0700175 time_state = TIME_WAIT;
176 break;
177 case TIME_WAIT:
178 if (!(time_status & (STA_INS | STA_DEL)))
Roman Zippelee9851b2008-05-01 04:34:32 -0700179 time_state = TIME_OK;
john stultz4c7ee8d2006-09-30 23:28:22 -0700180 }
181
182 /*
Roman Zippelf1992392006-09-30 23:28:28 -0700183 * Compute the phase adjustment for the next second. The offset is
184 * reduced by a fixed factor times the time constant.
john stultz4c7ee8d2006-09-30 23:28:22 -0700185 */
Roman Zippelb0ee7552006-09-30 23:28:22 -0700186 tick_length = tick_length_base;
Roman Zippelf1992392006-09-30 23:28:28 -0700187 time_adj = shift_right(time_offset, SHIFT_PLL + time_constant);
Roman Zippel3d3675c2006-09-30 23:28:25 -0700188 time_offset -= time_adj;
Roman Zippel9f14f662008-05-01 04:34:36 -0700189 tick_length += time_adj;
john stultz4c7ee8d2006-09-30 23:28:22 -0700190
Roman Zippel8f807f82006-09-30 23:28:25 -0700191 if (unlikely(time_adjust)) {
192 if (time_adjust > MAX_TICKADJ) {
193 time_adjust -= MAX_TICKADJ;
194 tick_length += MAX_TICKADJ_SCALED;
195 } else if (time_adjust < -MAX_TICKADJ) {
196 time_adjust += MAX_TICKADJ;
197 tick_length -= MAX_TICKADJ_SCALED;
198 } else {
Roman Zippel8f807f82006-09-30 23:28:25 -0700199 tick_length += (s64)(time_adjust * NSEC_PER_USEC /
john stultzf4304ab2007-02-16 01:27:26 -0800200 NTP_INTERVAL_FREQ) << TICK_LENGTH_SHIFT;
Jim Houstonbb1d8602006-10-28 10:38:56 -0700201 time_adjust = 0;
Roman Zippel8f807f82006-09-30 23:28:25 -0700202 }
john stultz4c7ee8d2006-09-30 23:28:22 -0700203 }
204}
205
206/*
207 * Return how long ticks are at the moment, that is, how much time
208 * update_wall_time_one_tick will add to xtime next time we call it
209 * (assuming no calls to do_adjtimex in the meantime).
210 * The return value is in fixed-point nanoseconds shifted by the
211 * specified number of bits to the right of the binary point.
212 * This function has no side-effects.
213 */
214u64 current_tick_length(void)
215{
Roman Zippel8f807f82006-09-30 23:28:25 -0700216 return tick_length;
john stultz4c7ee8d2006-09-30 23:28:22 -0700217}
218
Thomas Gleixner82644452007-07-21 04:37:37 -0700219#ifdef CONFIG_GENERIC_CMOS_UPDATE
john stultz4c7ee8d2006-09-30 23:28:22 -0700220
Thomas Gleixner82644452007-07-21 04:37:37 -0700221/* Disable the cmos update - used by virtualization and embedded */
222int no_sync_cmos_clock __read_mostly;
223
224static void sync_cmos_clock(unsigned long dummy);
225
226static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
227
228static void sync_cmos_clock(unsigned long dummy)
john stultz4c7ee8d2006-09-30 23:28:22 -0700229{
Thomas Gleixner82644452007-07-21 04:37:37 -0700230 struct timespec now, next;
231 int fail = 1;
232
233 /*
234 * If we have an externally synchronized Linux clock, then update
235 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
236 * called as close as possible to 500 ms before the new second starts.
237 * This code is run on a timer. If the clock is set, that timer
238 * may not expire at the correct time. Thus, we adjust...
239 */
240 if (!ntp_synced())
241 /*
242 * Not synced, exit, do not restart a timer (if one is
243 * running, let it run out).
244 */
245 return;
246
247 getnstimeofday(&now);
David P. Reedfa6a1a52007-11-14 17:49:21 -0500248 if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2)
Thomas Gleixner82644452007-07-21 04:37:37 -0700249 fail = update_persistent_clock(now);
250
251 next.tv_nsec = (NSEC_PER_SEC / 2) - now.tv_nsec;
252 if (next.tv_nsec <= 0)
253 next.tv_nsec += NSEC_PER_SEC;
254
255 if (!fail)
256 next.tv_sec = 659;
257 else
258 next.tv_sec = 0;
259
260 if (next.tv_nsec >= NSEC_PER_SEC) {
261 next.tv_sec++;
262 next.tv_nsec -= NSEC_PER_SEC;
263 }
264 mod_timer(&sync_cmos_timer, jiffies + timespec_to_jiffies(&next));
john stultz4c7ee8d2006-09-30 23:28:22 -0700265}
266
Thomas Gleixner82644452007-07-21 04:37:37 -0700267static void notify_cmos_timer(void)
268{
Tony Breeds298a5df2007-09-11 15:24:03 -0700269 if (!no_sync_cmos_clock)
Thomas Gleixner82644452007-07-21 04:37:37 -0700270 mod_timer(&sync_cmos_timer, jiffies + 1);
271}
272
273#else
274static inline void notify_cmos_timer(void) { }
275#endif
276
john stultz4c7ee8d2006-09-30 23:28:22 -0700277/* adjtimex mainly allows reading (and writing, if superuser) of
278 * kernel time-keeping variables. used by xntpd.
279 */
280int do_adjtimex(struct timex *txc)
281{
Roman Zippeleea83d82008-05-01 04:34:33 -0700282 struct timespec ts;
Roman Zippelee9851b2008-05-01 04:34:32 -0700283 long save_adjust;
john stultz4c7ee8d2006-09-30 23:28:22 -0700284 int result;
285
286 /* In order to modify anything, you gotta be super-user! */
287 if (txc->modes && !capable(CAP_SYS_TIME))
288 return -EPERM;
289
290 /* Now we validate the data before disabling interrupts */
291
John Stultz52bfb362007-11-26 20:42:19 +0100292 if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) {
Roman Zippeleea83d82008-05-01 04:34:33 -0700293 /* singleshot must not be used with any other mode bits */
294 if (txc->modes & ~ADJ_OFFSET_SS_READ)
john stultz4c7ee8d2006-09-30 23:28:22 -0700295 return -EINVAL;
John Stultz52bfb362007-11-26 20:42:19 +0100296 }
john stultz4c7ee8d2006-09-30 23:28:22 -0700297
john stultz4c7ee8d2006-09-30 23:28:22 -0700298 /* if the quartz is off by more than 10% something is VERY wrong ! */
299 if (txc->modes & ADJ_TICK)
300 if (txc->tick < 900000/USER_HZ ||
301 txc->tick > 1100000/USER_HZ)
302 return -EINVAL;
303
304 write_seqlock_irq(&xtime_lock);
john stultz4c7ee8d2006-09-30 23:28:22 -0700305
306 /* Save for later - semantics of adjtime is to return old value */
Roman Zippel8f807f82006-09-30 23:28:25 -0700307 save_adjust = time_adjust;
john stultz4c7ee8d2006-09-30 23:28:22 -0700308
john stultz4c7ee8d2006-09-30 23:28:22 -0700309 /* If there are input parameters, then process them */
Roman Zippelee9851b2008-05-01 04:34:32 -0700310 if (txc->modes) {
Roman Zippeleea83d82008-05-01 04:34:33 -0700311 if (txc->modes & ADJ_STATUS) {
312 if ((time_status & STA_PLL) &&
313 !(txc->status & STA_PLL)) {
314 time_state = TIME_OK;
315 time_status = STA_UNSYNC;
316 }
317 /* only set allowed bits */
318 time_status &= STA_RONLY;
319 time_status |= txc->status & ~STA_RONLY;
320 }
321
322 if (txc->modes & ADJ_NANO)
323 time_status |= STA_NANO;
324 if (txc->modes & ADJ_MICRO)
325 time_status &= ~STA_NANO;
john stultz4c7ee8d2006-09-30 23:28:22 -0700326
Roman Zippelee9851b2008-05-01 04:34:32 -0700327 if (txc->modes & ADJ_FREQUENCY) {
Roman Zippel074b3b82008-05-01 04:34:34 -0700328 time_freq = (s64)txc->freq * PPM_SCALE;
329 time_freq = min(time_freq, MAXFREQ_SCALED);
330 time_freq = max(time_freq, -MAXFREQ_SCALED);
john stultz4c7ee8d2006-09-30 23:28:22 -0700331 }
john stultz4c7ee8d2006-09-30 23:28:22 -0700332
Roman Zippeleea83d82008-05-01 04:34:33 -0700333 if (txc->modes & ADJ_MAXERROR)
Roman Zippelee9851b2008-05-01 04:34:32 -0700334 time_maxerror = txc->maxerror;
Roman Zippeleea83d82008-05-01 04:34:33 -0700335 if (txc->modes & ADJ_ESTERROR)
Roman Zippelee9851b2008-05-01 04:34:32 -0700336 time_esterror = txc->esterror;
john stultz4c7ee8d2006-09-30 23:28:22 -0700337
Roman Zippelee9851b2008-05-01 04:34:32 -0700338 if (txc->modes & ADJ_TIMECONST) {
Roman Zippeleea83d82008-05-01 04:34:33 -0700339 time_constant = txc->constant;
340 if (!(time_status & STA_NANO))
341 time_constant += 4;
342 time_constant = min(time_constant, (long)MAXTC);
343 time_constant = max(time_constant, 0l);
john stultz4c7ee8d2006-09-30 23:28:22 -0700344 }
john stultz4c7ee8d2006-09-30 23:28:22 -0700345
Roman Zippel153b5d02008-05-01 04:34:37 -0700346 if (txc->modes & ADJ_TAI && txc->constant > 0)
347 time_tai = txc->constant;
348
Roman Zippelee9851b2008-05-01 04:34:32 -0700349 if (txc->modes & ADJ_OFFSET) {
350 if (txc->modes == ADJ_OFFSET_SINGLESHOT)
351 /* adjtime() is independent from ntp_adjtime() */
352 time_adjust = txc->offset;
353 else
354 ntp_update_offset(txc->offset);
john stultz4c7ee8d2006-09-30 23:28:22 -0700355 }
Roman Zippelee9851b2008-05-01 04:34:32 -0700356 if (txc->modes & ADJ_TICK)
357 tick_usec = txc->tick;
john stultz4c7ee8d2006-09-30 23:28:22 -0700358
Roman Zippelee9851b2008-05-01 04:34:32 -0700359 if (txc->modes & (ADJ_TICK|ADJ_FREQUENCY|ADJ_OFFSET))
360 ntp_update_frequency();
361 }
Roman Zippeleea83d82008-05-01 04:34:33 -0700362
363 result = time_state; /* mostly `TIME_OK' */
Roman Zippelee9851b2008-05-01 04:34:32 -0700364 if (time_status & (STA_UNSYNC|STA_CLOCKERR))
john stultz4c7ee8d2006-09-30 23:28:22 -0700365 result = TIME_ERROR;
366
John Stultz52bfb362007-11-26 20:42:19 +0100367 if ((txc->modes == ADJ_OFFSET_SINGLESHOT) ||
Roman Zippelee9851b2008-05-01 04:34:32 -0700368 (txc->modes == ADJ_OFFSET_SS_READ))
john stultzd62ac212007-03-26 21:32:26 -0800369 txc->offset = save_adjust;
Roman Zippeleea83d82008-05-01 04:34:33 -0700370 else {
Roman Zippel9f14f662008-05-01 04:34:36 -0700371 txc->offset = shift_right(time_offset * NTP_INTERVAL_FREQ,
372 TICK_LENGTH_SHIFT);
Roman Zippeleea83d82008-05-01 04:34:33 -0700373 if (!(time_status & STA_NANO))
374 txc->offset /= NSEC_PER_USEC;
375 }
Roman Zippel074b3b82008-05-01 04:34:34 -0700376 txc->freq = shift_right((s32)(time_freq >> PPM_SCALE_INV_SHIFT) *
377 (s64)PPM_SCALE_INV,
378 TICK_LENGTH_SHIFT);
john stultz4c7ee8d2006-09-30 23:28:22 -0700379 txc->maxerror = time_maxerror;
380 txc->esterror = time_esterror;
381 txc->status = time_status;
382 txc->constant = time_constant;
Adrian Bunk70bc42f2006-09-30 23:28:29 -0700383 txc->precision = 1;
Roman Zippel074b3b82008-05-01 04:34:34 -0700384 txc->tolerance = MAXFREQ_SCALED / PPM_SCALE;
john stultz4c7ee8d2006-09-30 23:28:22 -0700385 txc->tick = tick_usec;
Roman Zippel153b5d02008-05-01 04:34:37 -0700386 txc->tai = time_tai;
john stultz4c7ee8d2006-09-30 23:28:22 -0700387
388 /* PPS is not implemented, so these are zero */
389 txc->ppsfreq = 0;
390 txc->jitter = 0;
391 txc->shift = 0;
392 txc->stabil = 0;
393 txc->jitcnt = 0;
394 txc->calcnt = 0;
395 txc->errcnt = 0;
396 txc->stbcnt = 0;
397 write_sequnlock_irq(&xtime_lock);
Roman Zippelee9851b2008-05-01 04:34:32 -0700398
Roman Zippeleea83d82008-05-01 04:34:33 -0700399 getnstimeofday(&ts);
400 txc->time.tv_sec = ts.tv_sec;
401 txc->time.tv_usec = ts.tv_nsec;
402 if (!(time_status & STA_NANO))
403 txc->time.tv_usec /= NSEC_PER_USEC;
Roman Zippelee9851b2008-05-01 04:34:32 -0700404
Thomas Gleixner82644452007-07-21 04:37:37 -0700405 notify_cmos_timer();
Roman Zippelee9851b2008-05-01 04:34:32 -0700406
407 return result;
john stultz4c7ee8d2006-09-30 23:28:22 -0700408}
Roman Zippel10a398d2008-03-04 15:14:26 -0800409
410static int __init ntp_tick_adj_setup(char *str)
411{
412 ntp_tick_adj = simple_strtol(str, NULL, 0);
413 return 1;
414}
415
416__setup("ntp_tick_adj=", ntp_tick_adj_setup);