]> git.proxmox.com Git - ceph.git/blame - ceph/src/arch/arm.c
update sources to 12.2.7
[ceph.git] / ceph / src / arch / arm.c
CommitLineData
3efd9988 1#include "acconfig.h"
7c673cae
FG
2#include "arch/probe.h"
3
4/* flags we export */
5int ceph_arch_neon = 0;
6int ceph_arch_aarch64_crc32 = 0;
28e407b8 7int ceph_arch_aarch64_pmull = 0;
7c673cae
FG
8
9#include <stdio.h>
10
11#if __linux__
12
13#include <elf.h>
14#include <link.h> // ElfW macro
28e407b8 15#include <sys/auxv.h>
7c673cae
FG
16
17#if __arm__ || __aarch64__
18#include <asm/hwcap.h>
19#endif // __arm__
20
7c673cae
FG
21#endif // __linux__
22
23int ceph_arch_arm_probe(void)
24{
28e407b8
AA
25#if __linux__
26 unsigned long hwcap = getauxval(AT_HWCAP);
27#if __arm__
28 ceph_arch_neon = (hwcap & HWCAP_NEON) == HWCAP_NEON;
29#elif __aarch64__
30 ceph_arch_neon = (hwcap & HWCAP_ASIMD) == HWCAP_ASIMD;
31 ceph_arch_aarch64_crc32 = (hwcap & HWCAP_CRC32) == HWCAP_CRC32;
32 ceph_arch_aarch64_pmull = (hwcap & HWCAP_PMULL) == HWCAP_PMULL;
7c673cae 33#endif
28e407b8 34#endif // __linux__
7c673cae
FG
35 return 0;
36}
37