2 dnl # Handle differences in kernel FPU code.
5 dnl # 5.0: All kernel fpu functions are GPL only, so we can't use them.
6 dnl # (nothing defined)
8 dnl # 4.2: Use __kernel_fpu_{begin,end}()
9 dnl # HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
11 dnl # Pre-4.2: Use kernel_fpu_{begin,end}()
12 dnl # HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
14 AC_DEFUN([ZFS_AC_KERNEL_FPU], [
15 AC_MSG_CHECKING([which kernel_fpu header to use])
16 ZFS_LINUX_TRY_COMPILE([
17 #include <linux/module.h>
18 #include <asm/fpu/api.h>
21 AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1, [kernel has asm/fpu/api.h])
22 AC_MSG_RESULT(asm/fpu/api.h)
24 AC_MSG_RESULT(i387.h & xcr.h)
27 AC_MSG_CHECKING([which kernel_fpu function to use])
28 ZFS_LINUX_TRY_COMPILE_SYMBOL([
29 #include <linux/module.h>
30 #ifdef HAVE_KERNEL_FPU_API_HEADER
31 #include <asm/fpu/api.h>
36 MODULE_LICENSE("$ZFS_META_LICENSE");
40 ], [kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
41 AC_MSG_RESULT(kernel_fpu_*)
42 AC_DEFINE(HAVE_KERNEL_FPU, 1, [kernel has kernel_fpu_* functions])
43 AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, [kernel exports FPU functions])
45 ZFS_LINUX_TRY_COMPILE_SYMBOL([
46 #include <linux/module.h>
47 #ifdef HAVE_KERNEL_FPU_API_HEADER
48 #include <asm/fpu/api.h>
53 MODULE_LICENSE("$ZFS_META_LICENSE");
57 ], [__kernel_fpu_begin], [arch/x86/kernel/fpu/core.c arch/x86/kernel/i387.c], [
58 AC_MSG_RESULT(__kernel_fpu_*)
59 AC_DEFINE(HAVE_UNDERSCORE_KERNEL_FPU, 1, [kernel has __kernel_fpu_* functions])
60 AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, [kernel exports FPU functions])
62 AC_MSG_RESULT(not exported)