From 5c6b445de2639be5e056b74d7e6479b02e4923cf Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Fri, 10 May 2013 17:10:42 -0700 Subject: [PATCH] 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 --- include/linux/alarmtimer.h | 1 + kernel/time/alarmtimer.c | 6 ++++++ 2 files changed, 7 insertions(+) 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); +} -- 2.34.1