@@ -11,6 +11,11 @@ module rt.unwind;
11
11
12
12
import core.stdc.stdint ;
13
13
14
+ version (ARM )
15
+ {
16
+ version (iOS) {} else version = ARM_EABI_UNWINDER ;
17
+ }
18
+
14
19
extern (C ):
15
20
16
21
alias uintptr_t _Unwind_Word;
36
41
_URC_INSTALL_CONTEXT = 7 ,
37
42
_URC_CONTINUE_UNWIND = 8
38
43
}
44
+ version (ARM_EABI_UNWINDER)
45
+ enum _URC_FAILURE = 9 ;
39
46
40
47
alias int _Unwind_Action;
41
48
enum _Unwind_Action _UA_SEARCH_PHASE = 1 ;
@@ -48,7 +55,53 @@ alias _Unwind_Exception_Cleanup_Fn = void function(
48
55
_Unwind_Reason_Code reason,
49
56
_Unwind_Exception * exc);
50
57
51
- version (X86_64 )
58
+ version (ARM_EABI_UNWINDER)
59
+ {
60
+ align (8 ) struct _Unwind_Control_Block
61
+ {
62
+ ulong exception_class;
63
+ void function (_Unwind_Reason_Code, _Unwind_Control_Block * ) exception_cleanup;
64
+
65
+ /* Unwinder cache, private fields for the unwinder's use */
66
+ struct unwinder_cache_t
67
+ {
68
+ uint reserved1; /* init reserved1 to 0, then don't touch */
69
+ uint reserved2;
70
+ uint reserved3;
71
+ uint reserved4;
72
+ uint reserved5;
73
+ }
74
+ unwinder_cache_t unwinder_cache;
75
+
76
+ /* Propagation barrier cache (valid after phase 1): */
77
+ struct barrier_cache_t
78
+ {
79
+ uint sp;
80
+ uint [5 ] bitpattern;
81
+ }
82
+ barrier_cache_t barrier_cache;
83
+
84
+ /* Cleanup cache (preserved over cleanup): */
85
+ struct cleanup_cache_t
86
+ {
87
+ uint [4 ] bitpattern;
88
+ }
89
+ cleanup_cache_t cleanup_cache;
90
+
91
+ /* Pr cache (for pr's benefit): */
92
+ struct pr_cache_t
93
+ {
94
+ uint fnstart; /* function start address */
95
+ void * ehtp; /* pointer to EHT entry header word */
96
+ uint additional;
97
+ uint reserved1;
98
+ }
99
+ pr_cache_t pr_cache;
100
+ }
101
+
102
+ alias _Unwind_Exception = _Unwind_Control_Block;
103
+ }
104
+ else version (X86_64 )
52
105
{
53
106
align (16 ) struct _Unwind_Exception
54
107
{
@@ -93,6 +146,12 @@ void _Unwind_Resume(_Unwind_Exception* exception_object);
93
146
_Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Exception* exception_object);
94
147
_Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void * );
95
148
149
+ version (ARM_EABI_UNWINDER)
150
+ {
151
+ _Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Exception* exception_object, _Unwind_Context* context);
152
+ void _Unwind_Complete (_Unwind_Exception* exception_object);
153
+ }
154
+
96
155
_Unwind_Word _Unwind_GetGR (_Unwind_Context* context, int index);
97
156
void _Unwind_SetGR (_Unwind_Context* context, int index, _Unwind_Word new_value);
98
157
_Unwind_Ptr _Unwind_GetIP (_Unwind_Context* context);
0 commit comments