]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-fpu.m4
Don't assume pthread_t is uint_t for portability
[mirror_zfs.git] / config / kernel-fpu.m4
CommitLineData
0c593296
TH
1dnl #
2dnl # Handle differences in kernel FPU code.
fc0c72b1 3dnl #
0c593296
TH
4dnl # Kernel
5dnl # 5.0: All kernel fpu functions are GPL only, so we can't use them.
6dnl # (nothing defined)
7dnl #
8dnl # 4.2: Use __kernel_fpu_{begin,end}()
9dnl # HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
10dnl #
11dnl # Pre-4.2: Use kernel_fpu_{begin,end}()
12dnl # HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU
fc0c72b1
GN
13dnl #
14AC_DEFUN([ZFS_AC_KERNEL_FPU], [
becdcec7 15 AC_MSG_CHECKING([which kernel_fpu header to use])
fc0c72b1 16 ZFS_LINUX_TRY_COMPILE([
becdcec7
TH
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
0c593296
TH
33 #include <asm/i387.h>
34 #include <asm/xcr.h>
becdcec7
TH
35 #endif
36 MODULE_LICENSE("$ZFS_META_LICENSE");
fc0c72b1 37 ],[
0c593296
TH
38 kernel_fpu_begin();
39 kernel_fpu_end();
becdcec7 40 ], [kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
0c593296
TH
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])
fc0c72b1 44 ],[
becdcec7
TH
45 ZFS_LINUX_TRY_COMPILE_SYMBOL([
46 #include <linux/module.h>
47 #ifdef HAVE_KERNEL_FPU_API_HEADER
0c593296 48 #include <asm/fpu/api.h>
becdcec7
TH
49 #else
50 #include <asm/i387.h>
51 #include <asm/xcr.h>
52 #endif
53 MODULE_LICENSE("$ZFS_META_LICENSE");
0c593296
TH
54 ],[
55 __kernel_fpu_begin();
56 __kernel_fpu_end();
becdcec7 57 ], [__kernel_fpu_begin], [arch/x86/kernel/fpu/core.c arch/x86/kernel/i387.c], [
0c593296
TH
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 ])
fc0c72b1
GN
64 ])
65])