aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-26 19:05:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-26 19:05:42 -0400
commit6671de344cd661453bbee3cfde5574a974332436 (patch)
tree826873ae0180eea53b8fcc6e41938b67c656ba3f /include/linux
parent831576fe40f4175e0767623cffa4aeb28157943a (diff)
parent7c526e1fef8d604a9ec022d9145bba5dbfe40a11 (diff)
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (26 commits) posix timers: fix RLIMIT_CPU && fork() time: ntp: fix bug in ntp_update_offset() & do_adjtimex(), fix time: ntp: clean up second_overflow() time: ntp: simplify ntp_tick_adj calculations time: ntp: make 64-bit constants more robust time: ntp: refactor do_adjtimex() some more time: ntp: refactor do_adjtimex() time: ntp: fix bug in ntp_update_offset() & do_adjtimex() time: ntp: micro-optimize ntp_update_offset() time: ntp: simplify ntp_update_offset_fll() time: ntp: refactor and clean up ntp_update_offset() time: ntp: refactor up ntp_update_frequency() time: ntp: clean up ntp_update_frequency() time: ntp: simplify the MAX_TICKADJ_SCALED definition time: ntp: simplify the second_overflow() code flow time: ntp: clean up kernel/time/ntp.c x86: hpet: stop HPET_COUNTER when programming periodic mode x86: hpet: provide separate functions to stop and start the counter x86: hpet: print HPET registers during setup (if hpet=verbose is used) time: apply NTP frequency/tick changes immediately ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/timer.h22
-rw-r--r--include/linux/timex.h2
2 files changed, 3 insertions, 21 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h
index daf9685b861c..e2d662e3416e 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -86,8 +86,8 @@ static inline int timer_pending(const struct timer_list * timer)
86 86
87extern void add_timer_on(struct timer_list *timer, int cpu); 87extern void add_timer_on(struct timer_list *timer, int cpu);
88extern int del_timer(struct timer_list * timer); 88extern int del_timer(struct timer_list * timer);
89extern int __mod_timer(struct timer_list *timer, unsigned long expires);
90extern int mod_timer(struct timer_list *timer, unsigned long expires); 89extern int mod_timer(struct timer_list *timer, unsigned long expires);
90extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
91 91
92/* 92/*
93 * The jiffies value which is added to now, when there is no timer 93 * The jiffies value which is added to now, when there is no timer
@@ -146,25 +146,7 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer)
146} 146}
147#endif 147#endif
148 148
149/** 149extern void add_timer(struct timer_list *timer);
150 * add_timer - start a timer
151 * @timer: the timer to be added
152 *
153 * The kernel will do a ->function(->data) callback from the
154 * timer interrupt at the ->expires point in the future. The
155 * current time is 'jiffies'.
156 *
157 * The timer's ->expires, ->function (and if the handler uses it, ->data)
158 * fields must be set prior calling this function.
159 *
160 * Timers with an ->expires field in the past will be executed in the next
161 * timer tick.
162 */
163static inline void add_timer(struct timer_list *timer)
164{
165 BUG_ON(timer_pending(timer));
166 __mod_timer(timer, timer->expires);
167}
168 150
169#ifdef CONFIG_SMP 151#ifdef CONFIG_SMP
170 extern int try_to_del_timer_sync(struct timer_list *timer); 152 extern int try_to_del_timer_sync(struct timer_list *timer);
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 998a55d80acf..aa3475fcff64 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -190,7 +190,7 @@ struct timex {
190 * offset and maximum frequency tolerance. 190 * offset and maximum frequency tolerance.
191 */ 191 */
192#define SHIFT_USEC 16 /* frequency offset scale (shift) */ 192#define SHIFT_USEC 16 /* frequency offset scale (shift) */
193#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) 193#define PPM_SCALE ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
194#define PPM_SCALE_INV_SHIFT 19 194#define PPM_SCALE_INV_SHIFT 19
195#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ 195#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
196 PPM_SCALE + 1) 196 PPM_SCALE + 1)