diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2008-05-01 07:34:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-01 11:03:58 -0400 |
commit | eea83d896e318bda54be2d2770d2c5d6668d11db (patch) | |
tree | 581f455e02ed3d03e543642b5d54b83dc75d47c7 /include | |
parent | ee9851b218b8bafa22942b5404505ff3d2d34324 (diff) |
ntp: NTP4 user space bits update
This adds a few more things from the ntp nanokernel related to user space.
It's now possible to select the resolution used of some values via STA_NANO
and the kernel reports in which mode it works (pll/fll).
If some values for adjtimex() are outside the acceptable range, they are now
simply normalized instead of letting the syscall fail. I removed
MOD_CLKA/MOD_CLKB as the mapping didn't really makes any sense, the kernel
doesn't support setting the clock.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/timex.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/timex.h b/include/linux/timex.h index 8ea3e71ba7fa..3c49d173bf39 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -58,6 +58,8 @@ | |||
58 | 58 | ||
59 | #include <asm/param.h> | 59 | #include <asm/param.h> |
60 | 60 | ||
61 | #define NTP_API 4 /* NTP API version */ | ||
62 | |||
61 | /* | 63 | /* |
62 | * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen | 64 | * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen |
63 | * for a slightly underdamped convergence characteristic. SHIFT_KH | 65 | * for a slightly underdamped convergence characteristic. SHIFT_KH |
@@ -135,6 +137,8 @@ struct timex { | |||
135 | #define ADJ_ESTERROR 0x0008 /* estimated time error */ | 137 | #define ADJ_ESTERROR 0x0008 /* estimated time error */ |
136 | #define ADJ_STATUS 0x0010 /* clock status */ | 138 | #define ADJ_STATUS 0x0010 /* clock status */ |
137 | #define ADJ_TIMECONST 0x0020 /* pll time constant */ | 139 | #define ADJ_TIMECONST 0x0020 /* pll time constant */ |
140 | #define ADJ_MICRO 0x1000 /* select microsecond resolution */ | ||
141 | #define ADJ_NANO 0x2000 /* select nanosecond resolution */ | ||
138 | #define ADJ_TICK 0x4000 /* tick value */ | 142 | #define ADJ_TICK 0x4000 /* tick value */ |
139 | #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ | 143 | #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ |
140 | #define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ | 144 | #define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ |
@@ -146,8 +150,6 @@ struct timex { | |||
146 | #define MOD_ESTERROR ADJ_ESTERROR | 150 | #define MOD_ESTERROR ADJ_ESTERROR |
147 | #define MOD_STATUS ADJ_STATUS | 151 | #define MOD_STATUS ADJ_STATUS |
148 | #define MOD_TIMECONST ADJ_TIMECONST | 152 | #define MOD_TIMECONST ADJ_TIMECONST |
149 | #define MOD_CLKB ADJ_TICK | ||
150 | #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ | ||
151 | 153 | ||
152 | 154 | ||
153 | /* | 155 | /* |
@@ -169,9 +171,13 @@ struct timex { | |||
169 | #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ | 171 | #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ |
170 | 172 | ||
171 | #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ | 173 | #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ |
174 | #define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ | ||
175 | #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ | ||
176 | #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ | ||
172 | 177 | ||
178 | /* read-only bits */ | ||
173 | #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ | 179 | #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ |
174 | STA_PPSERROR | STA_CLOCKERR) /* read-only bits */ | 180 | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) |
175 | 181 | ||
176 | /* | 182 | /* |
177 | * Clock states (time_state) | 183 | * Clock states (time_state) |