Lines Matching refs:which_clock
31 static int check_clock(const clockid_t which_clock) in check_clock() argument
35 const pid_t pid = CPUCLOCK_PID(which_clock); in check_clock()
37 if (CPUCLOCK_WHICH(which_clock) >= CPUCLOCK_MAX) in check_clock()
45 if (!p || !(CPUCLOCK_PERTHREAD(which_clock) ? in check_clock()
55 timespec_to_sample(const clockid_t which_clock, const struct timespec *tp) in timespec_to_sample() argument
60 if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) { in timespec_to_sample()
68 static void sample_to_timespec(const clockid_t which_clock, in sample_to_timespec() argument
72 if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) in sample_to_timespec()
144 posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *tp) in posix_cpu_clock_getres() argument
146 int error = check_clock(which_clock); in posix_cpu_clock_getres()
150 if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) { in posix_cpu_clock_getres()
163 posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *tp) in posix_cpu_clock_set() argument
169 int error = check_clock(which_clock); in posix_cpu_clock_set()
180 static int cpu_clock_sample(const clockid_t which_clock, struct task_struct *p, in cpu_clock_sample() argument
183 switch (CPUCLOCK_WHICH(which_clock)) { in cpu_clock_sample()
262 static int cpu_clock_sample_group(const clockid_t which_clock, in cpu_clock_sample_group() argument
268 switch (CPUCLOCK_WHICH(which_clock)) { in cpu_clock_sample_group()
288 const clockid_t which_clock, in posix_cpu_clock_get_task() argument
294 if (CPUCLOCK_PERTHREAD(which_clock)) { in posix_cpu_clock_get_task()
296 err = cpu_clock_sample(which_clock, tsk, &rtn); in posix_cpu_clock_get_task()
299 err = cpu_clock_sample_group(which_clock, tsk, &rtn); in posix_cpu_clock_get_task()
303 sample_to_timespec(which_clock, rtn, tp); in posix_cpu_clock_get_task()
309 static int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *tp) in posix_cpu_clock_get() argument
311 const pid_t pid = CPUCLOCK_PID(which_clock); in posix_cpu_clock_get()
319 err = posix_cpu_clock_get_task(current, which_clock, tp); in posix_cpu_clock_get()
329 err = posix_cpu_clock_get_task(p, which_clock, tp); in posix_cpu_clock_get()
562 static int cpu_timer_sample_group(const clockid_t which_clock, in cpu_timer_sample_group() argument
569 switch (CPUCLOCK_WHICH(which_clock)) { in cpu_timer_sample_group()
1295 static int do_cpu_nanosleep(const clockid_t which_clock, int flags, in do_cpu_nanosleep() argument
1306 timer.it_clock = which_clock; in do_cpu_nanosleep()
1346 sample_to_timespec(which_clock, timer.it.cpu.expires, rqtp); in do_cpu_nanosleep()
1382 static int posix_cpu_nsleep(const clockid_t which_clock, int flags, in posix_cpu_nsleep() argument
1392 if (CPUCLOCK_PERTHREAD(which_clock) && in posix_cpu_nsleep()
1393 (CPUCLOCK_PID(which_clock) == 0 || in posix_cpu_nsleep()
1394 CPUCLOCK_PID(which_clock) == current->pid)) in posix_cpu_nsleep()
1397 error = do_cpu_nanosleep(which_clock, flags, rqtp, &it); in posix_cpu_nsleep()
1410 restart_block->nanosleep.clockid = which_clock; in posix_cpu_nsleep()
1419 clockid_t which_clock = restart_block->nanosleep.clockid; in posix_cpu_nsleep_restart() local
1426 error = do_cpu_nanosleep(which_clock, TIMER_ABSTIME, &t, &it); in posix_cpu_nsleep_restart()
1445 static int process_cpu_clock_getres(const clockid_t which_clock, in process_cpu_clock_getres() argument
1450 static int process_cpu_clock_get(const clockid_t which_clock, in process_cpu_clock_get() argument
1460 static int process_cpu_nsleep(const clockid_t which_clock, int flags, in process_cpu_nsleep() argument
1470 static int thread_cpu_clock_getres(const clockid_t which_clock, in thread_cpu_clock_getres() argument
1475 static int thread_cpu_clock_get(const clockid_t which_clock, in thread_cpu_clock_get() argument