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>
This commit is contained in:
Todd Poynor 2013-05-10 17:10:42 -07:00 committed by Artem Borisov
parent 11e30d5ce1
commit f76497eb33
2 changed files with 7 additions and 0 deletions

View file

@ -50,6 +50,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);
/*
* A alarmtimer is active, when it is enqueued into timerqueue or the

View file

@ -409,6 +409,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);
}