arm-config.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Copyright (C) 2012-2015 Free Software Foundation, Inc.
  2. Contributed by Richard Henderson <rth@redhat.com>.
  3. This file is part of the GNU Atomic Library (libatomic).
  4. Libatomic is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. more details.
  12. Under Section 7 of GPL version 3, you are granted additional
  13. permissions described in the GCC Runtime Library Exception, version
  14. 3.1, as published by the Free Software Foundation.
  15. You should have received a copy of the GNU General Public License and
  16. a copy of the GCC Runtime Library Exception along with this program;
  17. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. <http://www.gnu.org/licenses/>. */
  19. #if defined(__ARM_ARCH_2__)
  20. # define __ARM_ARCH__ 2
  21. #endif
  22. #if defined(__ARM_ARCH_3__)
  23. # define __ARM_ARCH__ 3
  24. #endif
  25. #if defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__) \
  26. || defined(__ARM_ARCH_4T__)
  27. /* We use __ARM_ARCH__ set to 4 here, but in reality it's any processor with
  28. long multiply instructions. That includes v3M. */
  29. # define __ARM_ARCH__ 4
  30. #endif
  31. #if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
  32. || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
  33. || defined(__ARM_ARCH_5TEJ__)
  34. # define __ARM_ARCH__ 5
  35. #endif
  36. #if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
  37. || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
  38. || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
  39. || defined(__ARM_ARCH_6M__)
  40. # define __ARM_ARCH__ 6
  41. #endif
  42. #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
  43. || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
  44. || defined(__ARM_ARCH_7EM__)
  45. # define __ARM_ARCH__ 7
  46. #endif
  47. #if defined(__ARM_ARCH_8A__)
  48. # define __ARM_ARCH__ 8
  49. #endif
  50. #ifndef __ARM_ARCH__
  51. #error Unable to determine architecture.
  52. #endif
  53. #if __ARM_ARCH__ >= 7 || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__)
  54. # define HAVE_STREX 1
  55. # define HAVE_STREXBHD 1
  56. #elif __ARM_ARCH__ == 6
  57. # define HAVE_STREX 1
  58. #endif
  59. #if __ARM_ARCH__ >= 7
  60. # define HAVE_DMB 1
  61. #elif __ARM_ARCH__ == 6
  62. # define HAVE_DMB_MCR 1
  63. #endif