diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-10-01 02:28:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:27 -0400 |
commit | f19923937321244e7dc334767eb4b67e0e3d5c74 (patch) | |
tree | be82956c645bab0cb13e73677116417d4c5ce311 /include/linux/timex.h | |
parent | 04b617e71e363e640e88be1e43f53fa6a3afef9f (diff) |
[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.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/timex.h b/include/linux/timex.h index 671609ee1a3..ac808f13fa0 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -69,10 +69,9 @@ | |||
69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, | 69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, |
70 | * respectively. | 70 | * respectively. |
71 | */ | 71 | */ |
72 | #define SHIFT_KG 6 /* phase factor (shift) */ | 72 | #define SHIFT_PLL 4 /* PLL frequency factor (shift) */ |
73 | #define SHIFT_KF 16 /* PLL frequency factor (shift) */ | 73 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ |
74 | #define SHIFT_KH 2 /* FLL frequency factor (shift) */ | 74 | #define MAXTC 10 /* maximum time constant (shift) */ |
75 | #define MAXTC 6 /* maximum time constant (shift) */ | ||
76 | 75 | ||
77 | /* | 76 | /* |
78 | * The SHIFT_SCALE define establishes the decimal point of the time_phase | 77 | * The SHIFT_SCALE define establishes the decimal point of the time_phase |
@@ -97,8 +96,8 @@ | |||
97 | #define MAXPHASE 512000L /* max phase error (us) */ | 96 | #define MAXPHASE 512000L /* max phase error (us) */ |
98 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ | 97 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ |
99 | #define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */ | 98 | #define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */ |
100 | #define MINSEC 16L /* min interval between updates (s) */ | 99 | #define MINSEC 256 /* min interval between updates (s) */ |
101 | #define MAXSEC 1200L /* max interval between updates (s) */ | 100 | #define MAXSEC 2048 /* max interval between updates (s) */ |
102 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ | 101 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ |
103 | 102 | ||
104 | /* | 103 | /* |