aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/cpuid.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-01-19 00:31:08 -0500
committerJack Lloyd <[email protected]>2017-01-19 00:31:08 -0500
commitbafeb0d590006063e522dd31812633c29167513a (patch)
treebf12e3c275b15ac2a5e6bc0850d33fdce190d140 /src/lib/utils/cpuid.cpp
parent59fe7e7a9559eb3624d8ef310325bbb917f89033 (diff)
Avoid requiring AT_DCACHEBSIZE (data cache size) getauxval
Missing on Android it appears, or at least on Kullo CI NDK. Not essential by any means.
Diffstat (limited to 'src/lib/utils/cpuid.cpp')
-rw-r--r--src/lib/utils/cpuid.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/utils/cpuid.cpp b/src/lib/utils/cpuid.cpp
index 325421d71..43ee4bc54 100644
--- a/src/lib/utils/cpuid.cpp
+++ b/src/lib/utils/cpuid.cpp
@@ -212,6 +212,7 @@ uint64_t arm_detect_cpu_features(size_t* cache_line_size)
if(hwcap_crypto & ARM_hwcap_bit::SHA2_bit)
detected_features |= CPUID::CPUID_ARM_SHA2_BIT;
+#if defined(AT_DCACHEBSIZE)
const unsigned long dcache_line = ::getauxval(AT_DCACHEBSIZE);
// plausibility check
@@ -219,6 +220,8 @@ uint64_t arm_detect_cpu_features(size_t* cache_line_size)
*cache_line_size = static_cast<size_t>(dcache_line);
#endif
+#endif
+
// TODO: probe functions
return detected_features;