Skip to content

Commit

Permalink
OPENSSL_cpuid_setup FreeBSD PowerPC update
Browse files Browse the repository at this point in the history
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from openssl#13821)
  • Loading branch information
devnexen authored and mattcaswell committed Jan 14, 2021
1 parent 879365e commit b57ec73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crypto/ppccap.c
Expand Up @@ -229,6 +229,24 @@ size_t OPENSSL_instrument_bus2(unsigned int *out, size_t cnt, size_t max)
# endif
#endif

#if defined(__FreeBSD__)
# include <sys/param.h>
# if __FreeBSD_version >= 1200000
# include <sys/auxv.h>
# 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 <sys/auxv.h> was universally available */
#define HWCAP 16 /* AT_HWCAP */
#define HWCAP_PPC64 (1U << 30)
Expand Down

0 comments on commit b57ec73

Please sign in to comment.