From: David Carlier Date: Sat, 9 Jan 2021 14:17:29 +0000 (+0000) Subject: OPENSSL_cpuid_setup FreeBSD PowerPC update X-Git-Tag: openssl-3.0.0-alpha11~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b57ec7394aace731c460b509aa84039274337600;p=thirdparty%2Fopenssl.git OPENSSL_cpuid_setup FreeBSD PowerPC update Reviewed-by: Ben Kaduk Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/13821) --- diff --git a/crypto/ppccap.c b/crypto/ppccap.c index 4989e432212..d2adb0a4412 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -229,6 +229,24 @@ size_t OPENSSL_instrument_bus2(unsigned int *out, size_t cnt, size_t max) # endif #endif +#if defined(__FreeBSD__) +# include +# if __FreeBSD_version >= 1200000 +# include +# define OSSL_IMPLEMENT_GETAUXVAL + +static unsigned long getauxval(unsigned long key) +{ + unsigned long val = 0ul; + + if (elf_aux_info((int)key, &val, sizeof(val)) != 0) + return 0ul; + + return val; +} +# endif +#endif + /* I wish was universally available */ #define HWCAP 16 /* AT_HWCAP */ #define HWCAP_PPC64 (1U << 30)