Re: [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE

From: Thomas Gleixner
Date: Sat Jul 18 2009 - 04:31:33 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/