On Saturday 11 April 2015 18:46:52 Baolin Wang wrote:
This patch introduces the new methods with timespec64 type of k_clock structure, and converts the timespec type to timespec64 type in alarmtimer.c
Signed-off-by: Baolin Wang baolin.wang@linaro.org
kernel/time/alarmtimer.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
Looks good.
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 1b001ed..7aefb7f 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -489,35 +489,36 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm, /**
- alarm_clock_getres - posix getres interface
- @which_clock: clockid
- @tp: timespec to fill
*/
- @tp: timespec64 to fill
- Returns the granularity of underlying alarm base clock
-static int alarm_clock_getres(const clockid_t which_clock, struct timespec *tp) +static int alarm_clock_getres(const clockid_t which_clock,
struct timespec64 *tp)
{ clockid_t baseid = alarm_bases[clock2alarm(which_clock)].base_clockid; if (!alarmtimer_get_rtcdev()) return -EINVAL;
- return hrtimer_get_res(baseid, tp);
- return hrtimer_get_res64(baseid, tp);
} /**
- alarm_clock_get - posix clock_get interface
- @which_clock: clockid
- @tp: timespec to fill.
*/
- @tp: timespec64 to fill.
- Provides the underlying alarm base time.
-static int alarm_clock_get(clockid_t which_clock, struct timespec *tp) +static int alarm_clock_get(clockid_t which_clock, struct timespec64 *tp) { struct alarm_base *base = &alarm_bases[clock2alarm(which_clock)]; if (!alarmtimer_get_rtcdev()) return -EINVAL;
- *tp = ktime_to_timespec(base->gettime());
- *tp = ktime_to_timespec64(base->gettime()); return 0;
} @@ -670,7 +671,7 @@ static int alarmtimer_do_nsleep(struct alarm *alarm, ktime_t absexp) /**
- update_rmtp - Update remaining timespec value
- update_rmtp - Update remaining timespec64 value
- @exp: expiration time
- @type: timer type
- @rmtp: user pointer to remaining timepsec value
@@ -824,8 +825,8 @@ static int __init alarmtimer_init(void) int error = 0; int i; struct k_clock alarm_clock = {
.clock_getres = alarm_clock_getres,
.clock_get = alarm_clock_get,
.clock_getres64 = alarm_clock_getres,
.timer_create = alarm_timer_create, .timer_set = alarm_timer_set, .timer_del = alarm_timer_del,.clock_get64 = alarm_clock_get,