diff options
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r-- | kernel/time/ntp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index d4bca927f715..5fd9b9469770 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -42,12 +42,13 @@ long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ | |||
42 | long time_freq; /* frequency offset (scaled ppm)*/ | 42 | long time_freq; /* frequency offset (scaled ppm)*/ |
43 | static long time_reftime; /* time at last adjustment (s) */ | 43 | static long time_reftime; /* time at last adjustment (s) */ |
44 | long time_adjust; | 44 | long time_adjust; |
45 | static long ntp_tick_adj; | ||
45 | 46 | ||
46 | static void ntp_update_frequency(void) | 47 | static void ntp_update_frequency(void) |
47 | { | 48 | { |
48 | u64 second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ) | 49 | u64 second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ) |
49 | << TICK_LENGTH_SHIFT; | 50 | << TICK_LENGTH_SHIFT; |
50 | second_length += (s64)CLOCK_TICK_ADJUST << TICK_LENGTH_SHIFT; | 51 | second_length += (s64)ntp_tick_adj << TICK_LENGTH_SHIFT; |
51 | second_length += (s64)time_freq << (TICK_LENGTH_SHIFT - SHIFT_NSEC); | 52 | second_length += (s64)time_freq << (TICK_LENGTH_SHIFT - SHIFT_NSEC); |
52 | 53 | ||
53 | tick_length_base = second_length; | 54 | tick_length_base = second_length; |
@@ -402,3 +403,11 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0) | |||
402 | notify_cmos_timer(); | 403 | notify_cmos_timer(); |
403 | return(result); | 404 | return(result); |
404 | } | 405 | } |
406 | |||
407 | static int __init ntp_tick_adj_setup(char *str) | ||
408 | { | ||
409 | ntp_tick_adj = simple_strtol(str, NULL, 0); | ||
410 | return 1; | ||
411 | } | ||
412 | |||
413 | __setup("ntp_tick_adj=", ntp_tick_adj_setup); | ||