Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linuxkpi/common/include/linux/timer.h
Show All 40 Lines | struct timer_list { | ||||
struct callout timer_callout; | struct callout timer_callout; | ||||
void (*function) (unsigned long); | void (*function) (unsigned long); | ||||
unsigned long data; | unsigned long data; | ||||
unsigned long expires; | unsigned long expires; | ||||
}; | }; | ||||
extern unsigned long linux_timer_hz_mask; | extern unsigned long linux_timer_hz_mask; | ||||
#define setup_timer(timer, func, dat) \ | #define TIMER_IRQSAFE 0x0001 | ||||
do { \ | |||||
#define setup_timer(timer, func, dat) do { \ | |||||
(timer)->function = (func); \ | (timer)->function = (func); \ | ||||
(timer)->data = (dat); \ | (timer)->data = (dat); \ | ||||
callout_init(&(timer)->timer_callout, 1); \ | callout_init(&(timer)->timer_callout, 1); \ | ||||
} while (0) | } while (0) | ||||
#define init_timer(timer) \ | #define __setup_timer(timer, func, dat, flags) do { \ | ||||
do { \ | CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0); \ | ||||
setup_timer(timer, func, dat); \ | |||||
} while (0) | |||||
#define init_timer(timer) do { \ | |||||
(timer)->function = NULL; \ | (timer)->function = NULL; \ | ||||
(timer)->data = 0; \ | (timer)->data = 0; \ | ||||
callout_init(&(timer)->timer_callout, 1); \ | callout_init(&(timer)->timer_callout, 1); \ | ||||
} while (0) | } while (0) | ||||
extern void mod_timer(struct timer_list *, unsigned long); | extern void mod_timer(struct timer_list *, unsigned long); | ||||
extern void add_timer(struct timer_list *); | extern void add_timer(struct timer_list *); | ||||
extern void add_timer_on(struct timer_list *, int cpu); | extern void add_timer_on(struct timer_list *, int cpu); | ||||
#define del_timer(timer) callout_stop(&(timer)->timer_callout) | #define del_timer(timer) callout_stop(&(timer)->timer_callout) | ||||
#define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) | #define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) | ||||
#define timer_pending(timer) callout_pending(&(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)) | ((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) | ||||
#define round_jiffies_relative(j) \ | #define round_jiffies_relative(j) round_jiffies(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_ */ | #endif /* _LINUX_TIMER_H_ */ |