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