mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
OPENSSL_cpuid_setup FreeBSD arm update.
when possible using the getauxval equivalent which has similar ids as Linux, instead of bad instructions catch approach. Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13650)
This commit is contained in:
parent
b57ec7394a
commit
5eb24fbd1c
@ -71,6 +71,23 @@ void OPENSSL_cpuid_setup(void) __attribute__ ((constructor));
|
||||
# define OSSL_IMPLEMENT_GETAUXVAL
|
||||
# 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
|
||||
|
||||
/*
|
||||
* ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas
|
||||
|
Loading…
Reference in New Issue
Block a user