diff options
Diffstat (limited to 'sys/ofed/include/linux/timer.h')
| -rw-r--r-- | sys/ofed/include/linux/timer.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/ofed/include/linux/timer.h b/sys/ofed/include/linux/timer.h index ed4ed4a56273..7a948d751161 100644 --- a/sys/ofed/include/linux/timer.h +++ b/sys/ofed/include/linux/timer.h @@ -2,6 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,11 +38,10 @@ struct timer_list { struct callout timer_callout; void (*function)(unsigned long); - unsigned long data; + unsigned long data; + unsigned long expires; }; -#define expires timer_callout.c_time - static inline void _timer_fn(void *context) { @@ -65,13 +65,16 @@ do { \ callout_init(&(timer)->timer_callout, CALLOUT_MPSAFE); \ } while (0) -#define mod_timer(timer, expire) \ - callout_reset(&(timer)->timer_callout, (expire) - jiffies, \ - _timer_fn, (timer)) +#define mod_timer(timer, exp) \ +do { \ + (timer)->expires = (exp); \ + callout_reset(&(timer)->timer_callout, (exp) - jiffies, \ + _timer_fn, (timer)); \ +} while (0) #define add_timer(timer) \ callout_reset(&(timer)->timer_callout, \ - (timer)->timer_callout.c_time - jiffies, _timer_fn, (timer)) + (timer)->expires - jiffies, _timer_fn, (timer)) #define del_timer(timer) callout_stop(&(timer)->timer_callout) #define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) @@ -84,4 +87,6 @@ round_jiffies(unsigned long j) return roundup(j, hz); } +#define round_jiffies_relative(j) round_jiffies(j) + #endif /* _LINUX_TIMER_H_ */ |
