]>
Commit | Line | Data |
---|---|---|
8b8b44d0 RK |
1 | dnl # 4.14-rc3 API change |
2 | dnl # https://lwn.net/Articles/735887/ | |
48ef8ba0 | 3 | dnl # |
48ef8ba0 BB |
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. | |
8 | dnl # | |
2b96f774 | 9 | dnl # Also check for the existence of flags in struct timer_list, they were |
8b8b44d0 | 10 | dnl # added in 4.1-rc8 via 0eeda71bc30d. |
608f8749 BB |
11 | dnl # |
12 | AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER_SETUP], [ | |
13 | ZFS_LINUX_TEST_SRC([timer_setup], [ | |
48ef8ba0 | 14 | #include <linux/timer.h> |
8b8b44d0 RK |
15 | |
16 | struct my_task_timer { | |
17 | struct timer_list timer; | |
18 | int data; | |
19 | }; | |
20 | ||
21 | void task_expire(struct timer_list *tl) | |
22 | { | |
608f8749 BB |
23 | struct my_task_timer *task_timer = |
24 | from_timer(task_timer, tl, timer); | |
8b8b44d0 RK |
25 | task_timer->data = 42; |
26 | } | |
27 | ],[ | |
28 | struct my_task_timer task_timer; | |
29 | timer_setup(&task_timer.timer, task_expire, 0); | |
608f8749 BB |
30 | ]) |
31 | ||
32 | ZFS_LINUX_TEST_SRC([timer_list_function], [ | |
33 | #include <linux/timer.h> | |
34 | void task_expire(struct timer_list *tl) {} | |
48ef8ba0 | 35 | ],[ |
608f8749 BB |
36 | struct timer_list tl; |
37 | tl.function = task_expire; | |
38 | ]) | |
39 | ||
40 | ZFS_LINUX_TEST_SRC([timer_list_flags], [ | |
41 | #include <linux/timer.h> | |
42 | ],[ | |
43 | struct timer_list tl; | |
44 | tl.flags = 2; | |
45 | ]) | |
46 | ]) | |
47 | ||
48 | AC_DEFUN([ZFS_AC_KERNEL_TIMER_SETUP], [ | |
49 | AC_MSG_CHECKING([whether timer_setup() is available]) | |
50 | ZFS_LINUX_TEST_RESULT([timer_setup], [ | |
8b8b44d0 RK |
51 | AC_MSG_RESULT(yes) |
52 | AC_DEFINE(HAVE_KERNEL_TIMER_SETUP, 1, | |
53 | [timer_setup() is available]) | |
54 | ],[ | |
55 | AC_MSG_RESULT(no) | |
56 | ]) | |
48ef8ba0 | 57 | |
8b8b44d0 | 58 | AC_MSG_CHECKING([whether timer function expects timer_list]) |
608f8749 | 59 | ZFS_LINUX_TEST_RESULT([timer_list_function], [ |
48ef8ba0 BB |
60 | AC_MSG_RESULT(yes) |
61 | AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1, | |
62 | [timer_list.function gets a timer_list]) | |
63 | ],[ | |
64 | AC_MSG_RESULT(no) | |
65 | ]) | |
8b8b44d0 RK |
66 | |
67 | AC_MSG_CHECKING([whether struct timer_list has flags]) | |
608f8749 | 68 | ZFS_LINUX_TEST_RESULT([timer_list_flags], [ |
8b8b44d0 RK |
69 | AC_MSG_RESULT(yes) |
70 | AC_DEFINE(HAVE_KERNEL_TIMER_LIST_FLAGS, 1, | |
71 | [struct timer_list has a flags member]) | |
72 | ],[ | |
73 | AC_MSG_RESULT(no) | |
74 | ]) | |
48ef8ba0 | 75 | ]) |