mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-04 11:09:00 -04:00
Use -1 as uninitialised marker
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
4566132163
commit
b30adce7fd
@ -99,7 +99,7 @@
|
|||||||
#include <asm/hwcap.h>
|
#include <asm/hwcap.h>
|
||||||
#include <sys/auxv.h>
|
#include <sys/auxv.h>
|
||||||
|
|
||||||
char mbedtls_aesce_has_support_result = 2;
|
signed char mbedtls_aesce_has_support_result = -1;
|
||||||
|
|
||||||
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
||||||
/*
|
/*
|
||||||
@ -113,7 +113,7 @@ int mbedtls_aesce_has_support_impl(void)
|
|||||||
* It is possible that we could end up setting result more than
|
* It is possible that we could end up setting result more than
|
||||||
* once, but that is harmless.
|
* once, but that is harmless.
|
||||||
*/
|
*/
|
||||||
if (mbedtls_aesce_has_support_result == 2) {
|
if (mbedtls_aesce_has_support_result == -1) {
|
||||||
unsigned long auxval = getauxval(AT_HWCAP);
|
unsigned long auxval = getauxval(AT_HWCAP);
|
||||||
if ((auxval & (HWCAP_ASIMD | HWCAP_AES)) ==
|
if ((auxval & (HWCAP_ASIMD | HWCAP_AES)) ==
|
||||||
(HWCAP_ASIMD | HWCAP_AES)) {
|
(HWCAP_ASIMD | HWCAP_AES)) {
|
||||||
|
@ -44,7 +44,7 @@ extern "C" {
|
|||||||
|
|
||||||
#if defined(__linux__) && !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
#if defined(__linux__) && !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
||||||
|
|
||||||
extern char mbedtls_aesce_has_support_result;
|
extern signed char mbedtls_aesce_has_support_result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Internal function to detect the crypto extension in CPUs.
|
* \brief Internal function to detect the crypto extension in CPUs.
|
||||||
@ -53,7 +53,7 @@ extern char mbedtls_aesce_has_support_result;
|
|||||||
*/
|
*/
|
||||||
int mbedtls_aesce_has_support_impl(void);
|
int mbedtls_aesce_has_support_impl(void);
|
||||||
|
|
||||||
#define mbedtls_aesce_has_support() (mbedtls_aesce_has_support_result == 2 ? \
|
#define mbedtls_aesce_has_support() (mbedtls_aesce_has_support_result == -1 ? \
|
||||||
mbedtls_aesce_has_support_impl() : \
|
mbedtls_aesce_has_support_impl() : \
|
||||||
mbedtls_aesce_has_support_result)
|
mbedtls_aesce_has_support_result)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user