summaryrefslogtreecommitdiff
path: root/include/asm-generic/simd.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2013-09-20 11:55:40 +0400
committerHerbert Xu <herbert@gondor.apana.org.au>2013-09-24 00:02:24 +0400
commita62b01cd6cc1feb5e80d64d6937c291473ed82cb (patch)
treedd995ccdf562851b9d947c2ccb18afd6427f9c8e /include/asm-generic/simd.h
parent714b33d15130cbb5ab426456d4e3de842d6c5b8a (diff)
downloadlinux-a62b01cd6cc1feb5e80d64d6937c291473ed82cb.tar.xz
crypto: create generic version of ablk_helper
Create a generic version of ablk_helper so it can be reused by other architectures. Acked-by: Jussi Kivilinna <jussi.kivilinna@iki.fi> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/asm-generic/simd.h')
-rw-r--r--include/asm-generic/simd.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h
new file mode 100644
index 000000000000..f57eb7b5c23b
--- /dev/null
+++ b/include/asm-generic/simd.h
@@ -0,0 +1,14 @@
+
+#include <linux/hardirq.h>
+
+/*
+ * may_use_simd - whether it is allowable at this time to issue SIMD
+ * instructions or access the SIMD register file
+ *
+ * As architectures typically don't preserve the SIMD register file when
+ * taking an interrupt, !in_interrupt() should be a reasonable default.
+ */
+static __must_check inline bool may_use_simd(void)
+{
+ return !in_interrupt();
+}