summaryrefslogtreecommitdiffstats
path: root/include/linux/timex.h
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-09-30 23:28:28 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 00:39:27 -0700
commitf19923937321244e7dc334767eb4b67e0e3d5c74 (patch)
treebe82956c645bab0cb13e73677116417d4c5ce311 /include/linux/timex.h
parent04b617e71e363e640e88be1e43f53fa6a3afef9f (diff)
downloadop-kernel-dev-f19923937321244e7dc334767eb4b67e0e3d5c74.zip
op-kernel-dev-f19923937321244e7dc334767eb4b67e0e3d5c74.tar.gz
[PATCH] ntp: convert to the NTP4 reference model
This converts the kernel ntp model into a model which matches the nanokernel reference implementations. The previous patches already increased the resolution and precision of the computations, so that this conversion becomes quite simple. <linux@horizon.com> explains: The original NTP kernel interface was defined in units of microseconds. That's what Linux implements. As computers have gotten faster and can now split microseconds easily, a new kernel interface using nanosecond units was defined ("the nanokernel", confusing as that name is to OS hackers), and there's an STA_NANO bit in the adjtimex() status field to tell the application which units it's using. The current ntpd supports both, but Linux loses some possible timing resolution because of quantization effects, and the ntpd hackers would really like to be able to drop the backwards compatibility code. Ulrich Windl has been maintaining a patch set to do the conversion for years, but it's hard to keep in sync. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Cc: john stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/timex.h')
-rw-r--r--include/linux/timex.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 671609e..ac808f1 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -69,10 +69,9 @@
* zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
* respectively.
*/
-#define SHIFT_KG 6 /* phase factor (shift) */
-#define SHIFT_KF 16 /* PLL frequency factor (shift) */
-#define SHIFT_KH 2 /* FLL frequency factor (shift) */
-#define MAXTC 6 /* maximum time constant (shift) */
+#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
+#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
+#define MAXTC 10 /* maximum time constant (shift) */
/*
* The SHIFT_SCALE define establishes the decimal point of the time_phase
@@ -97,8 +96,8 @@
#define MAXPHASE 512000L /* max phase error (us) */
#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */
#define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */
-#define MINSEC 16L /* min interval between updates (s) */
-#define MAXSEC 1200L /* max interval between updates (s) */
+#define MINSEC 256 /* min interval between updates (s) */
+#define MAXSEC 2048 /* max interval between updates (s) */
#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
/*
OpenPOWER on IntegriCloud