@@ -50,7 +50,7 @@ extern "C" {
50
50
require recompiling all users of this library. Stack allocation is
51
51
relatively cheap and unwind-state copying is relatively rare, so we
52
52
want to err on making it rather too big than too small. */
53
-
53
+
54
54
/* FIXME for ARM. Too big? What do other things use for similar tasks? */
55
55
#define UNW_TDEP_CURSOR_LEN 4096
56
56
@@ -77,7 +77,7 @@ typedef enum
77
77
UNW_ARM_R13 ,
78
78
UNW_ARM_R14 ,
79
79
UNW_ARM_R15 ,
80
-
80
+
81
81
/* VFPv2 s0-s31 (obsolescent numberings). */
82
82
UNW_ARM_S0 = 64 ,
83
83
UNW_ARM_S1 ,
@@ -111,7 +111,7 @@ typedef enum
111
111
UNW_ARM_S29 ,
112
112
UNW_ARM_S30 ,
113
113
UNW_ARM_S31 ,
114
-
114
+
115
115
/* FPA register numberings. */
116
116
UNW_ARM_F0 = 96 ,
117
117
UNW_ARM_F1 ,
@@ -121,7 +121,7 @@ typedef enum
121
121
UNW_ARM_F5 ,
122
122
UNW_ARM_F6 ,
123
123
UNW_ARM_F7 ,
124
-
124
+
125
125
/* iWMMXt GR register numberings. */
126
126
UNW_ARM_wCGR0 = 104 ,
127
127
UNW_ARM_wCGR1 ,
@@ -131,7 +131,7 @@ typedef enum
131
131
UNW_ARM_wCGR5 ,
132
132
UNW_ARM_wCGR6 ,
133
133
UNW_ARM_wCGR7 ,
134
-
134
+
135
135
/* iWMMXt register numberings. */
136
136
UNW_ARM_wR0 = 112 ,
137
137
UNW_ARM_wR1 ,
@@ -149,17 +149,17 @@ typedef enum
149
149
UNW_ARM_wR13 ,
150
150
UNW_ARM_wR14 ,
151
151
UNW_ARM_wR15 ,
152
-
152
+
153
153
/* Two-byte encodings from here on. */
154
-
154
+
155
155
/* SPSR. */
156
156
UNW_ARM_SPSR = 128 ,
157
157
UNW_ARM_SPSR_FIQ ,
158
158
UNW_ARM_SPSR_IRQ ,
159
159
UNW_ARM_SPSR_ABT ,
160
160
UNW_ARM_SPSR_UND ,
161
161
UNW_ARM_SPSR_SVC ,
162
-
162
+
163
163
/* User mode registers. */
164
164
UNW_ARM_R8_USR = 144 ,
165
165
UNW_ARM_R9_USR ,
@@ -168,7 +168,7 @@ typedef enum
168
168
UNW_ARM_R12_USR ,
169
169
UNW_ARM_R13_USR ,
170
170
UNW_ARM_R14_USR ,
171
-
171
+
172
172
/* FIQ registers. */
173
173
UNW_ARM_R8_FIQ = 151 ,
174
174
UNW_ARM_R9_FIQ ,
@@ -177,23 +177,23 @@ typedef enum
177
177
UNW_ARM_R12_FIQ ,
178
178
UNW_ARM_R13_FIQ ,
179
179
UNW_ARM_R14_FIQ ,
180
-
180
+
181
181
/* IRQ registers. */
182
182
UNW_ARM_R13_IRQ = 158 ,
183
183
UNW_ARM_R14_IRQ ,
184
-
184
+
185
185
/* ABT registers. */
186
186
UNW_ARM_R13_ABT = 160 ,
187
187
UNW_ARM_R14_ABT ,
188
-
188
+
189
189
/* UND registers. */
190
190
UNW_ARM_R13_UND = 162 ,
191
191
UNW_ARM_R14_UND ,
192
-
192
+
193
193
/* SVC registers. */
194
194
UNW_ARM_R13_SVC = 164 ,
195
195
UNW_ARM_R14_SVC ,
196
-
196
+
197
197
/* iWMMXt control registers. */
198
198
UNW_ARM_wC0 = 192 ,
199
199
UNW_ARM_wC1 ,
@@ -273,6 +273,13 @@ unw_tdep_context_t;
273
273
may be sufficient for all libunwind use cases.
274
274
In thumb mode, we return directly back to thumb mode on return (with bx), to
275
275
avoid altering any registers after unw_resume. */
276
+
277
+ #ifdef __SOFTFP__
278
+ #define VSTMIA "nop\n" /* align return address to value stored by stmia */
279
+ #else
280
+ #define VSTMIA "vstmia %[base], {d0-d15}\n" /* this also aligns return address to value stored by stmia */
281
+ #endif
282
+
276
283
#ifndef __thumb__
277
284
#define unw_tdep_getcontext (uc ) ({ \
278
285
unw_tdep_context_t *unw_ctx = (uc); \
@@ -281,7 +288,7 @@ unw_tdep_context_t;
281
288
__asm__ __volatile__ ( \
282
289
"mov r0, #0\n" \
283
290
"stmia %[base]!, {r0-r15}\n" \
284
- "vstmia %[base], {d0-d15}\n" /* this also aligns return address to value stored by stmia */ \
291
+ VSTMIA \
285
292
: [r0] "=r" (r0) : [base] "r" (unw_base) : "memory"); \
286
293
(int)r0; })
287
294
#else /* __thumb__ */
@@ -298,13 +305,13 @@ unw_tdep_context_t;
298
305
"stmia %[base], {r0-r14}\n" \
299
306
"adr r0, ret%=+1\n" \
300
307
"stmia %[base]!, {r0}\n" \
301
- "vstmia %[base], {d0-d15}\n" \
308
+ VSTMIA \
302
309
"orr r0, pc, #1\n" \
303
310
"bx r0\n" \
304
311
".code 16\n" \
305
312
"mov r0, #0\n" \
306
313
"ret%=:\n" \
307
- : [r0] "=r" (r0), [base] "+r" (unw_base) : : "memory", "cc"); \
314
+ : [r0] "=r" (r0), [base] "+r" (unw_base) : : "memory", "cc"); \
308
315
(int)r0; })
309
316
#endif
310
317
0 commit comments