summaryrefslogtreecommitdiffstats
path: root/config/kernel-timer.m4
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-02-07 11:50:24 -0800
committerGitHub <[email protected]>2018-02-07 11:50:24 -0800
commit48ef8ba07094afcd67355940ca8db92d76f7c096 (patch)
treec0f847b7ce7c93950d313ca7708bce4bc1f3621e /config/kernel-timer.m4
parent5461eefe50427a8f8caf0b92f0195c754bed8ec6 (diff)
Split spl-build.m4
Split the kernel interface configure checks in to seperate m4 macro files. This is intended to facilitate moving the spl source code in to the zfs repository. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #682
Diffstat (limited to 'config/kernel-timer.m4')
-rw-r--r--config/kernel-timer.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/config/kernel-timer.m4 b/config/kernel-timer.m4
new file mode 100644
index 000000000..93b5158b9
--- /dev/null
+++ b/config/kernel-timer.m4
@@ -0,0 +1,32 @@
+dnl #
+dnl # 4.15 API change
+dnl # https://lkml.org/lkml/2017/11/25/90
+dnl # Check if timer_list.func get passed a timer_list or an unsigned long
+dnl # (older kernels). Also sanity check the from_timer() and timer_setup()
+dnl # macros are available as well, since they will be used in the same newer
+dnl # kernels that support the new timer_list.func signature.
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST], [
+ AC_MSG_CHECKING([whether timer_list.function gets a timer_list])
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-Werror"
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/timer.h>
+ void task_expire(struct timer_list *tl) {}
+ ],[
+ #ifndef from_timer
+ #error "No from_timer() macro"
+ #endif
+
+ struct timer_list timer;
+ timer.function = task_expire;
+ timer_setup(&timer, NULL, 0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1,
+ [timer_list.function gets a timer_list])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ EXTRA_KCFLAGS="$tmp_flags"
+])