mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PATCH] ntp: convert time_freq to nsec value
This converts time_freq to a scaled nsec value and adds around 6bit of extra resolution. This pushes the time_freq to its 32bit limits so the calculatons have to be done with 64bit. 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>
This commit is contained in:
parent
97eebe138c
commit
04b617e71e
2 changed files with 24 additions and 14 deletions
|
@ -91,10 +91,12 @@
|
|||
#define SHIFT_SCALE 22 /* phase scale (shift) */
|
||||
#define SHIFT_UPDATE (SHIFT_HZ + 1) /* time offset scale (shift) */
|
||||
#define SHIFT_USEC 16 /* frequency offset scale (shift) */
|
||||
#define SHIFT_NSEC 12 /* kernel frequency offset scale */
|
||||
#define FINENSEC (1L << (SHIFT_SCALE - 10)) /* ~1 ns in phase units */
|
||||
|
||||
#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 NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue