Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932439AbZGRIam (ORCPT ); Sat, 18 Jul 2009 04:30:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753220AbZGRIaj (ORCPT ); Sat, 18 Jul 2009 04:30:39 -0400 Received: from www.tglx.de ([62.245.132.106]:55947 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752403AbZGRIai (ORCPT ); Sat, 18 Jul 2009 04:30:38 -0400 Date: Sat, 18 Jul 2009 10:30:18 +0200 (CEST) From: Thomas Gleixner To: john stultz cc: lkml , Thomas Gleixner , Ingo Molnar , Andi Kleen , nikolag@ca.ibm.com, Darren Hart Subject: Re: [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE In-Reply-To: <1247873945.8334.67.camel@localhost.localdomain> Message-ID: References: <1247873945.8334.67.camel@localhost.localdomain> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1503 Lines: 53 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/