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-fpu.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 #
    2 dnl # Handle differences in kernel FPU code.
    3 dnl #
    4 dnl # Kernel
    5 dnl # 5.19:     The asm/fpu/internal.h header was removed, it has been
    6 dnl #           effectively empty since the 5.16 kernel.
    7 dnl #
    8 dnl # 5.11:     kernel_fpu_begin() is an inlined function now, so don't check
    9 dnl #           for it inside the kernel symbols.
   10 dnl #
   11 dnl # 5.0:      Wrappers have been introduced to save/restore the FPU state.
   12 dnl #           This change was made to the 4.19.38 and 4.14.120 LTS kernels.
   13 dnl #           HAVE_KERNEL_FPU_INTERNAL
   14 dnl #
   15 dnl # 4.2:      Use __kernel_fpu_{begin,end}()
   16 dnl #           HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
   17 dnl #
   18 dnl # Pre-4.2:  Use kernel_fpu_{begin,end}()
   19 dnl #           HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
   20 dnl #
   21 dnl # N.B. The header check is performed before all other checks since it
   22 dnl # depends on HAVE_KERNEL_FPU_API_HEADER being set in confdefs.h.
   23 dnl #
   24 AC_DEFUN([ZFS_AC_KERNEL_FPU_HEADER], [
   25         AC_MSG_CHECKING([whether fpu headers are available])
   26         ZFS_LINUX_TRY_COMPILE([
   27                 #include <linux/module.h>
   28                 #include <asm/fpu/api.h>
   29         ],[
   30         ],[
   31                 AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1,
   32                     [kernel has asm/fpu/api.h])
   33 
   34                 ZFS_LINUX_TRY_COMPILE([
   35                         #include <linux/module.h>
   36                         #include <asm/fpu/internal.h>
   37                 ],[
   38                 ],[
   39                         AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL_HEADER, 1,
   40                             [kernel has asm/fpu/internal.h])
   41                         AC_MSG_RESULT([asm/fpu/api.h asm/fpu/internal.h])
   42                 ],[
   43                         AC_MSG_RESULT([asm/fpu/api.h])
   44                 ])
   45         ],[
   46                 AC_MSG_RESULT([i387.h])
   47         ])
   48 
   49 ])
   50 
   51 AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
   52         ZFS_LINUX_TEST_SRC([kernel_fpu], [
   53                 #include <linux/types.h>
   54                 #ifdef HAVE_KERNEL_FPU_API_HEADER
   55                 #include <asm/fpu/api.h>
   56                 #ifdef HAVE_KERNEL_FPU_INTERNAL_HEADER
   57                 #include <asm/fpu/internal.h>
   58                 #endif
   59                 #else
   60                 #include <asm/i387.h>
   61                 #endif
   62         ], [
   63                 kernel_fpu_begin();
   64                 kernel_fpu_end();
   65         ], [], [ZFS_META_LICENSE])
   66 
   67         ZFS_LINUX_TEST_SRC([__kernel_fpu], [
   68                 #include <linux/types.h>
   69                 #ifdef HAVE_KERNEL_FPU_API_HEADER
   70                 #include <asm/fpu/api.h>
   71                 #ifdef HAVE_KERNEL_FPU_INTERNAL_HEADER
   72                 #include <asm/fpu/internal.h>
   73                 #endif
   74                 #else
   75                 #include <asm/i387.h>
   76                 #endif
   77         ], [
   78                 __kernel_fpu_begin();
   79                 __kernel_fpu_end();
   80         ], [], [ZFS_META_LICENSE])
   81 
   82 ])
   83 
   84 AC_DEFUN([ZFS_AC_KERNEL_FPU], [
   85         dnl #
   86         dnl # Legacy kernel
   87         dnl #
   88         AC_MSG_CHECKING([whether kernel fpu is available])
   89         ZFS_LINUX_TEST_RESULT([kernel_fpu_license], [
   90                 AC_MSG_RESULT(kernel_fpu_*)
   91                 AC_DEFINE(HAVE_KERNEL_FPU, 1,
   92                     [kernel has kernel_fpu_* functions])
   93                 AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
   94                     [kernel exports FPU functions])
   95         ],[
   96                 dnl #
   97                 dnl # Linux 4.2 kernel
   98                 dnl #
   99                 ZFS_LINUX_TEST_RESULT_SYMBOL([__kernel_fpu_license],
  100                     [__kernel_fpu_begin],
  101                     [arch/x86/kernel/fpu/core.c arch/x86/kernel/i387.c], [
  102                         AC_MSG_RESULT(__kernel_fpu_*)
  103                         AC_DEFINE(HAVE_UNDERSCORE_KERNEL_FPU, 1,
  104                             [kernel has __kernel_fpu_* functions])
  105                         AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
  106                             [kernel exports FPU functions])
  107                 ],[
  108                         AC_MSG_RESULT(internal)
  109                         AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1,
  110                             [kernel fpu internal])
  111                 ])
  112         ])
  113 ])

Cache object: 9303c4d67e7d94e0ca10c53055d65f58


[ 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.