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