]>
Commit | Line | Data |
---|---|---|
3efd9988 | 1 | #include "acconfig.h" |
7c673cae FG |
2 | #include "arch/probe.h" |
3 | ||
4 | /* flags we export */ | |
5 | int ceph_arch_neon = 0; | |
6 | int ceph_arch_aarch64_crc32 = 0; | |
28e407b8 | 7 | int 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 | ||
23 | int 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 |