ssh lib

Dependents:   OS

Committer:
sPymbed
Date:
Mon Nov 25 14:23:49 2019 +0000
Revision:
1:e4ea39eba2fb
Parent:
0:1387ff3eed4a
improved

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sPymbed 0:1387ff3eed4a 1 /* cpuid.h
sPymbed 0:1387ff3eed4a 2 *
sPymbed 0:1387ff3eed4a 3 * Copyright (C) 2006-2017 wolfSSL Inc.
sPymbed 0:1387ff3eed4a 4 *
sPymbed 0:1387ff3eed4a 5 * This file is part of wolfSSL.
sPymbed 0:1387ff3eed4a 6 *
sPymbed 0:1387ff3eed4a 7 * wolfSSL is free software; you can redistribute it and/or modify
sPymbed 0:1387ff3eed4a 8 * it under the terms of the GNU General Public License as published by
sPymbed 0:1387ff3eed4a 9 * the Free Software Foundation; either version 2 of the License, or
sPymbed 0:1387ff3eed4a 10 * (at your option) any later version.
sPymbed 0:1387ff3eed4a 11 *
sPymbed 0:1387ff3eed4a 12 * wolfSSL is distributed in the hope that it will be useful,
sPymbed 0:1387ff3eed4a 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
sPymbed 0:1387ff3eed4a 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
sPymbed 0:1387ff3eed4a 15 * GNU General Public License for more details.
sPymbed 0:1387ff3eed4a 16 *
sPymbed 0:1387ff3eed4a 17 * You should have received a copy of the GNU General Public License
sPymbed 0:1387ff3eed4a 18 * along with this program; if not, write to the Free Software
sPymbed 0:1387ff3eed4a 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
sPymbed 0:1387ff3eed4a 20 */
sPymbed 0:1387ff3eed4a 21
sPymbed 0:1387ff3eed4a 22
sPymbed 0:1387ff3eed4a 23
sPymbed 0:1387ff3eed4a 24 #ifndef WOLF_CRYPT_CPUID_H
sPymbed 0:1387ff3eed4a 25 #define WOLF_CRYPT_CPUID_H
sPymbed 0:1387ff3eed4a 26
sPymbed 0:1387ff3eed4a 27
sPymbed 0:1387ff3eed4a 28 #include <wolfcrypt/types.h>
sPymbed 0:1387ff3eed4a 29
sPymbed 0:1387ff3eed4a 30
sPymbed 0:1387ff3eed4a 31 #ifdef __cplusplus
sPymbed 0:1387ff3eed4a 32 extern "C" {
sPymbed 0:1387ff3eed4a 33 #endif
sPymbed 0:1387ff3eed4a 34
sPymbed 0:1387ff3eed4a 35 #if defined(WOLFSSL_X86_64_BUILD) || defined(USE_INTEL_SPEEDUP) || \
sPymbed 0:1387ff3eed4a 36 defined(WOLFSSL_AESNI)
sPymbed 0:1387ff3eed4a 37 #define CPUID_AVX1 0x0001
sPymbed 0:1387ff3eed4a 38 #define CPUID_AVX2 0x0002
sPymbed 0:1387ff3eed4a 39 #define CPUID_RDRAND 0x0004
sPymbed 0:1387ff3eed4a 40 #define CPUID_RDSEED 0x0008
sPymbed 0:1387ff3eed4a 41 #define CPUID_BMI2 0x0010 /* MULX, RORX */
sPymbed 0:1387ff3eed4a 42 #define CPUID_AESNI 0x0020
sPymbed 0:1387ff3eed4a 43 #define CPUID_ADX 0x0040 /* ADCX, ADOX */
sPymbed 0:1387ff3eed4a 44
sPymbed 0:1387ff3eed4a 45 #define IS_INTEL_AVX1(f) ((f) & CPUID_AVX1)
sPymbed 0:1387ff3eed4a 46 #define IS_INTEL_AVX2(f) ((f) & CPUID_AVX2)
sPymbed 0:1387ff3eed4a 47 #define IS_INTEL_RDRAND(f) ((f) & CPUID_RDRAND)
sPymbed 0:1387ff3eed4a 48 #define IS_INTEL_RDSEED(f) ((f) & CPUID_RDSEED)
sPymbed 0:1387ff3eed4a 49 #define IS_INTEL_BMI2(f) ((f) & CPUID_BMI2)
sPymbed 0:1387ff3eed4a 50 #define IS_INTEL_AESNI(f) ((f) & CPUID_AESNI)
sPymbed 0:1387ff3eed4a 51 #define IS_INTEL_ADX(f) ((f) & CPUID_ADX)
sPymbed 0:1387ff3eed4a 52
sPymbed 0:1387ff3eed4a 53 void cpuid_set_flags(void);
sPymbed 0:1387ff3eed4a 54 word32 cpuid_get_flags(void);
sPymbed 0:1387ff3eed4a 55 #endif
sPymbed 0:1387ff3eed4a 56
sPymbed 0:1387ff3eed4a 57 #ifdef __cplusplus
sPymbed 0:1387ff3eed4a 58 } /* extern "C" */
sPymbed 0:1387ff3eed4a 59 #endif
sPymbed 0:1387ff3eed4a 60
sPymbed 0:1387ff3eed4a 61
sPymbed 0:1387ff3eed4a 62 #endif /* WOLF_CRYPT_CPUID_H */
sPymbed 0:1387ff3eed4a 63