Add CRYPTO_needs_hwcap2_workaround.
Bug: 203
Change-Id: I50384cce14509ab1ca36e6f0e9f192f9e458b313
Reviewed-on: https://boringssl-review.googlesource.com/20404
Commit-Queue: Steven Valdez <svaldez@google.com>
Reviewed-by: Steven Valdez <svaldez@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/crypto/cpu-arm-linux.c b/crypto/cpu-arm-linux.c
index a5f1f8a..839b632 100644
--- a/crypto/cpu-arm-linux.c
+++ b/crypto/cpu-arm-linux.c
@@ -288,7 +288,7 @@
extern uint32_t OPENSSL_armcap_P;
-static int g_has_broken_neon;
+static int g_has_broken_neon, g_needs_hwcap2_workaround;
void OPENSSL_cpuid_setup(void) {
char *cpuinfo_data;
@@ -336,6 +336,7 @@
}
if (hwcap2 == 0) {
hwcap2 = get_hwcap2_cpuinfo(&cpuinfo);
+ g_needs_hwcap2_workaround = hwcap2 != 0;
}
if (hwcap2 & HWCAP2_AES) {
@@ -357,4 +358,6 @@
int CRYPTO_has_broken_NEON(void) { return g_has_broken_neon; }
+int CRYPTO_needs_hwcap2_workaround(void) { return g_needs_hwcap2_workaround; }
+
#endif // OPENSSL_ARM && !OPENSSL_STATIC_ARMCAP