Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/timer.h
Context not available. | |||||
struct timer_list { | struct timer_list { | ||||
struct callout callout; | struct callout callout; | ||||
#if __LinuxKPI_version >= 40015 | |||||
void (*function) (struct timer_list *); | |||||
/* | |||||
* This field is temporary until we can get all users up to date | |||||
* and fix the callback routine in linux_compat.c | |||||
*/ | |||||
struct timer_list *data; | |||||
#else | |||||
void (*function) (unsigned long); | void (*function) (unsigned long); | ||||
unsigned long data; | unsigned long data; | ||||
#endif | |||||
int expires; | int expires; | ||||
}; | }; | ||||
Context not available. | |||||
#define TIMER_IRQSAFE 0x0001 | #define TIMER_IRQSAFE 0x0001 | ||||
#if __LinuxKPI_version >= 40015 | |||||
#define from_timer(var, cb, field) \ | |||||
container_of(cb, typeof(*var), field) | |||||
#define __timer_setup(timer, func) do { \ | |||||
(timer)->function = (func); \ | |||||
(timer)->data = (timer); \ | |||||
callout_init(&(timer)->callout, 1); \ | |||||
} while (0) | |||||
#define timer_setup(timer, func, flags) \ | |||||
__timer_setup((timer), (func)) | |||||
#else | |||||
#define setup_timer(timer, func, dat) do { \ | #define setup_timer(timer, func, dat) do { \ | ||||
(timer)->function = (func); \ | (timer)->function = (func); \ | ||||
(timer)->data = (dat); \ | (timer)->data = (dat); \ | ||||
callout_init(&(timer)->callout, 1); \ | callout_init(&(timer)->callout, 1); \ | ||||
} while (0) | } while (0) | ||||
#define __setup_timer(timer, func, dat, flags) do { \ | #define __setup_timer(timer, func, dat, flags) do { \ | ||||
Context not available. | |||||
#define init_timer(timer) do { \ | #define init_timer(timer) do { \ | ||||
(timer)->function = NULL; \ | (timer)->function = NULL; \ | ||||
(timer)->data = 0; \ | (timer)->data = 0; \ | ||||
callout_init(&(timer)->callout, 1); \ | callout_init(&(timer)->callout, 1); \ | ||||
} while (0) | } while (0) | ||||
#endif | |||||
extern void mod_timer(struct timer_list *, int); | extern void mod_timer(struct timer_list *, int); | ||||
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); | ||||
Context not available. |