diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-09 13:06:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-09 13:06:49 -0400 |
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 2091a19f1655..d32ef0ad4c0a 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) | |||
174 | { | 174 | { |
175 | ns += a->tv_nsec; | 175 | ns += a->tv_nsec; |
176 | while(unlikely(ns >= NSEC_PER_SEC)) { | 176 | while(unlikely(ns >= NSEC_PER_SEC)) { |
177 | /* The following asm() prevents the compiler from | ||
178 | * optimising this loop into a modulo operation. */ | ||
179 | asm("" : "+r"(ns)); | ||
180 | |||
177 | ns -= NSEC_PER_SEC; | 181 | ns -= NSEC_PER_SEC; |
178 | a->tv_sec++; | 182 | a->tv_sec++; |
179 | } | 183 | } |
diff --git a/include/linux/timex.h b/include/linux/timex.h index c3f374786a43..8ea3e71ba7fa 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -232,14 +232,7 @@ static inline int ntp_synced(void) | |||
232 | #else | 232 | #else |
233 | #define NTP_INTERVAL_FREQ (HZ) | 233 | #define NTP_INTERVAL_FREQ (HZ) |
234 | #endif | 234 | #endif |
235 | 235 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) | |
236 | #define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE) | ||
237 | #define CLOCK_TICK_ADJUST (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / \ | ||
238 | (s64)CLOCK_TICK_RATE) | ||
239 | |||
240 | /* Because using NSEC_PER_SEC would be too easy */ | ||
241 | #define NTP_INTERVAL_LENGTH ((((s64)TICK_USEC * NSEC_PER_USEC * USER_HZ) + \ | ||
242 | CLOCK_TICK_ADJUST) / NTP_INTERVAL_FREQ) | ||
243 | 236 | ||
244 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 237 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
245 | extern u64 current_tick_length(void); | 238 | extern u64 current_tick_length(void); |