OSDN Git Service

alarmtimer: add alarm_forward_now
authorTodd Poynor <toddpoynor@google.com>
Sat, 11 May 2013 00:10:42 +0000 (17:10 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 21:16:28 +0000 (14:16 -0700)
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>
include/linux/alarmtimer.h
kernel/time/alarmtimer.c

index 65e04ce..8e696a1 100644 (file)
@@ -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);
index 059e78b..2f125e7 100644 (file)
@@ -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);
+}