The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/config/kernel-timer.m4

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 dnl # 4.14-rc3 API change
    2 dnl # https://lwn.net/Articles/735887/
    3 dnl #
    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 #
    9 dnl # Also check for the existence of flags in struct timer_list, they were
   10 dnl # added in 4.1-rc8 via 0eeda71bc30d.
   11 dnl #
   12 AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER_SETUP], [
   13         ZFS_LINUX_TEST_SRC([timer_setup], [
   14                 #include <linux/timer.h>
   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                 {
   23                         struct my_task_timer *task_timer =
   24                             from_timer(task_timer, tl, timer);
   25                         task_timer->data = 42;
   26                 }
   27         ],[
   28                 struct my_task_timer task_timer;
   29                 timer_setup(&task_timer.timer, task_expire, 0);
   30         ])
   31 
   32         ZFS_LINUX_TEST_SRC([timer_list_function], [
   33                 #include <linux/timer.h>
   34                 void task_expire(struct timer_list *tl) {}
   35         ],[
   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], [
   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         ])
   57 
   58         AC_MSG_CHECKING([whether timer function expects timer_list])
   59         ZFS_LINUX_TEST_RESULT([timer_list_function], [
   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         ])
   66 
   67         AC_MSG_CHECKING([whether struct timer_list has flags])
   68         ZFS_LINUX_TEST_RESULT([timer_list_flags], [
   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         ])
   75 ])

Cache object: 19be5439af6d668a872326451490b2ef


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.