On Saturday 11 April 2015 18:46:50 Baolin Wang wrote:
> This patch introduces the new methods with timespec64 type for k_clcok structure,
> converts the timepsec type to timespec64 type in k_clock structure and implements
> some callback function.
>
> This patch also converts the timespec type to timespec64 type for timekeeping_clocktai
> function which is used only in the posix-timers.c file.
>
> Next step will migrate all the k_clock users to use the new methods with timespec64 type,
> and it contains the files of mmtimer.c, alarmtimer.c, posix-clock.c and
> posix-cpu-timers.c.
>
> Signed-off-by: Baolin Wang <baolin.wang(a)linaro.org>
The changes in this patch all look good, but as I mentioned, I would
separate the two things you do here:
> struct k_clock {
> int (*clock_getres) (const clockid_t which_clock, struct timespec *tp);
> + int (*clock_getres64) (const clockid_t which_clock,
> + struct timespec64 *tp);
> int (*clock_set) (const clockid_t which_clock,
> const struct timespec *tp);
> + int (*clock_set64) (const clockid_t which_clock,
> + const struct timespec64 *tp);
> int (*clock_get) (const clockid_t which_clock, struct timespec * tp);
> + int (*clock_get64) (const clockid_t which_clock, struct timespec64 *tp);
> int (*clock_adj) (const clockid_t which_clock, struct timex *tx);
> int (*timer_create) (struct k_itimer *timer);
> int (*nsleep) (const clockid_t which_clock, int flags,
a) introducing and using the function pointers
> @@ -278,9 +284,9 @@ static int posix_get_tai(clockid_t which_clock, struct timespec *tp)
> static __init int init_posix_timers(void)
> {
> struct k_clock clock_realtime = {
> - .clock_getres = hrtimer_get_res,
> - .clock_get = posix_clock_realtime_get,
> - .clock_set = posix_clock_realtime_set,
> + .clock_getres64 = hrtimer_get_res64,
> + .clock_get64 = posix_clock_realtime_get,
> + .clock_set64 = posix_clock_realtime_set,
> .clock_adj = posix_clock_realtime_adj,
> .nsleep = common_nsleep,
and b) converting some of the k_clock definitions.
Arnd
On Saturday 11 April 2015 18:46:49 Baolin Wang wrote:
> This patch introduces hrtimer_get_res64() function to get the timer resolution
> with timespec64 type, and moves the hrtimer_get_res() function into
> include/linux/hrtimer.h as a 'static inline' helper that just calls hrtimer_get_res64.
>
> Signed-off-by: Baolin Wang <baolin.wang(a)linaro.org>
>
Looks good.
Arnd