diff options
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r-- | kernel/posix-timers.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 6edbb2c55c22..2a2e173d0a7a 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -221,6 +221,11 @@ static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp) | |||
221 | return 0; | 221 | return 0; |
222 | } | 222 | } |
223 | 223 | ||
224 | static int posix_get_tai(clockid_t which_clock, struct timespec *tp) | ||
225 | { | ||
226 | timekeeping_clocktai(tp); | ||
227 | return 0; | ||
228 | } | ||
224 | 229 | ||
225 | /* | 230 | /* |
226 | * Initialize everything, well, just everything in Posix clocks/timers ;) | 231 | * Initialize everything, well, just everything in Posix clocks/timers ;) |
@@ -261,6 +266,16 @@ static __init int init_posix_timers(void) | |||
261 | .clock_getres = posix_get_coarse_res, | 266 | .clock_getres = posix_get_coarse_res, |
262 | .clock_get = posix_get_monotonic_coarse, | 267 | .clock_get = posix_get_monotonic_coarse, |
263 | }; | 268 | }; |
269 | struct k_clock clock_tai = { | ||
270 | .clock_getres = hrtimer_get_res, | ||
271 | .clock_get = posix_get_tai, | ||
272 | .nsleep = common_nsleep, | ||
273 | .nsleep_restart = hrtimer_nanosleep_restart, | ||
274 | .timer_create = common_timer_create, | ||
275 | .timer_set = common_timer_set, | ||
276 | .timer_get = common_timer_get, | ||
277 | .timer_del = common_timer_del, | ||
278 | }; | ||
264 | struct k_clock clock_boottime = { | 279 | struct k_clock clock_boottime = { |
265 | .clock_getres = hrtimer_get_res, | 280 | .clock_getres = hrtimer_get_res, |
266 | .clock_get = posix_get_boottime, | 281 | .clock_get = posix_get_boottime, |
@@ -278,6 +293,7 @@ static __init int init_posix_timers(void) | |||
278 | posix_timers_register_clock(CLOCK_REALTIME_COARSE, &clock_realtime_coarse); | 293 | posix_timers_register_clock(CLOCK_REALTIME_COARSE, &clock_realtime_coarse); |
279 | posix_timers_register_clock(CLOCK_MONOTONIC_COARSE, &clock_monotonic_coarse); | 294 | posix_timers_register_clock(CLOCK_MONOTONIC_COARSE, &clock_monotonic_coarse); |
280 | posix_timers_register_clock(CLOCK_BOOTTIME, &clock_boottime); | 295 | posix_timers_register_clock(CLOCK_BOOTTIME, &clock_boottime); |
296 | posix_timers_register_clock(CLOCK_TAI, &clock_tai); | ||
281 | 297 | ||
282 | posix_timers_cache = kmem_cache_create("posix_timers_cache", | 298 | posix_timers_cache = kmem_cache_create("posix_timers_cache", |
283 | sizeof (struct k_itimer), 0, SLAB_PANIC, | 299 | sizeof (struct k_itimer), 0, SLAB_PANIC, |