aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-10-07 00:19:14 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-07 02:24:31 +0200
commit318893096ba2474c83cfd7b4f8ba4cb163b53430 (patch)
tree321e0086b0e831f24dbcc045c35c55275e22bec4 /src/compat/compat.h
parentcompat: account for ancient ARM assembler (diff)
downloadwireguard-linux-compat-318893096ba2474c83cfd7b4f8ba4cb163b53430.tar.xz
wireguard-linux-compat-318893096ba2474c83cfd7b4f8ba4cb163b53430.zip
compat: make asm/simd.h conditional on its existence
Android kernels backported it, complicating things. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r--src/compat/compat.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 8c366f5..796736c 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -737,24 +737,6 @@ static inline void crypto_xor_cpy(u8 *dst, const u8 *src1, const u8 *src2,
#define read_cpuid_part() read_cpuid_part_number()
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) || (!defined(CONFIG_X86_64) && !defined(CONFIG_ARM64) && !defined(CONFIG_ARM))
-#if defined(CONFIG_X86_64)
-#include <asm/fpu/api.h>
-#endif
-static __must_check inline bool may_use_simd(void)
-{
-#if defined(CONFIG_X86_64)
- return irq_fpu_usable();
-#elif defined(CONFIG_ARM64) && defined(CONFIG_KERNEL_MODE_NEON)
- return true;
-#elif defined(CONFIG_ARM) && defined(CONFIG_KERNEL_MODE_NEON)
- return !in_nmi() && !in_irq() && !in_serving_softirq();
-#else
- return false;
-#endif
-}
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
#define hlist_add_behind(a, b) hlist_add_after(b, a)
#endif