Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Thomas Gleixner | bab0aae | 2017-05-30 23:15:41 +0200 | [diff] [blame] | 2 | #define TIMER_RETRY 1 |
| 3 | |
| 4 | struct k_clock { |
Thomas Gleixner | 3080294 | 2017-05-30 23:15:45 +0200 | [diff] [blame] | 5 | int (*clock_getres)(const clockid_t which_clock, |
| 6 | struct timespec64 *tp); |
| 7 | int (*clock_set)(const clockid_t which_clock, |
| 8 | const struct timespec64 *tp); |
| 9 | int (*clock_get)(const clockid_t which_clock, |
| 10 | struct timespec64 *tp); |
| 11 | int (*clock_adj)(const clockid_t which_clock, struct timex *tx); |
| 12 | int (*timer_create)(struct k_itimer *timer); |
| 13 | int (*nsleep)(const clockid_t which_clock, int flags, |
Thomas Gleixner | 938e7cf | 2017-06-13 23:34:33 +0200 | [diff] [blame] | 14 | const struct timespec64 *); |
Thomas Gleixner | 3080294 | 2017-05-30 23:15:45 +0200 | [diff] [blame] | 15 | int (*timer_set)(struct k_itimer *timr, int flags, |
| 16 | struct itimerspec64 *new_setting, |
| 17 | struct itimerspec64 *old_setting); |
| 18 | int (*timer_del)(struct k_itimer *timr); |
| 19 | void (*timer_get)(struct k_itimer *timr, |
| 20 | struct itimerspec64 *cur_setting); |
| 21 | void (*timer_rearm)(struct k_itimer *timr); |
Thomas Gleixner | 63841b2 | 2017-05-30 23:15:49 +0200 | [diff] [blame] | 22 | int (*timer_forward)(struct k_itimer *timr, ktime_t now); |
| 23 | ktime_t (*timer_remaining)(struct k_itimer *timr, ktime_t now); |
Thomas Gleixner | 525b8ed | 2017-05-30 23:15:52 +0200 | [diff] [blame] | 24 | int (*timer_try_to_cancel)(struct k_itimer *timr); |
| 25 | void (*timer_arm)(struct k_itimer *timr, ktime_t expires, |
| 26 | bool absolute, bool sigev_none); |
Thomas Gleixner | bab0aae | 2017-05-30 23:15:41 +0200 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | extern const struct k_clock clock_posix_cpu; |
| 30 | extern const struct k_clock clock_posix_dynamic; |
| 31 | extern const struct k_clock clock_process; |
| 32 | extern const struct k_clock clock_thread; |
| 33 | extern const struct k_clock alarm_clock; |
| 34 | |
| 35 | int posix_timer_event(struct k_itimer *timr, int si_private); |
Thomas Gleixner | f2c4580 | 2017-05-30 23:15:59 +0200 | [diff] [blame] | 36 | |
| 37 | void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting); |
| 38 | int common_timer_set(struct k_itimer *timr, int flags, |
| 39 | struct itimerspec64 *new_setting, |
| 40 | struct itimerspec64 *old_setting); |
| 41 | int common_timer_del(struct k_itimer *timer); |