__libunwind_config.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. #define _LIBUNWIND_VERSION 15000
  11. #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
  12. !defined(__ARM_DWARF_EH__) && !defined(__SEH__)
  13. #define _LIBUNWIND_ARM_EHABI
  14. #endif
  15. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86 8
  16. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64 32
  17. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC 112
  18. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64 116
  19. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 95
  20. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM 287
  21. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K 32
  22. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS 65
  23. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31
  24. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64 31
  25. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34
  26. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64
  27. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143
  28. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_S390X 83
  29. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH 64
  30. #if defined(_LIBUNWIND_IS_NATIVE_ONLY)
  31. # if defined(__linux__)
  32. # define _LIBUNWIND_TARGET_LINUX 1
  33. # endif
  34. # if defined(__HAIKU__)
  35. # define _LIBUNWIND_TARGET_HAIKU 1
  36. # endif
  37. # if defined(__i386__)
  38. # define _LIBUNWIND_TARGET_I386
  39. # define _LIBUNWIND_CONTEXT_SIZE 8
  40. # define _LIBUNWIND_CURSOR_SIZE 15
  41. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86
  42. # elif defined(__x86_64__)
  43. # define _LIBUNWIND_TARGET_X86_64 1
  44. # if defined(_WIN64)
  45. # define _LIBUNWIND_CONTEXT_SIZE 54
  46. # ifdef __SEH__
  47. # define _LIBUNWIND_CURSOR_SIZE 204
  48. # else
  49. # define _LIBUNWIND_CURSOR_SIZE 66
  50. # endif
  51. # else
  52. # define _LIBUNWIND_CONTEXT_SIZE 21
  53. # define _LIBUNWIND_CURSOR_SIZE 33
  54. # endif
  55. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64
  56. # elif defined(__powerpc64__)
  57. # define _LIBUNWIND_TARGET_PPC64 1
  58. # define _LIBUNWIND_CONTEXT_SIZE 167
  59. # define _LIBUNWIND_CURSOR_SIZE 179
  60. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
  61. # elif defined(__powerpc__)
  62. # define _LIBUNWIND_TARGET_PPC 1
  63. # define _LIBUNWIND_CONTEXT_SIZE 117
  64. # define _LIBUNWIND_CURSOR_SIZE 124
  65. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC
  66. # elif defined(__aarch64__)
  67. # define _LIBUNWIND_TARGET_AARCH64 1
  68. # define _LIBUNWIND_CONTEXT_SIZE 66
  69. # if defined(__SEH__)
  70. # define _LIBUNWIND_CURSOR_SIZE 164
  71. # else
  72. # define _LIBUNWIND_CURSOR_SIZE 78
  73. # endif
  74. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64
  75. # elif defined(__arm__)
  76. # define _LIBUNWIND_TARGET_ARM 1
  77. # if defined(__SEH__)
  78. # define _LIBUNWIND_CONTEXT_SIZE 42
  79. # define _LIBUNWIND_CURSOR_SIZE 80
  80. # elif defined(__ARM_WMMX)
  81. # define _LIBUNWIND_CONTEXT_SIZE 61
  82. # define _LIBUNWIND_CURSOR_SIZE 68
  83. # else
  84. # define _LIBUNWIND_CONTEXT_SIZE 42
  85. # define _LIBUNWIND_CURSOR_SIZE 49
  86. # endif
  87. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM
  88. # elif defined(__or1k__)
  89. # define _LIBUNWIND_TARGET_OR1K 1
  90. # define _LIBUNWIND_CONTEXT_SIZE 16
  91. # define _LIBUNWIND_CURSOR_SIZE 24
  92. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K
  93. # elif defined(__hexagon__)
  94. # define _LIBUNWIND_TARGET_HEXAGON 1
  95. // Values here change when : Registers.hpp - hexagon_thread_state_t change
  96. # define _LIBUNWIND_CONTEXT_SIZE 18
  97. # define _LIBUNWIND_CURSOR_SIZE 24
  98. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON
  99. # elif defined(__mips__)
  100. # if defined(_ABIO32) && _MIPS_SIM == _ABIO32
  101. # define _LIBUNWIND_TARGET_MIPS_O32 1
  102. # if defined(__mips_hard_float)
  103. # define _LIBUNWIND_CONTEXT_SIZE 50
  104. # define _LIBUNWIND_CURSOR_SIZE 57
  105. # else
  106. # define _LIBUNWIND_CONTEXT_SIZE 18
  107. # define _LIBUNWIND_CURSOR_SIZE 24
  108. # endif
  109. # elif defined(_ABIN32) && _MIPS_SIM == _ABIN32
  110. # define _LIBUNWIND_TARGET_MIPS_NEWABI 1
  111. # if defined(__mips_hard_float)
  112. # define _LIBUNWIND_CONTEXT_SIZE 67
  113. # define _LIBUNWIND_CURSOR_SIZE 74
  114. # else
  115. # define _LIBUNWIND_CONTEXT_SIZE 35
  116. # define _LIBUNWIND_CURSOR_SIZE 42
  117. # endif
  118. # elif defined(_ABI64) && _MIPS_SIM == _ABI64
  119. # define _LIBUNWIND_TARGET_MIPS_NEWABI 1
  120. # if defined(__mips_hard_float)
  121. # define _LIBUNWIND_CONTEXT_SIZE 67
  122. # define _LIBUNWIND_CURSOR_SIZE 79
  123. # else
  124. # define _LIBUNWIND_CONTEXT_SIZE 35
  125. # define _LIBUNWIND_CURSOR_SIZE 47
  126. # endif
  127. # else
  128. # error "Unsupported MIPS ABI and/or environment"
  129. # endif
  130. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS
  131. #elif defined(__sparc__) && defined(__arch64__)
  132. #define _LIBUNWIND_TARGET_SPARC64 1
  133. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
  134. _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64
  135. #define _LIBUNWIND_CONTEXT_SIZE 33
  136. #define _LIBUNWIND_CURSOR_SIZE 45
  137. # elif defined(__sparc__)
  138. #define _LIBUNWIND_TARGET_SPARC 1
  139. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC
  140. #define _LIBUNWIND_CONTEXT_SIZE 16
  141. #define _LIBUNWIND_CURSOR_SIZE 23
  142. # elif defined(__riscv)
  143. # define _LIBUNWIND_TARGET_RISCV 1
  144. # if defined(__riscv_flen)
  145. # define RISCV_FLEN __riscv_flen
  146. # else
  147. # define RISCV_FLEN 0
  148. # endif
  149. # define _LIBUNWIND_CONTEXT_SIZE (32 * (__riscv_xlen + RISCV_FLEN) / 64)
  150. # if __riscv_xlen == 32
  151. # define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 7)
  152. # elif __riscv_xlen == 64
  153. # define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 12)
  154. # else
  155. # error "Unsupported RISC-V ABI"
  156. # endif
  157. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
  158. # elif defined(__ve__)
  159. # define _LIBUNWIND_TARGET_VE 1
  160. # define _LIBUNWIND_CONTEXT_SIZE 67
  161. # define _LIBUNWIND_CURSOR_SIZE 79
  162. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE
  163. # elif defined(__s390x__)
  164. # define _LIBUNWIND_TARGET_S390X 1
  165. # define _LIBUNWIND_CONTEXT_SIZE 34
  166. # define _LIBUNWIND_CURSOR_SIZE 46
  167. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_S390X
  168. #elif defined(__loongarch__)
  169. #define _LIBUNWIND_TARGET_LOONGARCH 1
  170. #if __loongarch_grlen == 64
  171. #define _LIBUNWIND_CONTEXT_SIZE 65
  172. #define _LIBUNWIND_CURSOR_SIZE 77
  173. #else
  174. #error "Unsupported LoongArch ABI"
  175. #endif
  176. #define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
  177. _LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH
  178. # else
  179. # error "Unsupported architecture."
  180. # endif
  181. #else // !_LIBUNWIND_IS_NATIVE_ONLY
  182. # define _LIBUNWIND_TARGET_I386
  183. # define _LIBUNWIND_TARGET_X86_64 1
  184. # define _LIBUNWIND_TARGET_PPC 1
  185. # define _LIBUNWIND_TARGET_PPC64 1
  186. # define _LIBUNWIND_TARGET_AARCH64 1
  187. # define _LIBUNWIND_TARGET_ARM 1
  188. # define _LIBUNWIND_TARGET_OR1K 1
  189. # define _LIBUNWIND_TARGET_MIPS_O32 1
  190. # define _LIBUNWIND_TARGET_MIPS_NEWABI 1
  191. # define _LIBUNWIND_TARGET_SPARC 1
  192. # define _LIBUNWIND_TARGET_SPARC64 1
  193. # define _LIBUNWIND_TARGET_HEXAGON 1
  194. # define _LIBUNWIND_TARGET_RISCV 1
  195. # define _LIBUNWIND_TARGET_VE 1
  196. # define _LIBUNWIND_TARGET_S390X 1
  197. # define _LIBUNWIND_TARGET_LOONGARCH 1
  198. # define _LIBUNWIND_CONTEXT_SIZE 167
  199. # define _LIBUNWIND_CURSOR_SIZE 204
  200. # define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
  201. #endif // _LIBUNWIND_IS_NATIVE_ONLY
  202. #endif // ____LIBUNWIND_CONFIG_H__