summaryrefslogtreecommitdiffstats
path: root/include/linux/timex.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-10 12:02:45 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-10 12:02:45 -0800
commit58a14ee9c49aa2b9742c56a0477666335368e05e (patch)
tree01dae0e9458eea6289f78bd21cea056798e5c75e /include/linux/timex.h
parent712a30e63c8066ed84385b12edbfb804f49cbc44 (diff)
parentc289b074b66e2e59c65aba73f40b99e797e92d2f (diff)
downloadop-kernel-dev-58a14ee9c49aa2b9742c56a0477666335368e05e.zip
op-kernel-dev-58a14ee9c49aa2b9742c56a0477666335368e05e.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt
* git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt: hrtimer: don't modify restart_block->fn in restart functions hrtimer: fix *rmtp/restarts handling in compat_sys_nanosleep() hrtimer: fix *rmtp handling in hrtimer_nanosleep() ntp: correct inconsistent interval/tick_length usage
Diffstat (limited to 'include/linux/timex.h')
-rw-r--r--include/linux/timex.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 8ea3e71..c3f3747 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -232,7 +232,14 @@ static inline int ntp_synced(void)
#else
#define NTP_INTERVAL_FREQ (HZ)
#endif
-#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ)
+
+#define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE)
+#define CLOCK_TICK_ADJUST (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / \
+ (s64)CLOCK_TICK_RATE)
+
+/* Because using NSEC_PER_SEC would be too easy */
+#define NTP_INTERVAL_LENGTH ((((s64)TICK_USEC * NSEC_PER_USEC * USER_HZ) + \
+ CLOCK_TICK_ADJUST) / NTP_INTERVAL_FREQ)
/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
extern u64 current_tick_length(void);
OpenPOWER on IntegriCloud