posix-timers: Add forward/remaining callbacks
authorThomas Gleixner <tglx@linutronix.de>
Tue, 30 May 2017 21:15:49 +0000 (23:15 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 4 Jun 2017 13:40:27 +0000 (15:40 +0200)
Add two callbacks to kclock which allow using common_)timer_get() for both
hrtimer and alarm timer based clocks.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Link: http://lkml.kernel.org/r/20170530211657.044915536@linutronix.de
kernel/time/posix-timers.h

index 1f6f6f9..3bc5b74 100644 (file)
@@ -19,6 +19,8 @@ struct k_clock {
        void    (*timer_get)(struct k_itimer *timr,
                             struct itimerspec64 *cur_setting);
        void    (*timer_rearm)(struct k_itimer *timr);
+       int     (*timer_forward)(struct k_itimer *timr, ktime_t now);
+       ktime_t (*timer_remaining)(struct k_itimer *timr, ktime_t now);
 };
 
 extern const struct k_clock clock_posix_cpu;