diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-09 10:06:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-09 10:06:49 -0700 |
commit | bf5a25e1fff88a1066e20cc7263329405e4939f6 (patch) | |
tree | 95822dc50801e21cf1ad1e6aa7b58af898156517 /include | |
parent | 83f7a2c118833d3738b4d162ea3c17d0bd8ffa94 (diff) | |
parent | 10a398d04c4a1fc395840f4d040493375f562302 (diff) |
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:
time: remove obsolete CLOCK_TICK_ADJUST
time: don't touch an offlined CPU's ts->tick_stopped in tick_cancel_sched_timer()
time: prevent the loop in timespec_add_ns() from being optimised away
ntp: use unsigned input for do_div()
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/time.h | 4 | ||||
-rw-r--r-- | include/linux/timex.h | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/include/linux/time.h b/include/linux/time.h index 2091a19f165..d32ef0ad4c0 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -174,6 +174,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns) { ns += a->tv_nsec; while(unlikely(ns >= NSEC_PER_SEC)) { + /* The following asm() prevents the compiler from + * optimising this loop into a modulo operation. */ + asm("" : "+r"(ns)); + ns -= NSEC_PER_SEC; a->tv_sec++; } diff --git a/include/linux/timex.h b/include/linux/timex.h index c3f374786a4..8ea3e71ba7f 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -232,14 +232,7 @@ static inline int ntp_synced(void) #else #define NTP_INTERVAL_FREQ (HZ) #endif - -#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) +#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ extern u64 current_tick_length(void); |