__libunwind_config.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef ____LIBUNWIND_CONFIG_H__
  9. #define ____LIBUNWIND_CONFIG_H__
  10. #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
  11. !defined(__ARM_DWARF_EH__)
  12. #define _LIBUNWIND_ARM_EHABI
  13. #endif
  14. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86 8
  15. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64 32
  16. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC 112
  17. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64 116
  18. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 95
  19. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM 287
  20. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K 32
  21. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS 65
  22. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31
  23. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64 31
  24. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34
  25. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64
  26. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143
  27. #if defined(_LIBUNWIND_IS_NATIVE_ONLY)
  28. # if defined(__linux__)
  29. # define _LIBUNWIND_TARGET_LINUX 1
  30. # endif
  31. # if defined(__i386__)
  32. # define _LIBUNWIND_TARGET_I386
  33. # define _LIBUNWIND_CONTEXT_SIZE 8
  34. # define _LIBUNWIND_CURSOR_SIZE 15
  35. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86
  36. # elif defined(__x86_64__)
  37. # define _LIBUNWIND_TARGET_X86_64 1
  38. # if defined(_WIN64)
  39. # define _LIBUNWIND_CONTEXT_SIZE 54
  40. # ifdef __SEH__
  41. # define _LIBUNWIND_CURSOR_SIZE 204
  42. # else
  43. # define _LIBUNWIND_CURSOR_SIZE 66
  44. # endif
  45. # else
  46. # define _LIBUNWIND_CONTEXT_SIZE 21
  47. # define _LIBUNWIND_CURSOR_SIZE 33
  48. # endif
  49. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64
  50. # elif defined(__powerpc64__)
  51. # define _LIBUNWIND_TARGET_PPC64 1
  52. # define _LIBUNWIND_CONTEXT_SIZE 167
  53. # define _LIBUNWIND_CURSOR_SIZE 179
  54. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
  55. # elif defined(__powerpc__)
  56. # define _LIBUNWIND_TARGET_PPC 1
  57. # define _LIBUNWIND_CONTEXT_SIZE 117
  58. # define _LIBUNWIND_CURSOR_SIZE 124
  59. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC
  60. # elif defined(__aarch64__)
  61. # define _LIBUNWIND_TARGET_AARCH64 1
  62. # define _LIBUNWIND_CONTEXT_SIZE 66
  63. # if defined(__SEH__)
  64. # define _LIBUNWIND_CURSOR_SIZE 164
  65. # else
  66. # define _LIBUNWIND_CURSOR_SIZE 78
  67. # endif
  68. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64
  69. # elif defined(__arm__)
  70. # define _LIBUNWIND_TARGET_ARM 1
  71. # if defined(__SEH__)
  72. # define _LIBUNWIND_CONTEXT_SIZE 42
  73. # define _LIBUNWIND_CURSOR_SIZE 80
  74. # elif defined(__ARM_WMMX)
  75. # define _LIBUNWIND_CONTEXT_SIZE 61
  76. # define _LIBUNWIND_CURSOR_SIZE 68
  77. # else
  78. # define _LIBUNWIND_CONTEXT_SIZE 42
  79. # define _LIBUNWIND_CURSOR_SIZE 49
  80. # endif
  81. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM
  82. # elif defined(__or1k__)
  83. # define _LIBUNWIND_TARGET_OR1K 1
  84. # define _LIBUNWIND_CONTEXT_SIZE 16
  85. # define _LIBUNWIND_CURSOR_SIZE 24
  86. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K
  87. # elif defined(__hexagon__)
  88. # define _LIBUNWIND_TARGET_HEXAGON 1
  89. // Values here change when : Registers.hpp - hexagon_thread_state_t change
  90. # define _LIBUNWIND_CONTEXT_SIZE 18
  91. # define _LIBUNWIND_CURSOR_SIZE 24
  92. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON
  93. # elif defined(__mips__)
  94. # if defined(_ABIO32) && _MIPS_SIM == _ABIO32
  95. # define _LIBUNWIND_TARGET_MIPS_O32 1
  96. # if defined(__mips_hard_float)
  97. # define _LIBUNWIND_CONTEXT_SIZE 50
  98. # define _LIBUNWIND_CURSOR_SIZE 57
  99. # else
  100. # define _LIBUNWIND_CONTEXT_SIZE 18
  101. # define _LIBUNWIND_CURSOR_SIZE 24
  102. # endif
  103. # elif defined(_ABIN32) && _MIPS_SIM == _ABIN32
  104. # define _LIBUNWIND_TARGET_MIPS_NEWABI 1
  105. # if defined(__mips_hard_float)
  106. # define _LIBUNWIND_CONTEXT_SIZE 67
  107. # define _LIBUNWIND_CURSOR_SIZE 74
  108. # else
  109. # define _LIBUNWIND_CONTEXT_SIZE 35
  110. # define _LIBUNWIND_CURSOR_SIZE 42
  111. # endif
  112. # elif defined(_ABI64) && _MIPS_SIM == _ABI64
  113. # define _LIBUNWIND_TARGET_MIPS_NEWABI 1
  114. # if defined(__mips_hard_float)
  115. # define _LIBUNWIND_CONTEXT_SIZE 67
  116. # define _LIBUNWIND_CURSOR_SIZE 79
  117. # else
  118. # define _LIBUNWIND_CONTEXT_SIZE 35
  119. # define _LIBUNWIND_CURSOR_SIZE 47
  120. # endif
  121. # else
  122. # error "Unsupported MIPS ABI and/or environment"
  123. # endif
  124. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS
  125. #elif defined(__sparc__) && defined(__arch64__)
  126. #define _LIBUNWIND_TARGET_SPARC64 1
  127. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
  128. _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64
  129. #define _LIBUNWIND_CONTEXT_SIZE 33
  130. #define _LIBUNWIND_CURSOR_SIZE 45
  131. # elif defined(__sparc__)
  132. #define _LIBUNWIND_TARGET_SPARC 1
  133. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC
  134. #define _LIBUNWIND_CONTEXT_SIZE 16
  135. #define _LIBUNWIND_CURSOR_SIZE 23
  136. # elif defined(__riscv)
  137. # define _LIBUNWIND_TARGET_RISCV 1
  138. # if defined(__riscv_flen)
  139. # define RISCV_FLEN __riscv_flen
  140. # else
  141. # define RISCV_FLEN 0
  142. # endif
  143. # define _LIBUNWIND_CONTEXT_SIZE (32 * (__riscv_xlen + RISCV_FLEN) / 64)
  144. # if __riscv_xlen == 32
  145. # define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 7)
  146. # elif __riscv_xlen == 64
  147. # define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 12)
  148. # else
  149. # error "Unsupported RISC-V ABI"
  150. # endif
  151. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
  152. # elif defined(__ve__)
  153. # define _LIBUNWIND_TARGET_VE 1
  154. # define _LIBUNWIND_CONTEXT_SIZE 67
  155. # define _LIBUNWIND_CURSOR_SIZE 79
  156. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE
  157. # else
  158. # error "Unsupported architecture."
  159. # endif
  160. #else // !_LIBUNWIND_IS_NATIVE_ONLY
  161. # define _LIBUNWIND_TARGET_I386
  162. # define _LIBUNWIND_TARGET_X86_64 1
  163. # define _LIBUNWIND_TARGET_PPC 1
  164. # define _LIBUNWIND_TARGET_PPC64 1
  165. # define _LIBUNWIND_TARGET_AARCH64 1
  166. # define _LIBUNWIND_TARGET_ARM 1
  167. # define _LIBUNWIND_TARGET_OR1K 1
  168. # define _LIBUNWIND_TARGET_MIPS_O32 1
  169. # define _LIBUNWIND_TARGET_MIPS_NEWABI 1
  170. # define _LIBUNWIND_TARGET_SPARC 1
  171. # define _LIBUNWIND_TARGET_SPARC64 1
  172. # define _LIBUNWIND_TARGET_HEXAGON 1
  173. # define _LIBUNWIND_TARGET_RISCV 1
  174. # define _LIBUNWIND_TARGET_VE 1
  175. # define _LIBUNWIND_CONTEXT_SIZE 167
  176. # define _LIBUNWIND_CURSOR_SIZE 179
  177. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
  178. #endif // _LIBUNWIND_IS_NATIVE_ONLY
  179. #endif // ____LIBUNWIND_CONFIG_H__