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