ztest: Fix scrub check in ztest_raidz_expand_check()
[zfs.git] / config / kernel-cpu_has_feature.m4
blob608faf0f89fe5cbeb4bcfe23d3bd8c791dc44ec0
1 dnl #
2 dnl # cpu_has_feature() may referencing GPL-only cpu_feature_keys on powerpc
3 dnl #
5 dnl #
6 dnl # Checking if cpu_has_feature is exported GPL-only
7 dnl #
8 AC_DEFUN([ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE], [
9         ZFS_LINUX_TEST_SRC([cpu_has_feature], [
10                 #include <linux/version.h>
11                 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
12                 #include <asm/cpu_has_feature.h>
13                 #else
14                 #include <asm/cputable.h>
15                 #endif
16         ], [
17                 return cpu_has_feature(CPU_FTR_ALTIVEC) ? 0 : 1;
18         ], [], [ZFS_META_LICENSE])
20 AC_DEFUN([ZFS_AC_KERNEL_CPU_HAS_FEATURE], [
21         AC_MSG_CHECKING([whether cpu_has_feature() is GPL-only])
22         ZFS_LINUX_TEST_RESULT([cpu_has_feature_license], [
23                 AC_MSG_RESULT(no)
24         ], [
25                 AC_MSG_RESULT(yes)
26                 AC_DEFINE(HAVE_CPU_HAS_FEATURE_GPL_ONLY, 1,
27                     [cpu_has_feature() is GPL-only])
28         ])