kernel_fpu fixes

This patch fixes a few issues when detecting which kernel_fpu functions
are available.

- Use kernel_fpu_begin() if it's exported on newer kernels.

- Use ZFS_LINUX_TRY_COMPILE_SYMBOL() to choose the right kernel_fpu
  function when using --enable-linux-builtin.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #8259
Closes #8363
This commit is contained in:
Tony Hutter
2019-03-06 16:03:03 -08:00
committed by Brian Behlendorf
parent a73e8fdb93
commit becdcec7b9
2 changed files with 37 additions and 8 deletions
+8 -3
View File
@@ -81,9 +81,16 @@
#endif
#if defined(_KERNEL)
#if defined(HAVE_UNDERSCORE_KERNEL_FPU)
#if defined(HAVE_KERNEL_FPU_API_HEADER)
#include <asm/fpu/api.h>
#include <asm/fpu/internal.h>
#else
#include <asm/i387.h>
#include <asm/xcr.h>
#endif
#if defined(HAVE_UNDERSCORE_KERNEL_FPU)
#define kfpu_begin() \
{ \
preempt_disable(); \
@@ -95,8 +102,6 @@
preempt_enable(); \
}
#elif defined(HAVE_KERNEL_FPU)
#include <asm/i387.h>
#include <asm/xcr.h>
#define kfpu_begin() kernel_fpu_begin()
#define kfpu_end() kernel_fpu_end()
#else