X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=wrapper%2Ftimer.h;fp=wrapper%2Ftimer.h;h=441a01723c33f27df5ecf7945ac999ec4c93daf3;hb=47da52acb585cedb3a130d7c8af5db2d2f208265;hp=0000000000000000000000000000000000000000;hpb=7c85d2eed6474032787e4e999c6226f15a18c221;p=lttng-modules.git diff --git a/wrapper/timer.h b/wrapper/timer.h new file mode 100644 index 00000000..441a0172 --- /dev/null +++ b/wrapper/timer.h @@ -0,0 +1,55 @@ +#ifndef _LTTNG_WRAPPER_TIMER_H +#define _LTTNG_WRAPPER_TIMER_H + +/* + * wrapper/timer.h + * + * wrapper around linux/timer.h. + * + * Copyright (C) 2016 Michael Jeanson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; only + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + + +#if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) + +#define lttng_init_timer_pinned(timer) \ + init_timer_pinned(timer) + +static inline int lttng_mod_timer_pinned(struct timer_list *timer, + unsigned long expires) +{ + return mod_timer(timer, expires); +} + +#else /* #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) */ + +#define lttng_init_timer_pinned(timer) \ + init_timer(timer) + +static inline int lttng_mod_timer_pinned(struct timer_list *timer, + unsigned long expires) +{ + return mod_timer_pinned(timer, expires); +} + +#endif /* #else #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) */ + +#endif /* _LTTNG_WRAPPER_TIMER_H */