xref: /linux/kernel/time/posix-timers.h (revision bab0aae9dcba9466dcc968b8bd21914f8f691631)
1*bab0aae9SThomas Gleixner #define TIMER_RETRY 1
2*bab0aae9SThomas Gleixner 
3*bab0aae9SThomas Gleixner struct k_clock {
4*bab0aae9SThomas Gleixner 	int (*clock_getres) (const clockid_t which_clock, struct timespec64 *tp);
5*bab0aae9SThomas Gleixner 	int (*clock_set) (const clockid_t which_clock,
6*bab0aae9SThomas Gleixner 			  const struct timespec64 *tp);
7*bab0aae9SThomas Gleixner 	int (*clock_get) (const clockid_t which_clock, struct timespec64 *tp);
8*bab0aae9SThomas Gleixner 	int (*clock_adj) (const clockid_t which_clock, struct timex *tx);
9*bab0aae9SThomas Gleixner 	int (*timer_create) (struct k_itimer *timer);
10*bab0aae9SThomas Gleixner 	int (*nsleep) (const clockid_t which_clock, int flags,
11*bab0aae9SThomas Gleixner 		       struct timespec64 *, struct timespec __user *);
12*bab0aae9SThomas Gleixner 	long (*nsleep_restart) (struct restart_block *restart_block);
13*bab0aae9SThomas Gleixner 	int (*timer_set) (struct k_itimer *timr, int flags,
14*bab0aae9SThomas Gleixner 			  struct itimerspec64 *new_setting,
15*bab0aae9SThomas Gleixner 			  struct itimerspec64 *old_setting);
16*bab0aae9SThomas Gleixner 	int (*timer_del) (struct k_itimer *timr);
17*bab0aae9SThomas Gleixner 	void (*timer_get) (struct k_itimer *timr,
18*bab0aae9SThomas Gleixner 			   struct itimerspec64 *cur_setting);
19*bab0aae9SThomas Gleixner };
20*bab0aae9SThomas Gleixner 
21*bab0aae9SThomas Gleixner extern const struct k_clock clock_posix_cpu;
22*bab0aae9SThomas Gleixner extern const struct k_clock clock_posix_dynamic;
23*bab0aae9SThomas Gleixner extern const struct k_clock clock_process;
24*bab0aae9SThomas Gleixner extern const struct k_clock clock_thread;
25*bab0aae9SThomas Gleixner extern const struct k_clock alarm_clock;
26*bab0aae9SThomas Gleixner 
27*bab0aae9SThomas Gleixner int posix_timer_event(struct k_itimer *timr, int si_private);
28*bab0aae9SThomas Gleixner 
29*bab0aae9SThomas Gleixner void posix_cpu_timer_schedule(struct k_itimer *timer);
30