1392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#ifndef __ARM_ARCH_H__
2392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#define __ARM_ARCH_H__
3392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom
4392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#if !defined(__ARM_ARCH__)
5392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom# if defined(__CC_ARM)
6392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  define __ARM_ARCH__ __TARGET_ARCH_ARM
7392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  if defined(__BIG_ENDIAN)
8392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#   define __ARMEB__
9392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  else
10392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#   define __ARMEL__
11392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  endif
12392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom# elif defined(__GNUC__)
133f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#  if	defined(__aarch64__)
143f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#   define __ARM_ARCH__ 8
153f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#   if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
163f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#    define __ARMEB__
173f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#   else
183f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#    define __ARMEL__
193f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#   endif
20392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom  /*
21392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom   * Why doesn't gcc define __ARM_ARCH__? Instead it defines
22392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom   * bunch of below macros. See all_architectires[] table in
23392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom   * gcc/config/arm/arm.c. On a side note it defines
24392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom   * __ARMEL__/__ARMEB__ for little-/big-endian.
25392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom   */
263f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#  elif defined(__ARM_ARCH)
273f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#   define __ARM_ARCH__ __ARM_ARCH
283f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#  elif	defined(__ARM_ARCH_8A__)
293f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#   define __ARM_ARCH__ 8
303f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#  elif	defined(__ARM_ARCH_7__)	|| defined(__ARM_ARCH_7A__)	|| \
31392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__)	|| \
32392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	defined(__ARM_ARCH_7EM__)
33392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#   define __ARM_ARCH__ 7
34392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  elif	defined(__ARM_ARCH_6__)	|| defined(__ARM_ARCH_6J__)	|| \
35392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__)	|| \
36392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__)	|| \
37392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	defined(__ARM_ARCH_6T2__)
38392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#   define __ARM_ARCH__ 6
39392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  elif	defined(__ARM_ARCH_5__)	|| defined(__ARM_ARCH_5T__)	|| \
40392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__)	|| \
41392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom	defined(__ARM_ARCH_5TEJ__)
42392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#   define __ARM_ARCH__ 5
43392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  elif	defined(__ARM_ARCH_4__)	|| defined(__ARM_ARCH_4T__)
44392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#   define __ARM_ARCH__ 4
45392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  else
46392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#   error "unsupported ARM architecture"
47392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#  endif
48392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom# endif
49392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#endif
50392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom
51392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#ifdef OPENSSL_FIPSCANISTER
52392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#include <openssl/fipssyms.h>
53392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#endif
54392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom
55392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#if !__ASSEMBLER__
56392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstromextern unsigned int OPENSSL_armcap_P;
573f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#endif
58392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom
59392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#define ARMV7_NEON      (1<<0)
60392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#define ARMV7_TICK      (1<<1)
613f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#define ARMV8_AES       (1<<2)
623f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#define ARMV8_SHA1      (1<<3)
633f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#define ARMV8_SHA256    (1<<4)
643f9e6ada2c9f7183a41081263585e6a70bbd9f59Kenny Root#define ARMV8_PMULL     (1<<5)
65392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom
66392aa7cc7d2b122614c5393c3e357da07fd07af3Brian Carlstrom#endif
67