summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-05-10 17:10:42 -0700
committerArve Hjønnevåg <arve@android.com>2013-07-01 14:16:28 -0700
commit5c6b445de2639be5e056b74d7e6479b02e4923cf (patch)
tree7c883669a7fcaefd22990ee3764825cc94fa50dc
parent0ccfc3ce82fbc2b2df5ab11ebfa43f894a6a4ae7 (diff)
downloadolio-linux-3.10-5c6b445de2639be5e056b74d7e6479b02e4923cf.tar.xz
olio-linux-3.10-5c6b445de2639be5e056b74d7e6479b02e4923cf.zip
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 <toddpoynor@google.com>
-rw-r--r--include/linux/alarmtimer.h1
-rw-r--r--kernel/time/alarmtimer.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h
index 65e04ceec27..8e696a105a4 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 059e78b1267..2f125e74d33 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);
+}