aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/posix-timers.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-03-26 04:38:06 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:02 -0500
commit44f21475511bbc0135b52c66ad74dcc6a9026da3 (patch)
tree5cbd605c9d074f40b52a877859957432311b2399 /kernel/posix-timers.c
parent92127c7a45d4d167d9b015a5f9de6b41ed66f1d0 (diff)
[PATCH] hrtimers: pass current time to hrtimer_forward()
Pass current time to hrtimer_forward(). This allows to use the softirq time in the timer base when the forward function is called from the timer callback. Other places pass current time with a call to timer->base->get_time(). Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r--kernel/posix-timers.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 9944379360b5..255657accf02 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -251,15 +251,18 @@ __initcall(init_posix_timers);
251 251
252static void schedule_next_timer(struct k_itimer *timr) 252static void schedule_next_timer(struct k_itimer *timr)
253{ 253{
254 struct hrtimer *timer = &timr->it.real.timer;
255
254 if (timr->it.real.interval.tv64 == 0) 256 if (timr->it.real.interval.tv64 == 0)
255 return; 257 return;
256 258
257 timr->it_overrun += hrtimer_forward(&timr->it.real.timer, 259 timr->it_overrun += hrtimer_forward(timer, timer->base->get_time(),
258 timr->it.real.interval); 260 timr->it.real.interval);
261
259 timr->it_overrun_last = timr->it_overrun; 262 timr->it_overrun_last = timr->it_overrun;
260 timr->it_overrun = -1; 263 timr->it_overrun = -1;
261 ++timr->it_requeue_pending; 264 ++timr->it_requeue_pending;
262 hrtimer_restart(&timr->it.real.timer); 265 hrtimer_restart(timer);
263} 266}
264 267
265/* 268/*
@@ -334,6 +337,7 @@ EXPORT_SYMBOL_GPL(posix_timer_event);
334static int posix_timer_fn(void *data) 337static int posix_timer_fn(void *data)
335{ 338{
336 struct k_itimer *timr = data; 339 struct k_itimer *timr = data;
340 struct hrtimer *timer = &timr->it.real.timer;
337 unsigned long flags; 341 unsigned long flags;
338 int si_private = 0; 342 int si_private = 0;
339 int ret = HRTIMER_NORESTART; 343 int ret = HRTIMER_NORESTART;
@@ -351,7 +355,8 @@ static int posix_timer_fn(void *data)
351 */ 355 */
352 if (timr->it.real.interval.tv64 != 0) { 356 if (timr->it.real.interval.tv64 != 0) {
353 timr->it_overrun += 357 timr->it_overrun +=
354 hrtimer_forward(&timr->it.real.timer, 358 hrtimer_forward(timer,
359 timer->base->softirq_time,
355 timr->it.real.interval); 360 timr->it.real.interval);
356 ret = HRTIMER_RESTART; 361 ret = HRTIMER_RESTART;
357 ++timr->it_requeue_pending; 362 ++timr->it_requeue_pending;
@@ -623,7 +628,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
623 if (timr->it_requeue_pending & REQUEUE_PENDING || 628 if (timr->it_requeue_pending & REQUEUE_PENDING ||
624 (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) { 629 (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) {
625 timr->it_overrun += 630 timr->it_overrun +=
626 hrtimer_forward(timer, timr->it.real.interval); 631 hrtimer_forward(timer, timer->base->get_time(),
632 timr->it.real.interval);
627 remaining = hrtimer_get_remaining(timer); 633 remaining = hrtimer_get_remaining(timer);
628 } 634 }
629 calci: 635 calci: