Commit e7561f16 authored by Thomas Gleixner's avatar Thomas Gleixner

alarmtimer: Implement forward callback

Preparatory change to utilize the common posix timer mechanisms.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Link: http://lkml.kernel.org/r/20170530211657.513694229@linutronix.de
parent b3db80f7
...@@ -548,6 +548,18 @@ static void alarm_timer_rearm(struct k_itimer *timr) ...@@ -548,6 +548,18 @@ static void alarm_timer_rearm(struct k_itimer *timr)
alarm_start(alarm, alarm->node.expires); alarm_start(alarm, alarm->node.expires);
} }
/**
* alarm_timer_forward - Posix timer callback for forwarding timer
* @timr: Pointer to the posixtimer data struct
* @now: Current time to forward the timer against
*/
static int alarm_timer_forward(struct k_itimer *timr, ktime_t now)
{
struct alarm *alarm = &timr->it.alarm.alarmtimer;
return (int) alarm_forward(alarm, timr->it_interval, now);
}
/** /**
* alarm_clock_getres - posix getres interface * alarm_clock_getres - posix getres interface
* @which_clock: clockid * @which_clock: clockid
...@@ -876,6 +888,7 @@ const struct k_clock alarm_clock = { ...@@ -876,6 +888,7 @@ const struct k_clock alarm_clock = {
.timer_del = alarm_timer_del, .timer_del = alarm_timer_del,
.timer_get = alarm_timer_get, .timer_get = alarm_timer_get,
.timer_rearm = alarm_timer_rearm, .timer_rearm = alarm_timer_rearm,
.timer_forward = alarm_timer_forward,
.nsleep = alarm_timer_nsleep, .nsleep = alarm_timer_nsleep,
}; };
#endif /* CONFIG_POSIX_TIMERS */ #endif /* CONFIG_POSIX_TIMERS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment