1 dnl # 4.14-rc3 API change
2 dnl # https://lwn.net/Articles/735887/
4 dnl # Check if timer_list.func get passed a timer_list or an unsigned long
5 dnl # (older kernels). Also sanity check the from_timer() and timer_setup()
6 dnl # macros are available as well, since they will be used in the same newer
7 dnl # kernels that support the new timer_list.func signature.
9 dnl # Also check for the existence of flags in struct timer_list, they were
10 dnl # added in 4.1-rc8 via 0eeda71bc30d.
12 AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER_SETUP], [
13 ZFS_LINUX_TEST_SRC([timer_setup], [
14 #include <linux/timer.h>
16 struct my_task_timer {
17 struct timer_list timer;
21 void task_expire(struct timer_list *tl)
23 struct my_task_timer *task_timer =
24 from_timer(task_timer, tl, timer);
25 task_timer->data = 42;
28 struct my_task_timer task_timer;
29 timer_setup(&task_timer.timer, task_expire, 0);
32 ZFS_LINUX_TEST_SRC([timer_list_function], [
33 #include <linux/timer.h>
34 void task_expire(struct timer_list *tl) {}
37 tl.function = task_expire;
40 ZFS_LINUX_TEST_SRC([timer_list_flags], [
41 #include <linux/timer.h>
48 AC_DEFUN([ZFS_AC_KERNEL_TIMER_SETUP], [
49 AC_MSG_CHECKING([whether timer_setup() is available])
50 ZFS_LINUX_TEST_RESULT([timer_setup], [
52 AC_DEFINE(HAVE_KERNEL_TIMER_SETUP, 1,
53 [timer_setup() is available])
58 AC_MSG_CHECKING([whether timer function expects timer_list])
59 ZFS_LINUX_TEST_RESULT([timer_list_function], [
61 AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1,
62 [timer_list.function gets a timer_list])
67 AC_MSG_CHECKING([whether struct timer_list has flags])
68 ZFS_LINUX_TEST_RESULT([timer_list_flags], [
70 AC_DEFINE(HAVE_KERNEL_TIMER_LIST_FLAGS, 1,
71 [struct timer_list has a flags member])