From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/arch/arm.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/arch/arm.c (limited to 'src/arch/arm.c') diff --git a/src/arch/arm.c b/src/arch/arm.c new file mode 100644 index 000000000..02f0107b7 --- /dev/null +++ b/src/arch/arm.c @@ -0,0 +1,37 @@ +#include "acconfig.h" +#include "arch/probe.h" + +/* flags we export */ +int ceph_arch_neon = 0; +int ceph_arch_aarch64_crc32 = 0; +int ceph_arch_aarch64_pmull = 0; + +#include + +#if __linux__ + +#include +#include // ElfW macro +#include + +#if __arm__ || __aarch64__ +#include +#endif // __arm__ + +#endif // __linux__ + +int ceph_arch_arm_probe(void) +{ +#if __linux__ + unsigned long hwcap = getauxval(AT_HWCAP); +#if __arm__ + ceph_arch_neon = (hwcap & HWCAP_NEON) == HWCAP_NEON; +#elif __aarch64__ + ceph_arch_neon = (hwcap & HWCAP_ASIMD) == HWCAP_ASIMD; + ceph_arch_aarch64_crc32 = (hwcap & HWCAP_CRC32) == HWCAP_CRC32; + ceph_arch_aarch64_pmull = (hwcap & HWCAP_PMULL) == HWCAP_PMULL; +#endif +#endif // __linux__ + return 0; +} + -- cgit v1.2.3