^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #define TIMER_RETRY 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) struct k_clock {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) int (*clock_getres)(const clockid_t which_clock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) struct timespec64 *tp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) int (*clock_set)(const clockid_t which_clock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) const struct timespec64 *tp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) /* Returns the clock value in the current time namespace. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) int (*clock_get_timespec)(const clockid_t which_clock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) struct timespec64 *tp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /* Returns the clock value in the root time namespace. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) ktime_t (*clock_get_ktime)(const clockid_t which_clock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) int (*clock_adj)(const clockid_t which_clock, struct __kernel_timex *tx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) int (*timer_create)(struct k_itimer *timer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) int (*nsleep)(const clockid_t which_clock, int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) const struct timespec64 *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) int (*timer_set)(struct k_itimer *timr, int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct itimerspec64 *new_setting,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct itimerspec64 *old_setting);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) int (*timer_del)(struct k_itimer *timr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) void (*timer_get)(struct k_itimer *timr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct itimerspec64 *cur_setting);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) void (*timer_rearm)(struct k_itimer *timr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) s64 (*timer_forward)(struct k_itimer *timr, ktime_t now);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) ktime_t (*timer_remaining)(struct k_itimer *timr, ktime_t now);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) int (*timer_try_to_cancel)(struct k_itimer *timr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) void (*timer_arm)(struct k_itimer *timr, ktime_t expires,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) bool absolute, bool sigev_none);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) void (*timer_wait_running)(struct k_itimer *timr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) extern const struct k_clock clock_posix_cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) extern const struct k_clock clock_posix_dynamic;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) extern const struct k_clock clock_process;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) extern const struct k_clock clock_thread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) extern const struct k_clock alarm_clock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) int posix_timer_event(struct k_itimer *timr, int si_private);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) int common_timer_set(struct k_itimer *timr, int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct itimerspec64 *new_setting,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct itimerspec64 *old_setting);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) int common_timer_del(struct k_itimer *timer);