From: Todd Poynor Date: Sat, 11 May 2013 00:10:42 +0000 (-0700) Subject: alarmtimer: add alarm_forward_now X-Git-Tag: firefly_0821_release~4090^2~565 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5c6b445de2639be5e056b74d7e6479b02e4923cf;p=firefly-linux-kernel-4.4.55.git alarmtimer: add alarm_forward_now Similar to hrtimer_forward_now, move the expires time forward to an interval from the current time of the associated clock. Change-Id: I73fed223321167507b6eddcb7a57d235ffcfc1be Signed-off-by: Todd Poynor --- diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h index 65e04ceec27d..8e696a105a4d 100644 --- a/include/linux/alarmtimer.h +++ b/include/linux/alarmtimer.h @@ -49,6 +49,7 @@ int alarm_try_to_cancel(struct alarm *alarm); int alarm_cancel(struct alarm *alarm); u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval); +u64 alarm_forward_now(struct alarm *alarm, ktime_t interval); /* Provide way to access the rtc device being used by alarmtimers */ struct rtc_device *alarmtimer_get_rtcdev(void); diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 059e78b12676..2f125e74d33d 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -406,6 +406,12 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval) return overrun; } +u64 alarm_forward_now(struct alarm *alarm, ktime_t interval) +{ + struct alarm_base *base = &alarm_bases[alarm->type]; + + return alarm_forward(alarm, base->gettime(), interval); +}