]> git.proxmox.com Git - mirror_zfs.git/blob - config/kernel-fpu.m4
Linux 5.0 compat: Use totalhigh_pages()
[mirror_zfs.git] / config / kernel-fpu.m4
1 dnl #
2 dnl # Handle differences in kernel FPU code.
3 dnl #
4 dnl # Kernel
5 dnl # 5.0: All kernel fpu functions are GPL only, so we can't use them.
6 dnl # (nothing defined)
7 dnl #
8 dnl # 4.2: Use __kernel_fpu_{begin,end}()
9 dnl # HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
10 dnl #
11 dnl # Pre-4.2: Use kernel_fpu_{begin,end}()
12 dnl # HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
13 dnl #
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>
19 ],[
20 ],[
21 AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1, [kernel has asm/fpu/api.h])
22 AC_MSG_RESULT(asm/fpu/api.h)
23 ],[
24 AC_MSG_RESULT(i387.h & xcr.h)
25 ])
26
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>
32 #else
33 #include <asm/i387.h>
34 #include <asm/xcr.h>
35 #endif
36 MODULE_LICENSE("$ZFS_META_LICENSE");
37 ],[
38 kernel_fpu_begin();
39 kernel_fpu_end();
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])
44 ],[
45 ZFS_LINUX_TRY_COMPILE_SYMBOL([
46 #include <linux/module.h>
47 #ifdef HAVE_KERNEL_FPU_API_HEADER
48 #include <asm/fpu/api.h>
49 #else
50 #include <asm/i387.h>
51 #include <asm/xcr.h>
52 #endif
53 MODULE_LICENSE("$ZFS_META_LICENSE");
54 ],[
55 __kernel_fpu_begin();
56 __kernel_fpu_end();
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])
61 ],[
62 AC_MSG_RESULT(not exported)
63 ])
64 ])
65 ])