libunwind.h 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303
  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. // Compatible with libunwind API documented at:
  9. // http://www.nongnu.org/libunwind/man/libunwind(3).html
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef __LIBUNWIND__
  13. #define __LIBUNWIND__
  14. #include "__libunwind_config.h"
  15. #include <stdint.h>
  16. #include <stddef.h>
  17. #ifdef __APPLE__
  18. #if __clang__
  19. #if __has_include(<Availability.h>)
  20. #include <Availability.h>
  21. #endif
  22. #elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
  23. #include <Availability.h>
  24. #endif
  25. #ifdef __arm__
  26. #define LIBUNWIND_AVAIL __attribute__((unavailable))
  27. #elif defined(__OSX_AVAILABLE_STARTING)
  28. #define LIBUNWIND_AVAIL __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_5_0)
  29. #else
  30. #include <AvailabilityMacros.h>
  31. #ifdef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
  32. #define LIBUNWIND_AVAIL AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
  33. #else
  34. #define LIBUNWIND_AVAIL __attribute__((unavailable))
  35. #endif
  36. #endif
  37. #else
  38. #define LIBUNWIND_AVAIL
  39. #endif
  40. #if defined(_WIN32) && defined(__SEH__)
  41. #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR __attribute__((__aligned__(16)))
  42. #else
  43. #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR
  44. #endif
  45. /* error codes */
  46. enum {
  47. UNW_ESUCCESS = 0, /* no error */
  48. UNW_EUNSPEC = -6540, /* unspecified (general) error */
  49. UNW_ENOMEM = -6541, /* out of memory */
  50. UNW_EBADREG = -6542, /* bad register number */
  51. UNW_EREADONLYREG = -6543, /* attempt to write read-only register */
  52. UNW_ESTOPUNWIND = -6544, /* stop unwinding */
  53. UNW_EINVALIDIP = -6545, /* invalid IP */
  54. UNW_EBADFRAME = -6546, /* bad frame */
  55. UNW_EINVAL = -6547, /* unsupported operation or bad value */
  56. UNW_EBADVERSION = -6548, /* unwind info has unsupported version */
  57. UNW_ENOINFO = -6549 /* no unwind info found */
  58. #if defined(_LIBUNWIND_TARGET_AARCH64) && !defined(_LIBUNWIND_IS_NATIVE_ONLY)
  59. , UNW_ECROSSRASIGNING = -6550 /* cross unwind with return address signing */
  60. #endif
  61. };
  62. struct unw_context_t {
  63. uint64_t data[_LIBUNWIND_CONTEXT_SIZE];
  64. };
  65. typedef struct unw_context_t unw_context_t;
  66. struct unw_cursor_t {
  67. uint64_t data[_LIBUNWIND_CURSOR_SIZE];
  68. } LIBUNWIND_CURSOR_ALIGNMENT_ATTR;
  69. typedef struct unw_cursor_t unw_cursor_t;
  70. typedef struct unw_addr_space *unw_addr_space_t;
  71. typedef int unw_regnum_t;
  72. typedef uintptr_t unw_word_t;
  73. #if defined(__arm__) && !defined(__ARM_DWARF_EH__) && !defined(__SEH__)
  74. typedef uint64_t unw_fpreg_t;
  75. #else
  76. typedef double unw_fpreg_t;
  77. #endif
  78. struct unw_proc_info_t {
  79. unw_word_t start_ip; /* start address of function */
  80. unw_word_t end_ip; /* address after end of function */
  81. unw_word_t lsda; /* address of language specific data area, */
  82. /* or zero if not used */
  83. unw_word_t handler; /* personality routine, or zero if not used */
  84. unw_word_t gp; /* not used */
  85. unw_word_t flags; /* not used */
  86. uint32_t format; /* compact unwind encoding, or zero if none */
  87. uint32_t unwind_info_size; /* size of DWARF unwind info, or zero if none */
  88. unw_word_t unwind_info; /* address of DWARF unwind info, or zero */
  89. unw_word_t extra; /* mach_header of mach-o image containing func */
  90. };
  91. typedef struct unw_proc_info_t unw_proc_info_t;
  92. #ifdef __cplusplus
  93. extern "C" {
  94. #endif
  95. extern int unw_getcontext(unw_context_t *) LIBUNWIND_AVAIL;
  96. extern int unw_init_local(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL;
  97. extern int unw_step(unw_cursor_t *) LIBUNWIND_AVAIL;
  98. extern int unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *) LIBUNWIND_AVAIL;
  99. extern int unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *) LIBUNWIND_AVAIL;
  100. extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) LIBUNWIND_AVAIL;
  101. extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) LIBUNWIND_AVAIL;
  102. extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL;
  103. #ifdef __arm__
  104. /* Save VFP registers in FSTMX format (instead of FSTMD). */
  105. extern void unw_save_vfp_as_X(unw_cursor_t *) LIBUNWIND_AVAIL;
  106. #endif
  107. #ifdef _AIX
  108. extern uintptr_t unw_get_data_rel_base(unw_cursor_t *) LIBUNWIND_AVAIL;
  109. #endif
  110. extern const char *unw_regname(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
  111. extern int unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *) LIBUNWIND_AVAIL;
  112. extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL;
  113. extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL;
  114. extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL;
  115. //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);
  116. extern unw_addr_space_t unw_local_addr_space;
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120. // architecture independent register numbers
  121. enum {
  122. UNW_REG_IP = -1, // instruction pointer
  123. UNW_REG_SP = -2, // stack pointer
  124. };
  125. // 32-bit x86 registers
  126. enum {
  127. UNW_X86_EAX = 0,
  128. UNW_X86_ECX = 1,
  129. UNW_X86_EDX = 2,
  130. UNW_X86_EBX = 3,
  131. UNW_X86_EBP = 4,
  132. UNW_X86_ESP = 5,
  133. UNW_X86_ESI = 6,
  134. UNW_X86_EDI = 7
  135. };
  136. // 64-bit x86_64 registers
  137. enum {
  138. UNW_X86_64_RAX = 0,
  139. UNW_X86_64_RDX = 1,
  140. UNW_X86_64_RCX = 2,
  141. UNW_X86_64_RBX = 3,
  142. UNW_X86_64_RSI = 4,
  143. UNW_X86_64_RDI = 5,
  144. UNW_X86_64_RBP = 6,
  145. UNW_X86_64_RSP = 7,
  146. UNW_X86_64_R8 = 8,
  147. UNW_X86_64_R9 = 9,
  148. UNW_X86_64_R10 = 10,
  149. UNW_X86_64_R11 = 11,
  150. UNW_X86_64_R12 = 12,
  151. UNW_X86_64_R13 = 13,
  152. UNW_X86_64_R14 = 14,
  153. UNW_X86_64_R15 = 15,
  154. UNW_X86_64_RIP = 16,
  155. UNW_X86_64_XMM0 = 17,
  156. UNW_X86_64_XMM1 = 18,
  157. UNW_X86_64_XMM2 = 19,
  158. UNW_X86_64_XMM3 = 20,
  159. UNW_X86_64_XMM4 = 21,
  160. UNW_X86_64_XMM5 = 22,
  161. UNW_X86_64_XMM6 = 23,
  162. UNW_X86_64_XMM7 = 24,
  163. UNW_X86_64_XMM8 = 25,
  164. UNW_X86_64_XMM9 = 26,
  165. UNW_X86_64_XMM10 = 27,
  166. UNW_X86_64_XMM11 = 28,
  167. UNW_X86_64_XMM12 = 29,
  168. UNW_X86_64_XMM13 = 30,
  169. UNW_X86_64_XMM14 = 31,
  170. UNW_X86_64_XMM15 = 32,
  171. };
  172. // 32-bit ppc register numbers
  173. enum {
  174. UNW_PPC_R0 = 0,
  175. UNW_PPC_R1 = 1,
  176. UNW_PPC_R2 = 2,
  177. UNW_PPC_R3 = 3,
  178. UNW_PPC_R4 = 4,
  179. UNW_PPC_R5 = 5,
  180. UNW_PPC_R6 = 6,
  181. UNW_PPC_R7 = 7,
  182. UNW_PPC_R8 = 8,
  183. UNW_PPC_R9 = 9,
  184. UNW_PPC_R10 = 10,
  185. UNW_PPC_R11 = 11,
  186. UNW_PPC_R12 = 12,
  187. UNW_PPC_R13 = 13,
  188. UNW_PPC_R14 = 14,
  189. UNW_PPC_R15 = 15,
  190. UNW_PPC_R16 = 16,
  191. UNW_PPC_R17 = 17,
  192. UNW_PPC_R18 = 18,
  193. UNW_PPC_R19 = 19,
  194. UNW_PPC_R20 = 20,
  195. UNW_PPC_R21 = 21,
  196. UNW_PPC_R22 = 22,
  197. UNW_PPC_R23 = 23,
  198. UNW_PPC_R24 = 24,
  199. UNW_PPC_R25 = 25,
  200. UNW_PPC_R26 = 26,
  201. UNW_PPC_R27 = 27,
  202. UNW_PPC_R28 = 28,
  203. UNW_PPC_R29 = 29,
  204. UNW_PPC_R30 = 30,
  205. UNW_PPC_R31 = 31,
  206. UNW_PPC_F0 = 32,
  207. UNW_PPC_F1 = 33,
  208. UNW_PPC_F2 = 34,
  209. UNW_PPC_F3 = 35,
  210. UNW_PPC_F4 = 36,
  211. UNW_PPC_F5 = 37,
  212. UNW_PPC_F6 = 38,
  213. UNW_PPC_F7 = 39,
  214. UNW_PPC_F8 = 40,
  215. UNW_PPC_F9 = 41,
  216. UNW_PPC_F10 = 42,
  217. UNW_PPC_F11 = 43,
  218. UNW_PPC_F12 = 44,
  219. UNW_PPC_F13 = 45,
  220. UNW_PPC_F14 = 46,
  221. UNW_PPC_F15 = 47,
  222. UNW_PPC_F16 = 48,
  223. UNW_PPC_F17 = 49,
  224. UNW_PPC_F18 = 50,
  225. UNW_PPC_F19 = 51,
  226. UNW_PPC_F20 = 52,
  227. UNW_PPC_F21 = 53,
  228. UNW_PPC_F22 = 54,
  229. UNW_PPC_F23 = 55,
  230. UNW_PPC_F24 = 56,
  231. UNW_PPC_F25 = 57,
  232. UNW_PPC_F26 = 58,
  233. UNW_PPC_F27 = 59,
  234. UNW_PPC_F28 = 60,
  235. UNW_PPC_F29 = 61,
  236. UNW_PPC_F30 = 62,
  237. UNW_PPC_F31 = 63,
  238. UNW_PPC_MQ = 64,
  239. UNW_PPC_LR = 65,
  240. UNW_PPC_CTR = 66,
  241. UNW_PPC_AP = 67,
  242. UNW_PPC_CR0 = 68,
  243. UNW_PPC_CR1 = 69,
  244. UNW_PPC_CR2 = 70,
  245. UNW_PPC_CR3 = 71,
  246. UNW_PPC_CR4 = 72,
  247. UNW_PPC_CR5 = 73,
  248. UNW_PPC_CR6 = 74,
  249. UNW_PPC_CR7 = 75,
  250. UNW_PPC_XER = 76,
  251. UNW_PPC_V0 = 77,
  252. UNW_PPC_V1 = 78,
  253. UNW_PPC_V2 = 79,
  254. UNW_PPC_V3 = 80,
  255. UNW_PPC_V4 = 81,
  256. UNW_PPC_V5 = 82,
  257. UNW_PPC_V6 = 83,
  258. UNW_PPC_V7 = 84,
  259. UNW_PPC_V8 = 85,
  260. UNW_PPC_V9 = 86,
  261. UNW_PPC_V10 = 87,
  262. UNW_PPC_V11 = 88,
  263. UNW_PPC_V12 = 89,
  264. UNW_PPC_V13 = 90,
  265. UNW_PPC_V14 = 91,
  266. UNW_PPC_V15 = 92,
  267. UNW_PPC_V16 = 93,
  268. UNW_PPC_V17 = 94,
  269. UNW_PPC_V18 = 95,
  270. UNW_PPC_V19 = 96,
  271. UNW_PPC_V20 = 97,
  272. UNW_PPC_V21 = 98,
  273. UNW_PPC_V22 = 99,
  274. UNW_PPC_V23 = 100,
  275. UNW_PPC_V24 = 101,
  276. UNW_PPC_V25 = 102,
  277. UNW_PPC_V26 = 103,
  278. UNW_PPC_V27 = 104,
  279. UNW_PPC_V28 = 105,
  280. UNW_PPC_V29 = 106,
  281. UNW_PPC_V30 = 107,
  282. UNW_PPC_V31 = 108,
  283. UNW_PPC_VRSAVE = 109,
  284. UNW_PPC_VSCR = 110,
  285. UNW_PPC_SPE_ACC = 111,
  286. UNW_PPC_SPEFSCR = 112
  287. };
  288. // 64-bit ppc register numbers
  289. enum {
  290. UNW_PPC64_R0 = 0,
  291. UNW_PPC64_R1 = 1,
  292. UNW_PPC64_R2 = 2,
  293. UNW_PPC64_R3 = 3,
  294. UNW_PPC64_R4 = 4,
  295. UNW_PPC64_R5 = 5,
  296. UNW_PPC64_R6 = 6,
  297. UNW_PPC64_R7 = 7,
  298. UNW_PPC64_R8 = 8,
  299. UNW_PPC64_R9 = 9,
  300. UNW_PPC64_R10 = 10,
  301. UNW_PPC64_R11 = 11,
  302. UNW_PPC64_R12 = 12,
  303. UNW_PPC64_R13 = 13,
  304. UNW_PPC64_R14 = 14,
  305. UNW_PPC64_R15 = 15,
  306. UNW_PPC64_R16 = 16,
  307. UNW_PPC64_R17 = 17,
  308. UNW_PPC64_R18 = 18,
  309. UNW_PPC64_R19 = 19,
  310. UNW_PPC64_R20 = 20,
  311. UNW_PPC64_R21 = 21,
  312. UNW_PPC64_R22 = 22,
  313. UNW_PPC64_R23 = 23,
  314. UNW_PPC64_R24 = 24,
  315. UNW_PPC64_R25 = 25,
  316. UNW_PPC64_R26 = 26,
  317. UNW_PPC64_R27 = 27,
  318. UNW_PPC64_R28 = 28,
  319. UNW_PPC64_R29 = 29,
  320. UNW_PPC64_R30 = 30,
  321. UNW_PPC64_R31 = 31,
  322. UNW_PPC64_F0 = 32,
  323. UNW_PPC64_F1 = 33,
  324. UNW_PPC64_F2 = 34,
  325. UNW_PPC64_F3 = 35,
  326. UNW_PPC64_F4 = 36,
  327. UNW_PPC64_F5 = 37,
  328. UNW_PPC64_F6 = 38,
  329. UNW_PPC64_F7 = 39,
  330. UNW_PPC64_F8 = 40,
  331. UNW_PPC64_F9 = 41,
  332. UNW_PPC64_F10 = 42,
  333. UNW_PPC64_F11 = 43,
  334. UNW_PPC64_F12 = 44,
  335. UNW_PPC64_F13 = 45,
  336. UNW_PPC64_F14 = 46,
  337. UNW_PPC64_F15 = 47,
  338. UNW_PPC64_F16 = 48,
  339. UNW_PPC64_F17 = 49,
  340. UNW_PPC64_F18 = 50,
  341. UNW_PPC64_F19 = 51,
  342. UNW_PPC64_F20 = 52,
  343. UNW_PPC64_F21 = 53,
  344. UNW_PPC64_F22 = 54,
  345. UNW_PPC64_F23 = 55,
  346. UNW_PPC64_F24 = 56,
  347. UNW_PPC64_F25 = 57,
  348. UNW_PPC64_F26 = 58,
  349. UNW_PPC64_F27 = 59,
  350. UNW_PPC64_F28 = 60,
  351. UNW_PPC64_F29 = 61,
  352. UNW_PPC64_F30 = 62,
  353. UNW_PPC64_F31 = 63,
  354. // 64: reserved
  355. UNW_PPC64_LR = 65,
  356. UNW_PPC64_CTR = 66,
  357. // 67: reserved
  358. UNW_PPC64_CR0 = 68,
  359. UNW_PPC64_CR1 = 69,
  360. UNW_PPC64_CR2 = 70,
  361. UNW_PPC64_CR3 = 71,
  362. UNW_PPC64_CR4 = 72,
  363. UNW_PPC64_CR5 = 73,
  364. UNW_PPC64_CR6 = 74,
  365. UNW_PPC64_CR7 = 75,
  366. UNW_PPC64_XER = 76,
  367. UNW_PPC64_V0 = 77,
  368. UNW_PPC64_V1 = 78,
  369. UNW_PPC64_V2 = 79,
  370. UNW_PPC64_V3 = 80,
  371. UNW_PPC64_V4 = 81,
  372. UNW_PPC64_V5 = 82,
  373. UNW_PPC64_V6 = 83,
  374. UNW_PPC64_V7 = 84,
  375. UNW_PPC64_V8 = 85,
  376. UNW_PPC64_V9 = 86,
  377. UNW_PPC64_V10 = 87,
  378. UNW_PPC64_V11 = 88,
  379. UNW_PPC64_V12 = 89,
  380. UNW_PPC64_V13 = 90,
  381. UNW_PPC64_V14 = 91,
  382. UNW_PPC64_V15 = 92,
  383. UNW_PPC64_V16 = 93,
  384. UNW_PPC64_V17 = 94,
  385. UNW_PPC64_V18 = 95,
  386. UNW_PPC64_V19 = 96,
  387. UNW_PPC64_V20 = 97,
  388. UNW_PPC64_V21 = 98,
  389. UNW_PPC64_V22 = 99,
  390. UNW_PPC64_V23 = 100,
  391. UNW_PPC64_V24 = 101,
  392. UNW_PPC64_V25 = 102,
  393. UNW_PPC64_V26 = 103,
  394. UNW_PPC64_V27 = 104,
  395. UNW_PPC64_V28 = 105,
  396. UNW_PPC64_V29 = 106,
  397. UNW_PPC64_V30 = 107,
  398. UNW_PPC64_V31 = 108,
  399. // 109, 111-113: OpenPOWER ELF V2 ABI: reserved
  400. // Borrowing VRSAVE number from PPC32.
  401. UNW_PPC64_VRSAVE = 109,
  402. UNW_PPC64_VSCR = 110,
  403. UNW_PPC64_TFHAR = 114,
  404. UNW_PPC64_TFIAR = 115,
  405. UNW_PPC64_TEXASR = 116,
  406. UNW_PPC64_VS0 = UNW_PPC64_F0,
  407. UNW_PPC64_VS1 = UNW_PPC64_F1,
  408. UNW_PPC64_VS2 = UNW_PPC64_F2,
  409. UNW_PPC64_VS3 = UNW_PPC64_F3,
  410. UNW_PPC64_VS4 = UNW_PPC64_F4,
  411. UNW_PPC64_VS5 = UNW_PPC64_F5,
  412. UNW_PPC64_VS6 = UNW_PPC64_F6,
  413. UNW_PPC64_VS7 = UNW_PPC64_F7,
  414. UNW_PPC64_VS8 = UNW_PPC64_F8,
  415. UNW_PPC64_VS9 = UNW_PPC64_F9,
  416. UNW_PPC64_VS10 = UNW_PPC64_F10,
  417. UNW_PPC64_VS11 = UNW_PPC64_F11,
  418. UNW_PPC64_VS12 = UNW_PPC64_F12,
  419. UNW_PPC64_VS13 = UNW_PPC64_F13,
  420. UNW_PPC64_VS14 = UNW_PPC64_F14,
  421. UNW_PPC64_VS15 = UNW_PPC64_F15,
  422. UNW_PPC64_VS16 = UNW_PPC64_F16,
  423. UNW_PPC64_VS17 = UNW_PPC64_F17,
  424. UNW_PPC64_VS18 = UNW_PPC64_F18,
  425. UNW_PPC64_VS19 = UNW_PPC64_F19,
  426. UNW_PPC64_VS20 = UNW_PPC64_F20,
  427. UNW_PPC64_VS21 = UNW_PPC64_F21,
  428. UNW_PPC64_VS22 = UNW_PPC64_F22,
  429. UNW_PPC64_VS23 = UNW_PPC64_F23,
  430. UNW_PPC64_VS24 = UNW_PPC64_F24,
  431. UNW_PPC64_VS25 = UNW_PPC64_F25,
  432. UNW_PPC64_VS26 = UNW_PPC64_F26,
  433. UNW_PPC64_VS27 = UNW_PPC64_F27,
  434. UNW_PPC64_VS28 = UNW_PPC64_F28,
  435. UNW_PPC64_VS29 = UNW_PPC64_F29,
  436. UNW_PPC64_VS30 = UNW_PPC64_F30,
  437. UNW_PPC64_VS31 = UNW_PPC64_F31,
  438. UNW_PPC64_VS32 = UNW_PPC64_V0,
  439. UNW_PPC64_VS33 = UNW_PPC64_V1,
  440. UNW_PPC64_VS34 = UNW_PPC64_V2,
  441. UNW_PPC64_VS35 = UNW_PPC64_V3,
  442. UNW_PPC64_VS36 = UNW_PPC64_V4,
  443. UNW_PPC64_VS37 = UNW_PPC64_V5,
  444. UNW_PPC64_VS38 = UNW_PPC64_V6,
  445. UNW_PPC64_VS39 = UNW_PPC64_V7,
  446. UNW_PPC64_VS40 = UNW_PPC64_V8,
  447. UNW_PPC64_VS41 = UNW_PPC64_V9,
  448. UNW_PPC64_VS42 = UNW_PPC64_V10,
  449. UNW_PPC64_VS43 = UNW_PPC64_V11,
  450. UNW_PPC64_VS44 = UNW_PPC64_V12,
  451. UNW_PPC64_VS45 = UNW_PPC64_V13,
  452. UNW_PPC64_VS46 = UNW_PPC64_V14,
  453. UNW_PPC64_VS47 = UNW_PPC64_V15,
  454. UNW_PPC64_VS48 = UNW_PPC64_V16,
  455. UNW_PPC64_VS49 = UNW_PPC64_V17,
  456. UNW_PPC64_VS50 = UNW_PPC64_V18,
  457. UNW_PPC64_VS51 = UNW_PPC64_V19,
  458. UNW_PPC64_VS52 = UNW_PPC64_V20,
  459. UNW_PPC64_VS53 = UNW_PPC64_V21,
  460. UNW_PPC64_VS54 = UNW_PPC64_V22,
  461. UNW_PPC64_VS55 = UNW_PPC64_V23,
  462. UNW_PPC64_VS56 = UNW_PPC64_V24,
  463. UNW_PPC64_VS57 = UNW_PPC64_V25,
  464. UNW_PPC64_VS58 = UNW_PPC64_V26,
  465. UNW_PPC64_VS59 = UNW_PPC64_V27,
  466. UNW_PPC64_VS60 = UNW_PPC64_V28,
  467. UNW_PPC64_VS61 = UNW_PPC64_V29,
  468. UNW_PPC64_VS62 = UNW_PPC64_V30,
  469. UNW_PPC64_VS63 = UNW_PPC64_V31
  470. };
  471. // 64-bit ARM64 registers
  472. enum {
  473. UNW_AARCH64_X0 = 0,
  474. UNW_AARCH64_X1 = 1,
  475. UNW_AARCH64_X2 = 2,
  476. UNW_AARCH64_X3 = 3,
  477. UNW_AARCH64_X4 = 4,
  478. UNW_AARCH64_X5 = 5,
  479. UNW_AARCH64_X6 = 6,
  480. UNW_AARCH64_X7 = 7,
  481. UNW_AARCH64_X8 = 8,
  482. UNW_AARCH64_X9 = 9,
  483. UNW_AARCH64_X10 = 10,
  484. UNW_AARCH64_X11 = 11,
  485. UNW_AARCH64_X12 = 12,
  486. UNW_AARCH64_X13 = 13,
  487. UNW_AARCH64_X14 = 14,
  488. UNW_AARCH64_X15 = 15,
  489. UNW_AARCH64_X16 = 16,
  490. UNW_AARCH64_X17 = 17,
  491. UNW_AARCH64_X18 = 18,
  492. UNW_AARCH64_X19 = 19,
  493. UNW_AARCH64_X20 = 20,
  494. UNW_AARCH64_X21 = 21,
  495. UNW_AARCH64_X22 = 22,
  496. UNW_AARCH64_X23 = 23,
  497. UNW_AARCH64_X24 = 24,
  498. UNW_AARCH64_X25 = 25,
  499. UNW_AARCH64_X26 = 26,
  500. UNW_AARCH64_X27 = 27,
  501. UNW_AARCH64_X28 = 28,
  502. UNW_AARCH64_X29 = 29,
  503. UNW_AARCH64_FP = 29,
  504. UNW_AARCH64_X30 = 30,
  505. UNW_AARCH64_LR = 30,
  506. UNW_AARCH64_X31 = 31,
  507. UNW_AARCH64_SP = 31,
  508. UNW_AARCH64_PC = 32,
  509. // reserved block
  510. UNW_AARCH64_RA_SIGN_STATE = 34,
  511. // FP/vector registers
  512. UNW_AARCH64_V0 = 64,
  513. UNW_AARCH64_V1 = 65,
  514. UNW_AARCH64_V2 = 66,
  515. UNW_AARCH64_V3 = 67,
  516. UNW_AARCH64_V4 = 68,
  517. UNW_AARCH64_V5 = 69,
  518. UNW_AARCH64_V6 = 70,
  519. UNW_AARCH64_V7 = 71,
  520. UNW_AARCH64_V8 = 72,
  521. UNW_AARCH64_V9 = 73,
  522. UNW_AARCH64_V10 = 74,
  523. UNW_AARCH64_V11 = 75,
  524. UNW_AARCH64_V12 = 76,
  525. UNW_AARCH64_V13 = 77,
  526. UNW_AARCH64_V14 = 78,
  527. UNW_AARCH64_V15 = 79,
  528. UNW_AARCH64_V16 = 80,
  529. UNW_AARCH64_V17 = 81,
  530. UNW_AARCH64_V18 = 82,
  531. UNW_AARCH64_V19 = 83,
  532. UNW_AARCH64_V20 = 84,
  533. UNW_AARCH64_V21 = 85,
  534. UNW_AARCH64_V22 = 86,
  535. UNW_AARCH64_V23 = 87,
  536. UNW_AARCH64_V24 = 88,
  537. UNW_AARCH64_V25 = 89,
  538. UNW_AARCH64_V26 = 90,
  539. UNW_AARCH64_V27 = 91,
  540. UNW_AARCH64_V28 = 92,
  541. UNW_AARCH64_V29 = 93,
  542. UNW_AARCH64_V30 = 94,
  543. UNW_AARCH64_V31 = 95,
  544. // Compatibility aliases
  545. UNW_ARM64_X0 = UNW_AARCH64_X0,
  546. UNW_ARM64_X1 = UNW_AARCH64_X1,
  547. UNW_ARM64_X2 = UNW_AARCH64_X2,
  548. UNW_ARM64_X3 = UNW_AARCH64_X3,
  549. UNW_ARM64_X4 = UNW_AARCH64_X4,
  550. UNW_ARM64_X5 = UNW_AARCH64_X5,
  551. UNW_ARM64_X6 = UNW_AARCH64_X6,
  552. UNW_ARM64_X7 = UNW_AARCH64_X7,
  553. UNW_ARM64_X8 = UNW_AARCH64_X8,
  554. UNW_ARM64_X9 = UNW_AARCH64_X9,
  555. UNW_ARM64_X10 = UNW_AARCH64_X10,
  556. UNW_ARM64_X11 = UNW_AARCH64_X11,
  557. UNW_ARM64_X12 = UNW_AARCH64_X12,
  558. UNW_ARM64_X13 = UNW_AARCH64_X13,
  559. UNW_ARM64_X14 = UNW_AARCH64_X14,
  560. UNW_ARM64_X15 = UNW_AARCH64_X15,
  561. UNW_ARM64_X16 = UNW_AARCH64_X16,
  562. UNW_ARM64_X17 = UNW_AARCH64_X17,
  563. UNW_ARM64_X18 = UNW_AARCH64_X18,
  564. UNW_ARM64_X19 = UNW_AARCH64_X19,
  565. UNW_ARM64_X20 = UNW_AARCH64_X20,
  566. UNW_ARM64_X21 = UNW_AARCH64_X21,
  567. UNW_ARM64_X22 = UNW_AARCH64_X22,
  568. UNW_ARM64_X23 = UNW_AARCH64_X23,
  569. UNW_ARM64_X24 = UNW_AARCH64_X24,
  570. UNW_ARM64_X25 = UNW_AARCH64_X25,
  571. UNW_ARM64_X26 = UNW_AARCH64_X26,
  572. UNW_ARM64_X27 = UNW_AARCH64_X27,
  573. UNW_ARM64_X28 = UNW_AARCH64_X28,
  574. UNW_ARM64_X29 = UNW_AARCH64_X29,
  575. UNW_ARM64_FP = UNW_AARCH64_FP,
  576. UNW_ARM64_X30 = UNW_AARCH64_X30,
  577. UNW_ARM64_LR = UNW_AARCH64_LR,
  578. UNW_ARM64_X31 = UNW_AARCH64_X31,
  579. UNW_ARM64_SP = UNW_AARCH64_SP,
  580. UNW_ARM64_PC = UNW_AARCH64_PC,
  581. UNW_ARM64_RA_SIGN_STATE = UNW_AARCH64_RA_SIGN_STATE,
  582. UNW_ARM64_D0 = UNW_AARCH64_V0,
  583. UNW_ARM64_D1 = UNW_AARCH64_V1,
  584. UNW_ARM64_D2 = UNW_AARCH64_V2,
  585. UNW_ARM64_D3 = UNW_AARCH64_V3,
  586. UNW_ARM64_D4 = UNW_AARCH64_V4,
  587. UNW_ARM64_D5 = UNW_AARCH64_V5,
  588. UNW_ARM64_D6 = UNW_AARCH64_V6,
  589. UNW_ARM64_D7 = UNW_AARCH64_V7,
  590. UNW_ARM64_D8 = UNW_AARCH64_V8,
  591. UNW_ARM64_D9 = UNW_AARCH64_V9,
  592. UNW_ARM64_D10 = UNW_AARCH64_V10,
  593. UNW_ARM64_D11 = UNW_AARCH64_V11,
  594. UNW_ARM64_D12 = UNW_AARCH64_V12,
  595. UNW_ARM64_D13 = UNW_AARCH64_V13,
  596. UNW_ARM64_D14 = UNW_AARCH64_V14,
  597. UNW_ARM64_D15 = UNW_AARCH64_V15,
  598. UNW_ARM64_D16 = UNW_AARCH64_V16,
  599. UNW_ARM64_D17 = UNW_AARCH64_V17,
  600. UNW_ARM64_D18 = UNW_AARCH64_V18,
  601. UNW_ARM64_D19 = UNW_AARCH64_V19,
  602. UNW_ARM64_D20 = UNW_AARCH64_V20,
  603. UNW_ARM64_D21 = UNW_AARCH64_V21,
  604. UNW_ARM64_D22 = UNW_AARCH64_V22,
  605. UNW_ARM64_D23 = UNW_AARCH64_V23,
  606. UNW_ARM64_D24 = UNW_AARCH64_V24,
  607. UNW_ARM64_D25 = UNW_AARCH64_V25,
  608. UNW_ARM64_D26 = UNW_AARCH64_V26,
  609. UNW_ARM64_D27 = UNW_AARCH64_V27,
  610. UNW_ARM64_D28 = UNW_AARCH64_V28,
  611. UNW_ARM64_D29 = UNW_AARCH64_V29,
  612. UNW_ARM64_D30 = UNW_AARCH64_V30,
  613. UNW_ARM64_D31 = UNW_AARCH64_V31,
  614. };
  615. // 32-bit ARM registers. Numbers match DWARF for ARM spec #3.1 Table 1.
  616. // Naming scheme uses recommendations given in Note 4 for VFP-v2 and VFP-v3.
  617. // In this scheme, even though the 64-bit floating point registers D0-D31
  618. // overlap physically with the 32-bit floating pointer registers S0-S31,
  619. // they are given a non-overlapping range of register numbers.
  620. //
  621. // Commented out ranges are not preserved during unwinding.
  622. enum {
  623. UNW_ARM_R0 = 0,
  624. UNW_ARM_R1 = 1,
  625. UNW_ARM_R2 = 2,
  626. UNW_ARM_R3 = 3,
  627. UNW_ARM_R4 = 4,
  628. UNW_ARM_R5 = 5,
  629. UNW_ARM_R6 = 6,
  630. UNW_ARM_R7 = 7,
  631. UNW_ARM_R8 = 8,
  632. UNW_ARM_R9 = 9,
  633. UNW_ARM_R10 = 10,
  634. UNW_ARM_R11 = 11,
  635. UNW_ARM_R12 = 12,
  636. UNW_ARM_SP = 13, // Logical alias for UNW_REG_SP
  637. UNW_ARM_R13 = 13,
  638. UNW_ARM_LR = 14,
  639. UNW_ARM_R14 = 14,
  640. UNW_ARM_IP = 15, // Logical alias for UNW_REG_IP
  641. UNW_ARM_R15 = 15,
  642. // 16-63 -- OBSOLETE. Used in VFP1 to represent both S0-S31 and D0-D31.
  643. UNW_ARM_S0 = 64,
  644. UNW_ARM_S1 = 65,
  645. UNW_ARM_S2 = 66,
  646. UNW_ARM_S3 = 67,
  647. UNW_ARM_S4 = 68,
  648. UNW_ARM_S5 = 69,
  649. UNW_ARM_S6 = 70,
  650. UNW_ARM_S7 = 71,
  651. UNW_ARM_S8 = 72,
  652. UNW_ARM_S9 = 73,
  653. UNW_ARM_S10 = 74,
  654. UNW_ARM_S11 = 75,
  655. UNW_ARM_S12 = 76,
  656. UNW_ARM_S13 = 77,
  657. UNW_ARM_S14 = 78,
  658. UNW_ARM_S15 = 79,
  659. UNW_ARM_S16 = 80,
  660. UNW_ARM_S17 = 81,
  661. UNW_ARM_S18 = 82,
  662. UNW_ARM_S19 = 83,
  663. UNW_ARM_S20 = 84,
  664. UNW_ARM_S21 = 85,
  665. UNW_ARM_S22 = 86,
  666. UNW_ARM_S23 = 87,
  667. UNW_ARM_S24 = 88,
  668. UNW_ARM_S25 = 89,
  669. UNW_ARM_S26 = 90,
  670. UNW_ARM_S27 = 91,
  671. UNW_ARM_S28 = 92,
  672. UNW_ARM_S29 = 93,
  673. UNW_ARM_S30 = 94,
  674. UNW_ARM_S31 = 95,
  675. // 96-103 -- OBSOLETE. F0-F7. Used by the FPA system. Superseded by VFP.
  676. // 104-111 -- wCGR0-wCGR7, ACC0-ACC7 (Intel wireless MMX)
  677. UNW_ARM_WR0 = 112,
  678. UNW_ARM_WR1 = 113,
  679. UNW_ARM_WR2 = 114,
  680. UNW_ARM_WR3 = 115,
  681. UNW_ARM_WR4 = 116,
  682. UNW_ARM_WR5 = 117,
  683. UNW_ARM_WR6 = 118,
  684. UNW_ARM_WR7 = 119,
  685. UNW_ARM_WR8 = 120,
  686. UNW_ARM_WR9 = 121,
  687. UNW_ARM_WR10 = 122,
  688. UNW_ARM_WR11 = 123,
  689. UNW_ARM_WR12 = 124,
  690. UNW_ARM_WR13 = 125,
  691. UNW_ARM_WR14 = 126,
  692. UNW_ARM_WR15 = 127,
  693. // 128-133 -- SPSR, SPSR_{FIQ|IRQ|ABT|UND|SVC}
  694. // 134-142 -- Reserved
  695. UNW_ARM_RA_AUTH_CODE = 143,
  696. // 144-150 -- R8_USR-R14_USR
  697. // 151-157 -- R8_FIQ-R14_FIQ
  698. // 158-159 -- R13_IRQ-R14_IRQ
  699. // 160-161 -- R13_ABT-R14_ABT
  700. // 162-163 -- R13_UND-R14_UND
  701. // 164-165 -- R13_SVC-R14_SVC
  702. // 166-191 -- Reserved
  703. UNW_ARM_WC0 = 192,
  704. UNW_ARM_WC1 = 193,
  705. UNW_ARM_WC2 = 194,
  706. UNW_ARM_WC3 = 195,
  707. // 196-199 -- wC4-wC7 (Intel wireless MMX control)
  708. // 200-255 -- Reserved
  709. UNW_ARM_D0 = 256,
  710. UNW_ARM_D1 = 257,
  711. UNW_ARM_D2 = 258,
  712. UNW_ARM_D3 = 259,
  713. UNW_ARM_D4 = 260,
  714. UNW_ARM_D5 = 261,
  715. UNW_ARM_D6 = 262,
  716. UNW_ARM_D7 = 263,
  717. UNW_ARM_D8 = 264,
  718. UNW_ARM_D9 = 265,
  719. UNW_ARM_D10 = 266,
  720. UNW_ARM_D11 = 267,
  721. UNW_ARM_D12 = 268,
  722. UNW_ARM_D13 = 269,
  723. UNW_ARM_D14 = 270,
  724. UNW_ARM_D15 = 271,
  725. UNW_ARM_D16 = 272,
  726. UNW_ARM_D17 = 273,
  727. UNW_ARM_D18 = 274,
  728. UNW_ARM_D19 = 275,
  729. UNW_ARM_D20 = 276,
  730. UNW_ARM_D21 = 277,
  731. UNW_ARM_D22 = 278,
  732. UNW_ARM_D23 = 279,
  733. UNW_ARM_D24 = 280,
  734. UNW_ARM_D25 = 281,
  735. UNW_ARM_D26 = 282,
  736. UNW_ARM_D27 = 283,
  737. UNW_ARM_D28 = 284,
  738. UNW_ARM_D29 = 285,
  739. UNW_ARM_D30 = 286,
  740. UNW_ARM_D31 = 287,
  741. // 288-319 -- Reserved for VFP/Neon
  742. // 320-8191 -- Reserved
  743. // 8192-16383 -- Unspecified vendor co-processor register.
  744. };
  745. // OpenRISC1000 register numbers
  746. enum {
  747. UNW_OR1K_R0 = 0,
  748. UNW_OR1K_R1 = 1,
  749. UNW_OR1K_R2 = 2,
  750. UNW_OR1K_R3 = 3,
  751. UNW_OR1K_R4 = 4,
  752. UNW_OR1K_R5 = 5,
  753. UNW_OR1K_R6 = 6,
  754. UNW_OR1K_R7 = 7,
  755. UNW_OR1K_R8 = 8,
  756. UNW_OR1K_R9 = 9,
  757. UNW_OR1K_R10 = 10,
  758. UNW_OR1K_R11 = 11,
  759. UNW_OR1K_R12 = 12,
  760. UNW_OR1K_R13 = 13,
  761. UNW_OR1K_R14 = 14,
  762. UNW_OR1K_R15 = 15,
  763. UNW_OR1K_R16 = 16,
  764. UNW_OR1K_R17 = 17,
  765. UNW_OR1K_R18 = 18,
  766. UNW_OR1K_R19 = 19,
  767. UNW_OR1K_R20 = 20,
  768. UNW_OR1K_R21 = 21,
  769. UNW_OR1K_R22 = 22,
  770. UNW_OR1K_R23 = 23,
  771. UNW_OR1K_R24 = 24,
  772. UNW_OR1K_R25 = 25,
  773. UNW_OR1K_R26 = 26,
  774. UNW_OR1K_R27 = 27,
  775. UNW_OR1K_R28 = 28,
  776. UNW_OR1K_R29 = 29,
  777. UNW_OR1K_R30 = 30,
  778. UNW_OR1K_R31 = 31,
  779. UNW_OR1K_EPCR = 32,
  780. };
  781. // MIPS registers
  782. enum {
  783. UNW_MIPS_R0 = 0,
  784. UNW_MIPS_R1 = 1,
  785. UNW_MIPS_R2 = 2,
  786. UNW_MIPS_R3 = 3,
  787. UNW_MIPS_R4 = 4,
  788. UNW_MIPS_R5 = 5,
  789. UNW_MIPS_R6 = 6,
  790. UNW_MIPS_R7 = 7,
  791. UNW_MIPS_R8 = 8,
  792. UNW_MIPS_R9 = 9,
  793. UNW_MIPS_R10 = 10,
  794. UNW_MIPS_R11 = 11,
  795. UNW_MIPS_R12 = 12,
  796. UNW_MIPS_R13 = 13,
  797. UNW_MIPS_R14 = 14,
  798. UNW_MIPS_R15 = 15,
  799. UNW_MIPS_R16 = 16,
  800. UNW_MIPS_R17 = 17,
  801. UNW_MIPS_R18 = 18,
  802. UNW_MIPS_R19 = 19,
  803. UNW_MIPS_R20 = 20,
  804. UNW_MIPS_R21 = 21,
  805. UNW_MIPS_R22 = 22,
  806. UNW_MIPS_R23 = 23,
  807. UNW_MIPS_R24 = 24,
  808. UNW_MIPS_R25 = 25,
  809. UNW_MIPS_R26 = 26,
  810. UNW_MIPS_R27 = 27,
  811. UNW_MIPS_R28 = 28,
  812. UNW_MIPS_R29 = 29,
  813. UNW_MIPS_R30 = 30,
  814. UNW_MIPS_R31 = 31,
  815. UNW_MIPS_F0 = 32,
  816. UNW_MIPS_F1 = 33,
  817. UNW_MIPS_F2 = 34,
  818. UNW_MIPS_F3 = 35,
  819. UNW_MIPS_F4 = 36,
  820. UNW_MIPS_F5 = 37,
  821. UNW_MIPS_F6 = 38,
  822. UNW_MIPS_F7 = 39,
  823. UNW_MIPS_F8 = 40,
  824. UNW_MIPS_F9 = 41,
  825. UNW_MIPS_F10 = 42,
  826. UNW_MIPS_F11 = 43,
  827. UNW_MIPS_F12 = 44,
  828. UNW_MIPS_F13 = 45,
  829. UNW_MIPS_F14 = 46,
  830. UNW_MIPS_F15 = 47,
  831. UNW_MIPS_F16 = 48,
  832. UNW_MIPS_F17 = 49,
  833. UNW_MIPS_F18 = 50,
  834. UNW_MIPS_F19 = 51,
  835. UNW_MIPS_F20 = 52,
  836. UNW_MIPS_F21 = 53,
  837. UNW_MIPS_F22 = 54,
  838. UNW_MIPS_F23 = 55,
  839. UNW_MIPS_F24 = 56,
  840. UNW_MIPS_F25 = 57,
  841. UNW_MIPS_F26 = 58,
  842. UNW_MIPS_F27 = 59,
  843. UNW_MIPS_F28 = 60,
  844. UNW_MIPS_F29 = 61,
  845. UNW_MIPS_F30 = 62,
  846. UNW_MIPS_F31 = 63,
  847. // HI,LO have been dropped since r6, we keep them here.
  848. // So, when we add DSP/MSA etc, we can use the same register indexes
  849. // for r6 and pre-r6.
  850. UNW_MIPS_HI = 64,
  851. UNW_MIPS_LO = 65,
  852. };
  853. // SPARC registers
  854. enum {
  855. UNW_SPARC_G0 = 0,
  856. UNW_SPARC_G1 = 1,
  857. UNW_SPARC_G2 = 2,
  858. UNW_SPARC_G3 = 3,
  859. UNW_SPARC_G4 = 4,
  860. UNW_SPARC_G5 = 5,
  861. UNW_SPARC_G6 = 6,
  862. UNW_SPARC_G7 = 7,
  863. UNW_SPARC_O0 = 8,
  864. UNW_SPARC_O1 = 9,
  865. UNW_SPARC_O2 = 10,
  866. UNW_SPARC_O3 = 11,
  867. UNW_SPARC_O4 = 12,
  868. UNW_SPARC_O5 = 13,
  869. UNW_SPARC_O6 = 14,
  870. UNW_SPARC_O7 = 15,
  871. UNW_SPARC_L0 = 16,
  872. UNW_SPARC_L1 = 17,
  873. UNW_SPARC_L2 = 18,
  874. UNW_SPARC_L3 = 19,
  875. UNW_SPARC_L4 = 20,
  876. UNW_SPARC_L5 = 21,
  877. UNW_SPARC_L6 = 22,
  878. UNW_SPARC_L7 = 23,
  879. UNW_SPARC_I0 = 24,
  880. UNW_SPARC_I1 = 25,
  881. UNW_SPARC_I2 = 26,
  882. UNW_SPARC_I3 = 27,
  883. UNW_SPARC_I4 = 28,
  884. UNW_SPARC_I5 = 29,
  885. UNW_SPARC_I6 = 30,
  886. UNW_SPARC_I7 = 31,
  887. };
  888. // Hexagon register numbers
  889. enum {
  890. UNW_HEXAGON_R0,
  891. UNW_HEXAGON_R1,
  892. UNW_HEXAGON_R2,
  893. UNW_HEXAGON_R3,
  894. UNW_HEXAGON_R4,
  895. UNW_HEXAGON_R5,
  896. UNW_HEXAGON_R6,
  897. UNW_HEXAGON_R7,
  898. UNW_HEXAGON_R8,
  899. UNW_HEXAGON_R9,
  900. UNW_HEXAGON_R10,
  901. UNW_HEXAGON_R11,
  902. UNW_HEXAGON_R12,
  903. UNW_HEXAGON_R13,
  904. UNW_HEXAGON_R14,
  905. UNW_HEXAGON_R15,
  906. UNW_HEXAGON_R16,
  907. UNW_HEXAGON_R17,
  908. UNW_HEXAGON_R18,
  909. UNW_HEXAGON_R19,
  910. UNW_HEXAGON_R20,
  911. UNW_HEXAGON_R21,
  912. UNW_HEXAGON_R22,
  913. UNW_HEXAGON_R23,
  914. UNW_HEXAGON_R24,
  915. UNW_HEXAGON_R25,
  916. UNW_HEXAGON_R26,
  917. UNW_HEXAGON_R27,
  918. UNW_HEXAGON_R28,
  919. UNW_HEXAGON_R29,
  920. UNW_HEXAGON_R30,
  921. UNW_HEXAGON_R31,
  922. UNW_HEXAGON_P3_0,
  923. UNW_HEXAGON_PC,
  924. };
  925. // RISC-V registers. These match the DWARF register numbers defined by section
  926. // 4 of the RISC-V ELF psABI specification, which can be found at:
  927. //
  928. // https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md
  929. enum {
  930. UNW_RISCV_X0 = 0,
  931. UNW_RISCV_X1 = 1,
  932. UNW_RISCV_X2 = 2,
  933. UNW_RISCV_X3 = 3,
  934. UNW_RISCV_X4 = 4,
  935. UNW_RISCV_X5 = 5,
  936. UNW_RISCV_X6 = 6,
  937. UNW_RISCV_X7 = 7,
  938. UNW_RISCV_X8 = 8,
  939. UNW_RISCV_X9 = 9,
  940. UNW_RISCV_X10 = 10,
  941. UNW_RISCV_X11 = 11,
  942. UNW_RISCV_X12 = 12,
  943. UNW_RISCV_X13 = 13,
  944. UNW_RISCV_X14 = 14,
  945. UNW_RISCV_X15 = 15,
  946. UNW_RISCV_X16 = 16,
  947. UNW_RISCV_X17 = 17,
  948. UNW_RISCV_X18 = 18,
  949. UNW_RISCV_X19 = 19,
  950. UNW_RISCV_X20 = 20,
  951. UNW_RISCV_X21 = 21,
  952. UNW_RISCV_X22 = 22,
  953. UNW_RISCV_X23 = 23,
  954. UNW_RISCV_X24 = 24,
  955. UNW_RISCV_X25 = 25,
  956. UNW_RISCV_X26 = 26,
  957. UNW_RISCV_X27 = 27,
  958. UNW_RISCV_X28 = 28,
  959. UNW_RISCV_X29 = 29,
  960. UNW_RISCV_X30 = 30,
  961. UNW_RISCV_X31 = 31,
  962. UNW_RISCV_F0 = 32,
  963. UNW_RISCV_F1 = 33,
  964. UNW_RISCV_F2 = 34,
  965. UNW_RISCV_F3 = 35,
  966. UNW_RISCV_F4 = 36,
  967. UNW_RISCV_F5 = 37,
  968. UNW_RISCV_F6 = 38,
  969. UNW_RISCV_F7 = 39,
  970. UNW_RISCV_F8 = 40,
  971. UNW_RISCV_F9 = 41,
  972. UNW_RISCV_F10 = 42,
  973. UNW_RISCV_F11 = 43,
  974. UNW_RISCV_F12 = 44,
  975. UNW_RISCV_F13 = 45,
  976. UNW_RISCV_F14 = 46,
  977. UNW_RISCV_F15 = 47,
  978. UNW_RISCV_F16 = 48,
  979. UNW_RISCV_F17 = 49,
  980. UNW_RISCV_F18 = 50,
  981. UNW_RISCV_F19 = 51,
  982. UNW_RISCV_F20 = 52,
  983. UNW_RISCV_F21 = 53,
  984. UNW_RISCV_F22 = 54,
  985. UNW_RISCV_F23 = 55,
  986. UNW_RISCV_F24 = 56,
  987. UNW_RISCV_F25 = 57,
  988. UNW_RISCV_F26 = 58,
  989. UNW_RISCV_F27 = 59,
  990. UNW_RISCV_F28 = 60,
  991. UNW_RISCV_F29 = 61,
  992. UNW_RISCV_F30 = 62,
  993. UNW_RISCV_F31 = 63,
  994. // 65-95 -- Reserved for future standard extensions
  995. // 96-127 -- v0-v31 (Vector registers)
  996. // 128-3071 -- Reserved for future standard extensions
  997. // 3072-4095 -- Reserved for custom extensions
  998. // 4096-8191 -- CSRs
  999. //
  1000. // VLENB CSR number: 0xC22 -- defined by section 3 of v-spec:
  1001. // https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#3-vector-extension-programmers-model
  1002. // VLENB DWARF number: 0x1000 + 0xC22
  1003. UNW_RISCV_VLENB = 0x1C22,
  1004. };
  1005. // VE register numbers
  1006. enum {
  1007. UNW_VE_S0 = 0,
  1008. UNW_VE_S1 = 1,
  1009. UNW_VE_S2 = 2,
  1010. UNW_VE_S3 = 3,
  1011. UNW_VE_S4 = 4,
  1012. UNW_VE_S5 = 5,
  1013. UNW_VE_S6 = 6,
  1014. UNW_VE_S7 = 7,
  1015. UNW_VE_S8 = 8,
  1016. UNW_VE_S9 = 9,
  1017. UNW_VE_S10 = 10,
  1018. UNW_VE_S11 = 11,
  1019. UNW_VE_S12 = 12,
  1020. UNW_VE_S13 = 13,
  1021. UNW_VE_S14 = 14,
  1022. UNW_VE_S15 = 15,
  1023. UNW_VE_S16 = 16,
  1024. UNW_VE_S17 = 17,
  1025. UNW_VE_S18 = 18,
  1026. UNW_VE_S19 = 19,
  1027. UNW_VE_S20 = 20,
  1028. UNW_VE_S21 = 21,
  1029. UNW_VE_S22 = 22,
  1030. UNW_VE_S23 = 23,
  1031. UNW_VE_S24 = 24,
  1032. UNW_VE_S25 = 25,
  1033. UNW_VE_S26 = 26,
  1034. UNW_VE_S27 = 27,
  1035. UNW_VE_S28 = 28,
  1036. UNW_VE_S29 = 29,
  1037. UNW_VE_S30 = 30,
  1038. UNW_VE_S31 = 31,
  1039. UNW_VE_S32 = 32,
  1040. UNW_VE_S33 = 33,
  1041. UNW_VE_S34 = 34,
  1042. UNW_VE_S35 = 35,
  1043. UNW_VE_S36 = 36,
  1044. UNW_VE_S37 = 37,
  1045. UNW_VE_S38 = 38,
  1046. UNW_VE_S39 = 39,
  1047. UNW_VE_S40 = 40,
  1048. UNW_VE_S41 = 41,
  1049. UNW_VE_S42 = 42,
  1050. UNW_VE_S43 = 43,
  1051. UNW_VE_S44 = 44,
  1052. UNW_VE_S45 = 45,
  1053. UNW_VE_S46 = 46,
  1054. UNW_VE_S47 = 47,
  1055. UNW_VE_S48 = 48,
  1056. UNW_VE_S49 = 49,
  1057. UNW_VE_S50 = 50,
  1058. UNW_VE_S51 = 51,
  1059. UNW_VE_S52 = 52,
  1060. UNW_VE_S53 = 53,
  1061. UNW_VE_S54 = 54,
  1062. UNW_VE_S55 = 55,
  1063. UNW_VE_S56 = 56,
  1064. UNW_VE_S57 = 57,
  1065. UNW_VE_S58 = 58,
  1066. UNW_VE_S59 = 59,
  1067. UNW_VE_S60 = 60,
  1068. UNW_VE_S61 = 61,
  1069. UNW_VE_S62 = 62,
  1070. UNW_VE_S63 = 63,
  1071. UNW_VE_V0 = 64 + 0,
  1072. UNW_VE_V1 = 64 + 1,
  1073. UNW_VE_V2 = 64 + 2,
  1074. UNW_VE_V3 = 64 + 3,
  1075. UNW_VE_V4 = 64 + 4,
  1076. UNW_VE_V5 = 64 + 5,
  1077. UNW_VE_V6 = 64 + 6,
  1078. UNW_VE_V7 = 64 + 7,
  1079. UNW_VE_V8 = 64 + 8,
  1080. UNW_VE_V9 = 64 + 9,
  1081. UNW_VE_V10 = 64 + 10,
  1082. UNW_VE_V11 = 64 + 11,
  1083. UNW_VE_V12 = 64 + 12,
  1084. UNW_VE_V13 = 64 + 13,
  1085. UNW_VE_V14 = 64 + 14,
  1086. UNW_VE_V15 = 64 + 15,
  1087. UNW_VE_V16 = 64 + 16,
  1088. UNW_VE_V17 = 64 + 17,
  1089. UNW_VE_V18 = 64 + 18,
  1090. UNW_VE_V19 = 64 + 19,
  1091. UNW_VE_V20 = 64 + 20,
  1092. UNW_VE_V21 = 64 + 21,
  1093. UNW_VE_V22 = 64 + 22,
  1094. UNW_VE_V23 = 64 + 23,
  1095. UNW_VE_V24 = 64 + 24,
  1096. UNW_VE_V25 = 64 + 25,
  1097. UNW_VE_V26 = 64 + 26,
  1098. UNW_VE_V27 = 64 + 27,
  1099. UNW_VE_V28 = 64 + 28,
  1100. UNW_VE_V29 = 64 + 29,
  1101. UNW_VE_V30 = 64 + 30,
  1102. UNW_VE_V31 = 64 + 31,
  1103. UNW_VE_V32 = 64 + 32,
  1104. UNW_VE_V33 = 64 + 33,
  1105. UNW_VE_V34 = 64 + 34,
  1106. UNW_VE_V35 = 64 + 35,
  1107. UNW_VE_V36 = 64 + 36,
  1108. UNW_VE_V37 = 64 + 37,
  1109. UNW_VE_V38 = 64 + 38,
  1110. UNW_VE_V39 = 64 + 39,
  1111. UNW_VE_V40 = 64 + 40,
  1112. UNW_VE_V41 = 64 + 41,
  1113. UNW_VE_V42 = 64 + 42,
  1114. UNW_VE_V43 = 64 + 43,
  1115. UNW_VE_V44 = 64 + 44,
  1116. UNW_VE_V45 = 64 + 45,
  1117. UNW_VE_V46 = 64 + 46,
  1118. UNW_VE_V47 = 64 + 47,
  1119. UNW_VE_V48 = 64 + 48,
  1120. UNW_VE_V49 = 64 + 49,
  1121. UNW_VE_V50 = 64 + 50,
  1122. UNW_VE_V51 = 64 + 51,
  1123. UNW_VE_V52 = 64 + 52,
  1124. UNW_VE_V53 = 64 + 53,
  1125. UNW_VE_V54 = 64 + 54,
  1126. UNW_VE_V55 = 64 + 55,
  1127. UNW_VE_V56 = 64 + 56,
  1128. UNW_VE_V57 = 64 + 57,
  1129. UNW_VE_V58 = 64 + 58,
  1130. UNW_VE_V59 = 64 + 59,
  1131. UNW_VE_V60 = 64 + 60,
  1132. UNW_VE_V61 = 64 + 61,
  1133. UNW_VE_V62 = 64 + 62,
  1134. UNW_VE_V63 = 64 + 63,
  1135. UNW_VE_VM0 = 128 + 0,
  1136. UNW_VE_VM1 = 128 + 1,
  1137. UNW_VE_VM2 = 128 + 2,
  1138. UNW_VE_VM3 = 128 + 3,
  1139. UNW_VE_VM4 = 128 + 4,
  1140. UNW_VE_VM5 = 128 + 5,
  1141. UNW_VE_VM6 = 128 + 6,
  1142. UNW_VE_VM7 = 128 + 7,
  1143. UNW_VE_VM8 = 128 + 8,
  1144. UNW_VE_VM9 = 128 + 9,
  1145. UNW_VE_VM10 = 128 + 10,
  1146. UNW_VE_VM11 = 128 + 11,
  1147. UNW_VE_VM12 = 128 + 12,
  1148. UNW_VE_VM13 = 128 + 13,
  1149. UNW_VE_VM14 = 128 + 14,
  1150. UNW_VE_VM15 = 128 + 15, // = 143
  1151. // Following registers don't have DWARF register numbers.
  1152. UNW_VE_VIXR = 144,
  1153. UNW_VE_VL = 145,
  1154. };
  1155. // s390x register numbers
  1156. enum {
  1157. UNW_S390X_R0 = 0,
  1158. UNW_S390X_R1 = 1,
  1159. UNW_S390X_R2 = 2,
  1160. UNW_S390X_R3 = 3,
  1161. UNW_S390X_R4 = 4,
  1162. UNW_S390X_R5 = 5,
  1163. UNW_S390X_R6 = 6,
  1164. UNW_S390X_R7 = 7,
  1165. UNW_S390X_R8 = 8,
  1166. UNW_S390X_R9 = 9,
  1167. UNW_S390X_R10 = 10,
  1168. UNW_S390X_R11 = 11,
  1169. UNW_S390X_R12 = 12,
  1170. UNW_S390X_R13 = 13,
  1171. UNW_S390X_R14 = 14,
  1172. UNW_S390X_R15 = 15,
  1173. UNW_S390X_F0 = 16,
  1174. UNW_S390X_F2 = 17,
  1175. UNW_S390X_F4 = 18,
  1176. UNW_S390X_F6 = 19,
  1177. UNW_S390X_F1 = 20,
  1178. UNW_S390X_F3 = 21,
  1179. UNW_S390X_F5 = 22,
  1180. UNW_S390X_F7 = 23,
  1181. UNW_S390X_F8 = 24,
  1182. UNW_S390X_F10 = 25,
  1183. UNW_S390X_F12 = 26,
  1184. UNW_S390X_F14 = 27,
  1185. UNW_S390X_F9 = 28,
  1186. UNW_S390X_F11 = 29,
  1187. UNW_S390X_F13 = 30,
  1188. UNW_S390X_F15 = 31,
  1189. // 32-47 Control Registers
  1190. // 48-63 Access Registers
  1191. UNW_S390X_PSWM = 64,
  1192. UNW_S390X_PSWA = 65,
  1193. // 66-67 Reserved
  1194. // 68-83 Vector Registers %v16-%v31
  1195. };
  1196. // LoongArch registers.
  1197. enum {
  1198. UNW_LOONGARCH_R0 = 0,
  1199. UNW_LOONGARCH_R1 = 1,
  1200. UNW_LOONGARCH_R2 = 2,
  1201. UNW_LOONGARCH_R3 = 3,
  1202. UNW_LOONGARCH_R4 = 4,
  1203. UNW_LOONGARCH_R5 = 5,
  1204. UNW_LOONGARCH_R6 = 6,
  1205. UNW_LOONGARCH_R7 = 7,
  1206. UNW_LOONGARCH_R8 = 8,
  1207. UNW_LOONGARCH_R9 = 9,
  1208. UNW_LOONGARCH_R10 = 10,
  1209. UNW_LOONGARCH_R11 = 11,
  1210. UNW_LOONGARCH_R12 = 12,
  1211. UNW_LOONGARCH_R13 = 13,
  1212. UNW_LOONGARCH_R14 = 14,
  1213. UNW_LOONGARCH_R15 = 15,
  1214. UNW_LOONGARCH_R16 = 16,
  1215. UNW_LOONGARCH_R17 = 17,
  1216. UNW_LOONGARCH_R18 = 18,
  1217. UNW_LOONGARCH_R19 = 19,
  1218. UNW_LOONGARCH_R20 = 20,
  1219. UNW_LOONGARCH_R21 = 21,
  1220. UNW_LOONGARCH_R22 = 22,
  1221. UNW_LOONGARCH_R23 = 23,
  1222. UNW_LOONGARCH_R24 = 24,
  1223. UNW_LOONGARCH_R25 = 25,
  1224. UNW_LOONGARCH_R26 = 26,
  1225. UNW_LOONGARCH_R27 = 27,
  1226. UNW_LOONGARCH_R28 = 28,
  1227. UNW_LOONGARCH_R29 = 29,
  1228. UNW_LOONGARCH_R30 = 30,
  1229. UNW_LOONGARCH_R31 = 31,
  1230. UNW_LOONGARCH_F0 = 32,
  1231. UNW_LOONGARCH_F1 = 33,
  1232. UNW_LOONGARCH_F2 = 34,
  1233. UNW_LOONGARCH_F3 = 35,
  1234. UNW_LOONGARCH_F4 = 36,
  1235. UNW_LOONGARCH_F5 = 37,
  1236. UNW_LOONGARCH_F6 = 38,
  1237. UNW_LOONGARCH_F7 = 39,
  1238. UNW_LOONGARCH_F8 = 40,
  1239. UNW_LOONGARCH_F9 = 41,
  1240. UNW_LOONGARCH_F10 = 42,
  1241. UNW_LOONGARCH_F11 = 43,
  1242. UNW_LOONGARCH_F12 = 44,
  1243. UNW_LOONGARCH_F13 = 45,
  1244. UNW_LOONGARCH_F14 = 46,
  1245. UNW_LOONGARCH_F15 = 47,
  1246. UNW_LOONGARCH_F16 = 48,
  1247. UNW_LOONGARCH_F17 = 49,
  1248. UNW_LOONGARCH_F18 = 50,
  1249. UNW_LOONGARCH_F19 = 51,
  1250. UNW_LOONGARCH_F20 = 52,
  1251. UNW_LOONGARCH_F21 = 53,
  1252. UNW_LOONGARCH_F22 = 54,
  1253. UNW_LOONGARCH_F23 = 55,
  1254. UNW_LOONGARCH_F24 = 56,
  1255. UNW_LOONGARCH_F25 = 57,
  1256. UNW_LOONGARCH_F26 = 58,
  1257. UNW_LOONGARCH_F27 = 59,
  1258. UNW_LOONGARCH_F28 = 60,
  1259. UNW_LOONGARCH_F29 = 61,
  1260. UNW_LOONGARCH_F30 = 62,
  1261. UNW_LOONGARCH_F31 = 63,
  1262. };
  1263. #endif