aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/timex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/timex.h')
-rw-r--r--include/linux/timex.h43
1 files changed, 2 insertions, 41 deletions
diff --git a/include/linux/timex.h b/include/linux/timex.h
index b7ca1204e42a..03914b7e41b1 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -97,38 +97,11 @@
97 97
98#define MAXPHASE 512000L /* max phase error (us) */ 98#define MAXPHASE 512000L /* max phase error (us) */
99#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ 99#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */
100#define MAXTIME (200L << PPS_AVG) /* max PPS error (jitter) (200 us) */
101#define MINSEC 16L /* min interval between updates (s) */ 100#define MINSEC 16L /* min interval between updates (s) */
102#define MAXSEC 1200L /* max interval between updates (s) */ 101#define MAXSEC 1200L /* max interval between updates (s) */
103#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ 102#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
104 103
105/* 104/*
106 * The following defines are used only if a pulse-per-second (PPS)
107 * signal is available and connected via a modem control lead, such as
108 * produced by the optional ppsclock feature incorporated in the Sun
109 * asynch driver. They establish the design parameters of the frequency-
110 * lock loop used to discipline the CPU clock oscillator to the PPS
111 * signal.
112 *
113 * PPS_AVG is the averaging factor for the frequency loop, as well as
114 * the time and frequency dispersion.
115 *
116 * PPS_SHIFT and PPS_SHIFTMAX specify the minimum and maximum
117 * calibration intervals, respectively, in seconds as a power of two.
118 *
119 * PPS_VALID is the maximum interval before the PPS signal is considered
120 * invalid and protocol updates used directly instead.
121 *
122 * MAXGLITCH is the maximum interval before a time offset of more than
123 * MAXTIME is believed.
124 */
125#define PPS_AVG 2 /* pps averaging constant (shift) */
126#define PPS_SHIFT 2 /* min interval duration (s) (shift) */
127#define PPS_SHIFTMAX 8 /* max interval duration (s) (shift) */
128#define PPS_VALID 120 /* pps signal watchdog max (s) */
129#define MAXGLITCH 30 /* pps signal glitch max (s) */
130
131/*
132 * syscall interface - used (mainly by NTP daemon) 105 * syscall interface - used (mainly by NTP daemon)
133 * to discipline kernel clock oscillator 106 * to discipline kernel clock oscillator
134 */ 107 */
@@ -246,20 +219,6 @@ extern long time_reftime; /* time at last adjustment (s) */
246extern long time_adjust; /* The amount of adjtime left */ 219extern long time_adjust; /* The amount of adjtime left */
247extern long time_next_adjust; /* Value for time_adjust at next tick */ 220extern long time_next_adjust; /* Value for time_adjust at next tick */
248 221
249/* interface variables pps->timer interrupt */
250extern long pps_offset; /* pps time offset (us) */
251extern long pps_jitter; /* time dispersion (jitter) (us) */
252extern long pps_freq; /* frequency offset (scaled ppm) */
253extern long pps_stabil; /* frequency dispersion (scaled ppm) */
254extern long pps_valid; /* pps signal watchdog counter */
255
256/* interface variables pps->adjtimex */
257extern int pps_shift; /* interval duration (s) (shift) */
258extern long pps_jitcnt; /* jitter limit exceeded */
259extern long pps_calcnt; /* calibration intervals */
260extern long pps_errcnt; /* calibration errors */
261extern long pps_stbcnt; /* stability limit exceeded */
262
263/** 222/**
264 * ntp_clear - Clears the NTP state variables 223 * ntp_clear - Clears the NTP state variables
265 * 224 *
@@ -348,6 +307,8 @@ time_interpolator_reset(void)
348/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ 307/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
349extern u64 current_tick_length(void); 308extern u64 current_tick_length(void);
350 309
310extern int do_adjtimex(struct timex *);
311
351#endif /* KERNEL */ 312#endif /* KERNEL */
352 313
353#endif /* LINUX_TIMEX_H */ 314#endif /* LINUX_TIMEX_H */