Path: blob/main/multimedia/aom/files/patch-aom__ports_aarch64__cpudetect.c
16461 views
- Implement runtime detection on FreeBSD12--- aom_ports/aarch64_cpudetect.c.orig 2023-11-30 23:18:12 UTC3+++ aom_ports/aarch64_cpudetect.c4@@ -95,9 +95,23 @@ static int arm_get_cpu_caps(void) {5return flags;6}78-#elif defined(__linux__) // end defined(AOM_USE_ANDROID_CPU_FEATURES)9+#elif defined(__linux__) || defined(__FreeBSD__) // end defined(AOM_USE_ANDROID_CPU_FEATURES)1011#include <sys/auxv.h>12+13+#if defined(__FreeBSD__)14+static unsigned long getauxval(unsigned long type)15+{16+ /* Only AT_HWCAP* return unsigned long */17+ if (type != AT_HWCAP && type != AT_HWCAP2) {18+ return 0;19+ }20+21+ unsigned long ret = 0;22+ elf_aux_info(type, &ret, sizeof(ret));23+ return ret;24+}25+#endif2627// Define hwcap values ourselves: building with an old auxv header where these28// hwcap values are not defined should not prevent features from being enabled.293031