__libunwind_config.h 6.3 KB

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