Index: head/sys/compat/linuxkpi/common/include/linux/sched.h =================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h +++ head/sys/compat/linuxkpi/common/include/linux/sched.h @@ -36,14 +36,16 @@ #include #include #include +#include +#include #include #include +#include #include #include -#include #include -#include +#include #include @@ -149,5 +151,14 @@ #define io_schedule() schedule() #define io_schedule_timeout(timeout) schedule_timeout(timeout) + +static inline uint64_t +local_clock(void) +{ + struct timespec ts; + + nanotime(&ts); + return ((uint64_t)ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec); +} #endif /* _LINUX_SCHED_H_ */ Index: head/sys/compat/linuxkpi/common/include/linux/timer.h =================================================================== --- head/sys/compat/linuxkpi/common/include/linux/timer.h +++ head/sys/compat/linuxkpi/common/include/linux/timer.h @@ -46,15 +46,20 @@ extern unsigned long linux_timer_hz_mask; -#define setup_timer(timer, func, dat) \ -do { \ +#define TIMER_IRQSAFE 0x0001 + +#define setup_timer(timer, func, dat) do { \ (timer)->function = (func); \ (timer)->data = (dat); \ callout_init(&(timer)->timer_callout, 1); \ } while (0) -#define init_timer(timer) \ -do { \ +#define __setup_timer(timer, func, dat, flags) do { \ + CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0); \ + setup_timer(timer, func, dat); \ +} while (0) + +#define init_timer(timer) do { \ (timer)->function = NULL; \ (timer)->data = 0; \ callout_init(&(timer)->timer_callout, 1); \ @@ -67,9 +72,10 @@ #define del_timer(timer) callout_stop(&(timer)->timer_callout) #define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) #define timer_pending(timer) callout_pending(&(timer)->timer_callout) -#define round_jiffies(j) \ +#define round_jiffies(j) \ ((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) -#define round_jiffies_relative(j) \ - round_jiffies(j) +#define round_jiffies_relative(j) round_jiffies(j) +#define round_jiffies_up(j) round_jiffies(j) +#define round_jiffies_up_relative(j) round_jiffies_up(j) #endif /* _LINUX_TIMER_H_ */