lkml.org 
[lkml]   [2009]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE
On Fri, 17 Jul 2009, john stultz wrote:
> +static int posix_get_realtime_coarse(clockid_t which_clock, struct timespec *tp)
> +{
> + *tp = current_kernel_time();
> + return 0;
> +}
> +
> +static int posix_get_monotonic_coarse(clockid_t which_clock,
> + struct timespec *tp)
> +{
> + *tp = get_monotonic_coarse();
> + return 0;
> +}
> +
> +int posix_get_coarse_res(const clockid_t which_clock, struct timespec *tp)
> +{
> + *tp = ktime_to_timespec(KTIME_LOW_RES);
> + return 0;
> +}
> /*
> * Initialize everything, well, just everything in Posix clocks/timers ;)
> */
> @@ -255,10 +274,24 @@ static __init int init_posix_timers(void)
> .clock_set = do_posix_clock_nosettime,
> .timer_create = no_timer_create,
> };
> + struct k_clock clock_realtime_coarse = {
> + .clock_getres = hrtimer_get_res,

shouldn't that be posix_get_coarse_res ?

> + .clock_get = posix_get_realtime_coarse,
> + .clock_set = do_posix_clock_nosettime,
> + .timer_create = no_timer_create,
> + };
> + struct k_clock clock_monotonic_coarse = {
> + .clock_getres = hrtimer_get_res,

ditto

> + .clock_get = posix_get_monotonic_coarse,
> + .clock_set = do_posix_clock_nosettime,
> + .timer_create = no_timer_create,
> + };

Looks good otherwise.

tglx


\
 
 \ /
  Last update: 2009-07-18 10:37    [W:0.085 / U:3.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site