Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234625
b: refs/heads/master
c: 7fdd7f8
h: refs/heads/master
i:
  234623: 647b60f
v: v3
  • Loading branch information
John Stultz committed Feb 21, 2011
1 parent 07f8d4f commit 563ac31
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70a08cca1227dc31c784ec930099a4417a06e7d0
refs/heads/master: 7fdd7f89006dd5a4c702fa0ce0c272345fa44ae0
21 changes: 20 additions & 1 deletion trunk/kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int posix_ktime_get_ts(clockid_t which_clock, struct timespec *tp)
}

/*
* Get monotonic time for posix timers
* Get monotonic-raw time for posix timers
*/
static int posix_get_monotonic_raw(clockid_t which_clock, struct timespec *tp)
{
Expand All @@ -214,6 +214,14 @@ static int posix_get_coarse_res(const clockid_t which_clock, struct timespec *tp
*tp = ktime_to_timespec(KTIME_LOW_RES);
return 0;
}

static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp)
{
get_monotonic_boottime(tp);
return 0;
}


/*
* Initialize everything, well, just everything in Posix clocks/timers ;)
*/
Expand Down Expand Up @@ -253,12 +261,23 @@ static __init int init_posix_timers(void)
.clock_getres = posix_get_coarse_res,
.clock_get = posix_get_monotonic_coarse,
};
struct k_clock clock_boottime = {
.clock_getres = hrtimer_get_res,
.clock_get = posix_get_boottime,
.nsleep = common_nsleep,
.nsleep_restart = hrtimer_nanosleep_restart,
.timer_create = common_timer_create,
.timer_set = common_timer_set,
.timer_get = common_timer_get,
.timer_del = common_timer_del,
};

posix_timers_register_clock(CLOCK_REALTIME, &clock_realtime);
posix_timers_register_clock(CLOCK_MONOTONIC, &clock_monotonic);
posix_timers_register_clock(CLOCK_MONOTONIC_RAW, &clock_monotonic_raw);
posix_timers_register_clock(CLOCK_REALTIME_COARSE, &clock_realtime_coarse);
posix_timers_register_clock(CLOCK_MONOTONIC_COARSE, &clock_monotonic_coarse);
posix_timers_register_clock(CLOCK_BOOTTIME, &clock_boottime);

posix_timers_cache = kmem_cache_create("posix_timers_cache",
sizeof (struct k_itimer), 0, SLAB_PANIC,
Expand Down

0 comments on commit 563ac31

Please sign in to comment.