arm_arch.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef __ARM_ARCH_H__
  2. # define __ARM_ARCH_H__
  3. # if !defined(__ARM_ARCH__)
  4. # if defined(__CC_ARM)
  5. # define __ARM_ARCH__ __TARGET_ARCH_ARM
  6. # if defined(__BIG_ENDIAN)
  7. # define __ARMEB__
  8. # else
  9. # define __ARMEL__
  10. # endif
  11. # elif defined(__GNUC__)
  12. # if defined(__aarch64__)
  13. # define __ARM_ARCH__ 8
  14. # if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
  15. # define __ARMEB__
  16. # else
  17. # define __ARMEL__
  18. # endif
  19. /*
  20. * Why doesn't gcc define __ARM_ARCH__? Instead it defines
  21. * bunch of below macros. See all_architectires[] table in
  22. * gcc/config/arm/arm.c. On a side note it defines
  23. * __ARMEL__/__ARMEB__ for little-/big-endian.
  24. */
  25. # elif defined(__ARM_ARCH)
  26. # define __ARM_ARCH__ __ARM_ARCH
  27. # elif defined(__ARM_ARCH_8A__)
  28. # define __ARM_ARCH__ 8
  29. # elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
  30. defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \
  31. defined(__ARM_ARCH_7EM__)
  32. # define __ARM_ARCH__ 7
  33. # elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
  34. defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \
  35. defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \
  36. defined(__ARM_ARCH_6T2__)
  37. # define __ARM_ARCH__ 6
  38. # elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
  39. defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \
  40. defined(__ARM_ARCH_5TEJ__)
  41. # define __ARM_ARCH__ 5
  42. # elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
  43. # define __ARM_ARCH__ 4
  44. # else
  45. # error "unsupported ARM architecture"
  46. # endif
  47. # endif
  48. # endif
  49. # ifdef OPENSSL_FIPSCANISTER
  50. # include <openssl/fipssyms.h>
  51. # endif
  52. # if !defined(__ARM_MAX_ARCH__)
  53. # define __ARM_MAX_ARCH__ __ARM_ARCH__
  54. # endif
  55. # if __ARM_MAX_ARCH__<__ARM_ARCH__
  56. # error "__ARM_MAX_ARCH__ can't be less than __ARM_ARCH__"
  57. # elif __ARM_MAX_ARCH__!=__ARM_ARCH__
  58. # if __ARM_ARCH__<7 && __ARM_MAX_ARCH__>=7 && defined(__ARMEB__)
  59. # error "can't build universal big-endian binary"
  60. # endif
  61. # endif
  62. # if !__ASSEMBLER__
  63. extern unsigned int OPENSSL_armcap_P;
  64. # endif
  65. # define ARMV7_NEON (1<<0)
  66. # define ARMV7_TICK (1<<1)
  67. # define ARMV8_AES (1<<2)
  68. # define ARMV8_SHA1 (1<<3)
  69. # define ARMV8_SHA256 (1<<4)
  70. # define ARMV8_PMULL (1<<5)
  71. #endif