]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-fpu.m4
Linux 5.19 compat: bdev_max_secure_erase_sectors()
[mirror_zfs.git] / config / kernel-fpu.m4
CommitLineData
8e94ac0e 1dnl #
0c593296 2dnl # Handle differences in kernel FPU code.
fc0c72b1 3dnl #
0c593296 4dnl # Kernel
4d14a285
AF
5dnl # 5.11: kernel_fpu_begin() is an inlined function now, so don't check
6dnl # for it inside the kernel symbols.
7dnl #
10fa2545 8dnl # 5.0: Wrappers have been introduced to save/restore the FPU state.
e5db3134 9dnl # This change was made to the 4.19.38 and 4.14.120 LTS kernels.
10fa2545 10dnl # HAVE_KERNEL_FPU_INTERNAL
0c593296
TH
11dnl #
12dnl # 4.2: Use __kernel_fpu_{begin,end}()
13dnl # HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
14dnl #
15dnl # Pre-4.2: Use kernel_fpu_{begin,end}()
16dnl # HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
fc0c72b1 17dnl #
608f8749
BB
18dnl # N.B. The header check is performed before all other checks since it
19dnl # depends on HAVE_KERNEL_FPU_API_HEADER being set in confdefs.h.
20dnl #
21AC_DEFUN([ZFS_AC_KERNEL_FPU_HEADER], [
22 AC_MSG_CHECKING([whether fpu headers are available])
fc0c72b1 23 ZFS_LINUX_TRY_COMPILE([
becdcec7
TH
24 #include <linux/module.h>
25 #include <asm/fpu/api.h>
26 ],[
27 ],[
8062b768
BB
28 AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1,
29 [kernel has asm/fpu/api.h])
becdcec7
TH
30 AC_MSG_RESULT(asm/fpu/api.h)
31 ],[
ce7a5dbf 32 AC_MSG_RESULT(i387.h)
becdcec7 33 ])
608f8749 34])
becdcec7 35
608f8749
BB
36AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
37 ZFS_LINUX_TEST_SRC([kernel_fpu], [
10fa2545 38 #include <linux/types.h>
becdcec7
TH
39 #ifdef HAVE_KERNEL_FPU_API_HEADER
40 #include <asm/fpu/api.h>
ce7a5dbf 41 #include <asm/fpu/internal.h>
becdcec7 42 #else
0c593296 43 #include <asm/i387.h>
becdcec7 44 #endif
608f8749 45 ], [
0c593296
TH
46 kernel_fpu_begin();
47 kernel_fpu_end();
c347fac5 48 ], [], [ZFS_META_LICENSE])
608f8749
BB
49
50 ZFS_LINUX_TEST_SRC([__kernel_fpu], [
10fa2545 51 #include <linux/types.h>
608f8749
BB
52 #ifdef HAVE_KERNEL_FPU_API_HEADER
53 #include <asm/fpu/api.h>
ce7a5dbf 54 #include <asm/fpu/internal.h>
608f8749
BB
55 #else
56 #include <asm/i387.h>
608f8749
BB
57 #endif
58 ], [
59 __kernel_fpu_begin();
60 __kernel_fpu_end();
c347fac5 61 ], [], [ZFS_META_LICENSE])
608f8749 62
608f8749
BB
63])
64
65AC_DEFUN([ZFS_AC_KERNEL_FPU], [
66 dnl #
67 dnl # Legacy kernel
68 dnl #
69 AC_MSG_CHECKING([whether kernel fpu is available])
4d14a285 70 ZFS_LINUX_TEST_RESULT([kernel_fpu_license], [
0c593296 71 AC_MSG_RESULT(kernel_fpu_*)
8062b768
BB
72 AC_DEFINE(HAVE_KERNEL_FPU, 1,
73 [kernel has kernel_fpu_* functions])
74 AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
75 [kernel exports FPU functions])
fc0c72b1 76 ],[
608f8749
BB
77 dnl #
78 dnl # Linux 4.2 kernel
79 dnl #
80 ZFS_LINUX_TEST_RESULT_SYMBOL([__kernel_fpu_license],
81 [__kernel_fpu_begin],
82 [arch/x86/kernel/fpu/core.c arch/x86/kernel/i387.c], [
0c593296 83 AC_MSG_RESULT(__kernel_fpu_*)
e5db3134
BB
84 AC_DEFINE(HAVE_UNDERSCORE_KERNEL_FPU, 1,
85 [kernel has __kernel_fpu_* functions])
86 AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
87 [kernel exports FPU functions])
0c593296 88 ],[
ce7a5dbf
AF
89 AC_MSG_RESULT(internal)
90 AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1,
91 [kernel fpu internal])
0c593296 92 ])
fc0c72b1
GN
93 ])
94])