| 1 | void __init_cpu_features_resolver(unsigned long hwcap, |
|---|---|
| 2 | const __ifunc_arg_t *arg) { |
| 3 | if (__atomic_load_n(&__aarch64_cpu_features.features, __ATOMIC_RELAXED)) |
| 4 | return; |
| 5 | __init_cpu_features_constructor(hwcap, arg); |
| 6 | } |
| 7 | |
| 8 | void CONSTRUCTOR_ATTRIBUTE __init_cpu_features(void) { |
| 9 | // CPU features already initialized. |
| 10 | if (__atomic_load_n(&__aarch64_cpu_features.features, __ATOMIC_RELAXED)) |
| 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 |
