diff options
author | pkubaj <pkubaj@anongoth.pl> | 2020-08-30 16:01:21 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2021-05-07 15:58:56 +0000 |
commit | 4251202d9dbb7503976fa6c651747b8e99ea0988 (patch) | |
tree | a43eb8238bb2c24e412c5273fdae5d9b39d33efc | |
parent | e93eaff517567518696cac21203bbc5efdfee426 (diff) | |
download | pixman-4251202d9dbb7503976fa6c651747b8e99ea0988.tar.gz |
Fix AltiVec detection on FreeBSD.
-rw-r--r-- | pixman/pixman-ppc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pixman/pixman-ppc.c b/pixman/pixman-ppc.c index a6e7bb0..4d5506d 100644 --- a/pixman/pixman-ppc.c +++ b/pixman/pixman-ppc.c @@ -68,6 +68,24 @@ pixman_have_vmx (void) return have_vmx; } +#elif defined (__FreeBSD__) +#include <machine/cpu.h> +#include <sys/auxv.h> + +static pixman_bool_t +pixman_have_vmx (void) +{ + + unsigned long cpufeatures; + int have_vmx; + + if (elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures))) + return FALSE; + + have_vmx = cpufeatures & PPC_FEATURE_HAS_ALTIVEC; + return have_vmx; +} + #elif defined (__linux__) #include <sys/types.h> |