diff options
| author | Kate <kit.ty.kate@disroot.org> | 2020-08-27 21:54:04 +0100 |
|---|---|---|
| committer | Kate <kit.ty.kate@disroot.org> | 2020-08-27 21:54:04 +0100 |
| commit | 5981a1929d4da6ddb83e50f58d1d004e52e0ce3f (patch) | |
| tree | edcfe768601ae85efd6453e0970d3f60f6df3ce6 /Source/Core/Common/ArmCPUDetect.cpp | |
| parent | c36ae84b966327bd9d78d3eabf2309f82d37792e (diff) | |
Add support for FreeBSD/arm64
Diffstat (limited to 'Source/Core/Common/ArmCPUDetect.cpp')
| -rw-r--r-- | Source/Core/Common/ArmCPUDetect.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/Common/ArmCPUDetect.cpp b/Source/Core/Common/ArmCPUDetect.cpp index 53026bf5d2..7fb0ef6765 100644 --- a/Source/Core/Common/ArmCPUDetect.cpp +++ b/Source/Core/Common/ArmCPUDetect.cpp @@ -9,7 +9,9 @@ #include <thread> #ifndef _WIN32 +#ifndef __FreeBSD__ #include <asm/hwcap.h> +#endif #include <sys/auxv.h> #include <unistd.h> #endif @@ -87,7 +89,12 @@ void CPUInfo::Detect() num_cores = sysconf(_SC_NPROCESSORS_CONF); strncpy(cpu_string, GetCPUString().c_str(), sizeof(cpu_string)); +#ifdef __FreeBSD__ + u_long hwcaps = 0; + elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long)); +#else unsigned long hwcaps = getauxval(AT_HWCAP); +#endif bFP = hwcaps & HWCAP_FP; bASIMD = hwcaps & HWCAP_ASIMD; bAES = hwcaps & HWCAP_AES; |
