mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-26 16:02:22 +01:00
Merge pull request #9138 from JacobBarthelmeh/sgx
update for SGX CPU ID to follow atomics refactor
This commit is contained in:
@@ -5,6 +5,11 @@ CFLAGS_NEW="-DDEBUG_WOLFSSL -I/usr/lib/gcc/x86_64-linux-gnu/$(gcc -dumpversion)/
|
||||
export CFLAGS="${CFLAGS} ${CFLAGS_NEW}"
|
||||
echo ${CFLAGS}
|
||||
|
||||
# create an empty options.h file if none exist
|
||||
if [ ! -f ../../wolfssl/options.h ]; then
|
||||
touch ../../wolfssl/options.h
|
||||
fi
|
||||
|
||||
NEW_INCLUDE_PATH="$C_INCLUDE_PATH:/usr/lib/gcc/x86_64-linux-gnu/$(gcc -dumpversion)/include"
|
||||
export C_INCLUDE_PATH="$NEW_INCLUDE_PATH"
|
||||
|
||||
|
||||
@@ -41,17 +41,21 @@
|
||||
*/
|
||||
void cpuid_set_flags(void)
|
||||
{
|
||||
if (!cpuid_check) {
|
||||
cpuid_flags |= CPUID_AVX1;
|
||||
cpuid_flags |= CPUID_AVX2;
|
||||
cpuid_flags |= CPUID_BMI2;
|
||||
cpuid_flags |= CPUID_RDSEED;
|
||||
cpuid_flags |= CPUID_AESNI;
|
||||
cpuid_flags |= CPUID_ADX;
|
||||
cpuid_flags |= CPUID_MOVBE;
|
||||
cpuid_flags |= CPUID_BMI1;
|
||||
if (WOLFSSL_ATOMIC_LOAD(cpuid_flags) == WC_CPUID_INITIALIZER) {
|
||||
cpuid_flags_t new_cpuid_flags = 0,
|
||||
old_cpuid_flags = WC_CPUID_INITIALIZER;
|
||||
|
||||
cpuid_check = 1;
|
||||
new_cpuid_flags |= CPUID_AVX1;
|
||||
new_cpuid_flags |= CPUID_AVX2;
|
||||
new_cpuid_flags |= CPUID_BMI2;
|
||||
new_cpuid_flags |= CPUID_RDSEED;
|
||||
new_cpuid_flags |= CPUID_AESNI;
|
||||
new_cpuid_flags |= CPUID_ADX;
|
||||
new_cpuid_flags |= CPUID_MOVBE;
|
||||
new_cpuid_flags |= CPUID_BMI1;
|
||||
|
||||
(void)wolfSSL_Atomic_Uint_CompareExchange
|
||||
(&cpuid_flags, &old_cpuid_flags, new_cpuid_flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user