From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. 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 00000000..02f0107b --- /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