ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / linux / posix-timers.h
1 #ifndef _linux_POSIX_TIMERS_H
2 #define _linux_POSIX_TIMERS_H
3
4 struct k_clock {
5         int res;                /* in nano seconds */
6         int (*clock_set) (struct timespec * tp);
7         int (*clock_get) (struct timespec * tp);
8         int (*nsleep) (int flags,
9                        struct timespec * new_setting,
10                        struct itimerspec * old_setting);
11         int (*timer_set) (struct k_itimer * timr, int flags,
12                           struct itimerspec * new_setting,
13                           struct itimerspec * old_setting);
14         int (*timer_del) (struct k_itimer * timr);
15         void (*timer_get) (struct k_itimer * timr,
16                            struct itimerspec * cur_setting);
17 };
18 struct now_struct {
19         unsigned long jiffies;
20 };
21
22 #define posix_get_now(now) (now)->jiffies = jiffies;
23 #define posix_time_before(timer, now) \
24                       time_before((timer)->expires, (now)->jiffies)
25
26 #define posix_bump_timer(timr) do { \
27                         (timr)->it_timer.expires += (timr)->it_incr; \
28                         (timr)->it_overrun++;               \
29                        }while (0)
30 #endif