1void __init_cpu_features_resolver(unsigned long hwcap,
2 const __ifunc_arg_t *arg) {
3 if (__aarch64_cpu_features.features)
4 return;
5 __init_cpu_features_constructor(hwcap, arg);
6}
7
8void CONSTRUCTOR_ATTRIBUTE __init_cpu_features(void) {
9 // CPU features already initialized.
10 if (__aarch64_cpu_features.features)
11 return;
12
13 unsigned long hwcap = getauxval(AT_HWCAP);
14 unsigned long hwcap2 = getauxval(AT_HWCAP2);
15
16 __ifunc_arg_t arg;
17 arg._size = sizeof(__ifunc_arg_t);
18 arg._hwcap = hwcap;
19 arg._hwcap2 = hwcap2;
20 __init_cpu_features_constructor(hwcap: hwcap | _IFUNC_ARG_HWCAP, arg: &arg);
21}
22

source code of compiler-rt/lib/builtins/cpu_model/aarch64/fmv/sysauxv.inc