aboutsummaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-06-19 13:18:00 +0100
committerMark Brown <broonie@linaro.org>2014-06-19 13:18:00 +0100
commit9952ea5aee31bb082ca5f702507fb563ed23431f (patch)
tree46da00f62709cca4f434e4bdbdc43f5dcabc9b00 /include/asm-generic
parentb621c22123dc6b6facafe115f6364cf80172d551 (diff)
parent696fe9b3a638b5545f7cbfd1e4536cdbdacab2a5 (diff)
Merge remote-tracking branch 'lsk/v3.10/topic/arm64-crypto' into linux-linaro-lsk
Diffstat (limited to 'include/asm-generic')
-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();
+}