unwind.h revision 1.2.6.2 1 1.2.6.2 yamt //===------------------------------- unwind.h -----------------------------===//
2 1.2.6.2 yamt //
3 1.2.6.2 yamt // The LLVM Compiler Infrastructure
4 1.2.6.2 yamt //
5 1.2.6.2 yamt // This file is dual licensed under the MIT and the University of Illinois Open
6 1.2.6.2 yamt // Source Licenses. See LICENSE.TXT for details.
7 1.2.6.2 yamt //
8 1.2.6.2 yamt //
9 1.2.6.2 yamt // C++ ABI Level 1 ABI documented at:
10 1.2.6.2 yamt // http://mentorembedded.github.io/cxx-abi/abi-eh.html
11 1.2.6.2 yamt //
12 1.2.6.2 yamt //===----------------------------------------------------------------------===//
13 1.2.6.2 yamt
14 1.2.6.2 yamt #ifndef _UNWIND_H
15 1.2.6.2 yamt #define _UNWIND_H
16 1.2.6.2 yamt
17 1.2.6.2 yamt #include <stdint.h>
18 1.2.6.2 yamt #include <stddef.h>
19 1.2.6.2 yamt
20 1.2.6.2 yamt typedef enum {
21 1.2.6.2 yamt _URC_NO_REASON = 0,
22 1.2.6.2 yamt _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
23 1.2.6.2 yamt _URC_FATAL_PHASE2_ERROR = 2,
24 1.2.6.2 yamt _URC_FATAL_PHASE1_ERROR = 3,
25 1.2.6.2 yamt _URC_NORMAL_STOP = 4,
26 1.2.6.2 yamt _URC_END_OF_STACK = 5,
27 1.2.6.2 yamt _URC_HANDLER_FOUND = 6,
28 1.2.6.2 yamt _URC_INSTALL_CONTEXT = 7,
29 1.2.6.2 yamt _URC_CONTINUE_UNWIND = 8
30 1.2.6.2 yamt } _Unwind_Reason_Code;
31 1.2.6.2 yamt
32 1.2.6.2 yamt typedef enum {
33 1.2.6.2 yamt _UA_SEARCH_PHASE = 1,
34 1.2.6.2 yamt _UA_CLEANUP_PHASE = 2,
35 1.2.6.2 yamt _UA_HANDLER_FRAME = 4,
36 1.2.6.2 yamt _UA_FORCE_UNWIND = 8,
37 1.2.6.2 yamt _UA_END_OF_STACK = 16 /* GCC extension */
38 1.2.6.2 yamt } _Unwind_Action;
39 1.2.6.2 yamt
40 1.2.6.2 yamt struct _Unwind_Context;
41 1.2.6.2 yamt
42 1.2.6.2 yamt struct _Unwind_Exception {
43 1.2.6.2 yamt uint64_t exception_class;
44 1.2.6.2 yamt void (*exception_cleanup)(_Unwind_Reason_Code, struct _Unwind_Exception *);
45 1.2.6.2 yamt uintptr_t private_1;
46 1.2.6.2 yamt uintptr_t private_2;
47 1.2.6.2 yamt } __attribute__((__aligned__));
48 1.2.6.2 yamt
49 1.2.6.2 yamt typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)(int, _Unwind_Action, uint64_t,
50 1.2.6.2 yamt struct _Unwind_Exception *,
51 1.2.6.2 yamt struct _Unwind_Context *,
52 1.2.6.2 yamt void *);
53 1.2.6.2 yamt
54 1.2.6.2 yamt typedef _Unwind_Reason_Code (*__personality_routine)(int, _Unwind_Action,
55 1.2.6.2 yamt uint64_t,
56 1.2.6.2 yamt struct _Unwind_Exception *,
57 1.2.6.2 yamt struct _Unwind_Context *);
58 1.2.6.2 yamt
59 1.2.6.2 yamt __BEGIN_DECLS
60 1.2.6.2 yamt
61 1.2.6.2 yamt _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *);
62 1.2.6.2 yamt void _Unwind_Resume(struct _Unwind_Exception *) __dead;
63 1.2.6.2 yamt _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *);
64 1.2.6.2 yamt _Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *,
65 1.2.6.2 yamt _Unwind_Stop_Fn, void *);
66 1.2.6.2 yamt void _Unwind_DeleteException(struct _Unwind_Exception *);
67 1.2.6.2 yamt uintptr_t _Unwind_GetGR(struct _Unwind_Context *, int);
68 1.2.6.2 yamt void _Unwind_SetGR(struct _Unwind_Context *, int, uintptr_t);
69 1.2.6.2 yamt uintptr_t _Unwind_GetIP(struct _Unwind_Context *);
70 1.2.6.2 yamt uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *, int *);
71 1.2.6.2 yamt uintptr_t _Unwind_GetCFA(struct _Unwind_Context *);
72 1.2.6.2 yamt void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t);
73 1.2.6.2 yamt uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *);
74 1.2.6.2 yamt uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context *);
75 1.2.6.2 yamt uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *);
76 1.2.6.2 yamt uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *);
77 1.2.6.2 yamt
78 1.2.6.2 yamt typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context *,
79 1.2.6.2 yamt void *);
80 1.2.6.2 yamt _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *);
81 1.2.6.2 yamt void *_Unwind_FindEnclosingFunction(void *);
82 1.2.6.2 yamt
83 1.2.6.2 yamt void __register_frame(const void *);
84 1.2.6.2 yamt void __register_frame_info(const void *, void *);
85 1.2.6.2 yamt void __deregister_frame(const void *);
86 1.2.6.2 yamt void *__deregister_frame_info(const void *);
87 1.2.6.2 yamt
88 1.2.6.2 yamt __END_DECLS
89 1.2.6.2 yamt
90 1.2.6.2 yamt #endif // _UNWIND_H
91