Lines 10-16
Link Here
|
10 |
#include <pthread.h> |
10 |
#include <pthread.h> |
11 |
#include <stdint.h> |
11 |
#include <stdint.h> |
12 |
|
12 |
|
13 |
#if defined(ARMV8_OS_ANDROID) |
13 |
int ZLIB_INTERNAL arm_cpu_enable_crc32 = 0; |
|
|
14 |
int ZLIB_INTERNAL arm_cpu_enable_pmull = 0; |
15 |
|
16 |
#îf defined (__FreeBSD__) |
17 |
#include <machine/armreg.h> |
18 |
#include <sys/types.h> |
19 |
static void init_arm_features(void) |
20 |
{ |
21 |
#if defined (__aarch64__) |
22 |
uint64_t id_aa64isar0; |
23 |
|
24 |
id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1); |
25 |
if (ID_AA64ISAR0_AES(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL) |
26 |
arm_cpu_enable_pmull = 1; |
27 |
if (ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE)) |
28 |
arm_cpu_enable_crc32 = 1; |
29 |
#endif |
30 |
} |
31 |
#elif defined(ARMV8_OS_ANDROID) |
14 |
#include <cpu-features.h> |
32 |
#include <cpu-features.h> |
15 |
#elif defined(ARMV8_OS_LINUX) |
33 |
#elif defined(ARMV8_OS_LINUX) |
16 |
#include <asm/hwcap.h> |
34 |
#include <asm/hwcap.h> |
Lines 18-26
Link Here
|
18 |
#else |
36 |
#else |
19 |
#error ### No ARM CPU features detection in your platform/OS |
37 |
#error ### No ARM CPU features detection in your platform/OS |
20 |
#endif |
38 |
#endif |
21 |
|
|
|
22 |
int ZLIB_INTERNAL arm_cpu_enable_crc32 = 0; |
23 |
int ZLIB_INTERNAL arm_cpu_enable_pmull = 0; |
24 |
|
39 |
|
25 |
static pthread_once_t cpu_check_inited_once = PTHREAD_ONCE_INIT; |
40 |
static pthread_once_t cpu_check_inited_once = PTHREAD_ONCE_INIT; |
26 |
|
41 |
|