提交 360fc9f4 编写于 作者: P Pauli

Make OPENSSL_rdtsc universally available.

If such a timer/counter register is not available, the return value is always
zero.  This matches the assembly implementations' behaviour.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/5231)
上级 2ad2281a
......@@ -355,4 +355,12 @@ int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len)
return x;
}
/*
* For systems that don't provide an instruction counter register or equivalent.
*/
uint32_t OPENSSL_rdtsc(void)
{
return 0;
}
#endif
/*
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
......@@ -94,9 +94,7 @@ FILE *openssl_fopen(const char *filename, const char *mode);
void *openssl_fopen(const char *filename, const char *mode);
# endif
#ifdef OPENSSL_CPUID_OBJ
uint32_t OPENSSL_rdtsc();
#endif
uint32_t OPENSSL_rdtsc(void);
#ifdef __cplusplus
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册