mirror of
https://git.freebsd.org/ports.git
synced 2025-05-17 09:33:11 -04:00
24 lines
607 B
C++
24 lines
607 B
C++
--- mysys/crc32/crc32c.cc.orig 2021-08-04 18:00:35 UTC
|
|
+++ mysys/crc32/crc32c.cc
|
|
@@ -543,6 +543,21 @@ static int arch_ppc_probe(void) {
|
|
|
|
return arch_ppc_crc32;
|
|
}
|
|
+#elif __FreeBSD__
|
|
+#include <machine/cpu.h>
|
|
+#include <sys/auxv.h>
|
|
+#include <sys/elf_common.h>
|
|
+static int arch_ppc_probe(void) {
|
|
+ unsigned long cpufeatures;
|
|
+ arch_ppc_crc32 = 0;
|
|
+
|
|
+#if defined(__powerpc64__)
|
|
+ elf_aux_info(AT_HWCAP2, &cpufeatures, sizeof(cpufeatures));
|
|
+ if (cpufeatures & PPC_FEATURE2_HAS_VEC_CRYPTO) arch_ppc_crc32 = 1;
|
|
+#endif /* __powerpc64__ */
|
|
+
|
|
+ return arch_ppc_crc32;
|
|
+}
|
|
#endif // __linux__
|
|
#endif
|
|
|