[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0907181027510.11571@localhost.localdomain>
Date: Sat, 18 Jul 2009 10:30:18 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: john stultz <johnstul@...ibm.com>
cc: lkml <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...x.de>, Ingo Molnar <mingo@...e.hu>,
Andi Kleen <ak@...e.de>, nikolag@...ibm.com,
Darren Hart <dvhltc@...ibm.com>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists