Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117597
b: refs/heads/master
c: 63ca243
h: refs/heads/master
i:
  117595: b7d11f0
v: v3
  • Loading branch information
Arjan van de Ven committed Sep 6, 2008
1 parent bcc2932 commit 98f8c3b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ff3e8e85fa6c312051134b3953e397feb639f51
refs/heads/master: 63ca243b271f5b44e0b1057003cf498b6d0fadf7
45 changes: 45 additions & 0 deletions trunk/include/linux/hrtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,45 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer)
return timer->base->cpu_base->hres_active;
}

static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
{
timer->expires = time;
}
static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64)
{
timer->expires.tv64 = tv64;
}

static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
{
timer->expires = ktime_add_safe(timer->expires, time);
}

static inline void hrtimer_add_expires_ns(struct hrtimer *timer, unsigned long ns)
{
timer->expires = ktime_add_ns(timer->expires, ns);
}

static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer)
{
return timer->expires;
}

static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer)
{
return timer->expires.tv64;
}

static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer)
{
return ktime_to_ns(timer->expires);
}

static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer)
{
return ktime_sub(timer->expires, timer->base->get_time());
}

/*
* The resolution of the clocks. The resolution value is returned in
* the clock_getres() system call to give application programmers an
Expand Down Expand Up @@ -287,6 +326,12 @@ extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
extern int hrtimer_cancel(struct hrtimer *timer);
extern int hrtimer_try_to_cancel(struct hrtimer *timer);

static inline int hrtimer_start_expires(struct hrtimer *timer,
enum hrtimer_mode mode)
{
return hrtimer_start(timer, hrtimer_get_expires(timer), mode);
}

static inline int hrtimer_restart(struct hrtimer *timer)
{
return hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS);
Expand Down

0 comments on commit 98f8c3b

Please sign in to comment.