90
90
===================================================================
91
--- configure (revision 127222)
92
+++ configure (working copy)
94
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
97
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
98
- noconfigdirs="$noconfigdirs target-libjava target-libobjc"
99
+ noconfigdirs="$noconfigdirs target-qthreads"
100
+ noconfigdirs="$noconfigdirs target-libobjc"
103
noconfigdirs="$noconfigdirs ${libgcj} target-libiberty"
105
===================================================================
106
--- configure.in (revision 127222)
107
+++ configure.in (working copy)
109
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
111
arm*-*-linux-gnueabi)
112
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
113
- noconfigdirs="$noconfigdirs target-libjava target-libobjc"
114
+ noconfigdirs="$noconfigdirs target-qthreads"
115
+ noconfigdirs="$noconfigdirs target-libobjc"
118
noconfigdirs="$noconfigdirs ${libgcj} target-libiberty"
91
--- configure (revision 126979)
92
+++ configure (revision 127340)
94
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
97
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
98
- noconfigdirs="$noconfigdirs target-libjava target-libobjc"
99
+ noconfigdirs="$noconfigdirs target-qthreads"
100
+ noconfigdirs="$noconfigdirs target-libobjc"
101
case ${with_newlib} in
102
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
105
===================================================================
106
--- configure.ac (revision 126979)
107
+++ configure.ac (revision 127340)
109
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
111
arm*-*-linux-gnueabi)
112
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
113
- noconfigdirs="$noconfigdirs target-libjava target-libobjc"
114
+ noconfigdirs="$noconfigdirs target-qthreads"
115
+ noconfigdirs="$noconfigdirs target-libobjc"
116
case ${with_newlib} in
117
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
119
Index: gcc/config/arm/libunwind.S
120
===================================================================
121
--- gcc/config/arm/libunwind.S (revision 126979)
122
+++ gcc/config/arm/libunwind.S (revision 127340)
124
UNWIND_WRAPPER _Unwind_Resume 1
125
UNWIND_WRAPPER _Unwind_Resume_or_Rethrow 1
126
UNWIND_WRAPPER _Unwind_ForcedUnwind 3
127
+UNWIND_WRAPPER _Unwind_Backtrace 2
129
-#endif /* __symbian__ */
130
+#endif /* ndef __symbian__ */
131
Index: gcc/config/arm/unwind-arm.c
132
===================================================================
133
--- gcc/config/arm/unwind-arm.c (revision 126979)
134
+++ gcc/config/arm/unwind-arm.c (revision 127340)
139
+/* Perform stack backtrace through unwind data. */
141
+__gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument,
142
+ phase2_vrs * entry_vrs);
144
+__gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument,
145
+ phase2_vrs * entry_vrs)
147
+ phase1_vrs saved_vrs;
148
+ _Unwind_Reason_Code code;
150
+ _Unwind_Control_Block ucb;
151
+ _Unwind_Control_Block *ucbp = &ucb;
153
+ /* Set the pc to the call site. */
154
+ entry_vrs->core.r[R_PC] = entry_vrs->core.r[R_LR];
156
+ /* Save the core registers. */
157
+ saved_vrs.core = entry_vrs->core;
158
+ /* Set demand-save flags. */
159
+ saved_vrs.demand_save_flags = ~(_uw) 0;
163
+ /* Find the entry for this routine. */
164
+ if (get_eit_entry (ucbp, saved_vrs.core.r[R_PC]) != _URC_OK)
165
+ return _URC_FAILURE;
167
+ /* Call trace function. */
168
+ if ((*trace) ((_Unwind_Context *) &saved_vrs, trace_argument)
170
+ return _URC_FAILURE;
172
+ /* Call the pr to decide what to do. */
173
+ code = ((personality_routine) UCB_PR_ADDR (ucbp))
174
+ (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND,
175
+ ucbp, (void *) &saved_vrs);
177
+ while (code != _URC_END_OF_STACK);
183
/* Common implementation for ARM ABI defined personality routines.
184
ID is the index of the personality routine, other arguments are as defined
185
by __aeabi_unwind_cpp_pr{0,1,2}. */
186
Index: gcc/config/arm/unwind-arm.h
187
===================================================================
188
--- gcc/config/arm/unwind-arm.h (revision 126979)
189
+++ gcc/config/arm/unwind-arm.h (revision 127340)
191
_Unwind_Control_Block *, struct _Unwind_Context *, void *);
192
_Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *,
193
_Unwind_Stop_Fn, void *);
194
+ /* @@@ Use unwind data to perform a stack backtrace. The trace callback
195
+ is called for every stack frame in the call chain, but no cleanup
196
+ actions are performed. */
197
+ typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (_Unwind_Context *, void *);
198
+ _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn,
201
_Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
202
void _Unwind_Complete(_Unwind_Control_Block *ucbp);
203
void _Unwind_DeleteException (_Unwind_Exception *);
204
Index: libffi/src/arm/ffi.c
205
===================================================================
206
--- libffi/src/arm/ffi.c (revision 126979)
207
+++ libffi/src/arm/ffi.c (revision 127340)
212
- if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) {
213
+ if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
214
*(void **) argp = ecif->rvalue;
218
argp = (char *) ALIGN(argp, (*p_arg)->alignment);
221
+ if ((*p_arg)->type == FFI_TYPE_STRUCT)
222
+ argp = (char *) ALIGN(argp, 4);
230
case FFI_TYPE_STRUCT:
231
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
232
+ memcpy(argp, *p_argv, (*p_arg)->size);
237
switch (cif->rtype->type)
240
- case FFI_TYPE_STRUCT:
242
case FFI_TYPE_DOUBLE:
243
cif->flags = (unsigned) cif->rtype->type;
245
cif->flags = (unsigned) FFI_TYPE_SINT64;
248
+ case FFI_TYPE_STRUCT:
249
+ if (cif->rtype->size <= 4)
250
+ /* A Composite Type not larger than 4 bytes is returned in r0. */
251
+ cif->flags = (unsigned)FFI_TYPE_INT;
253
+ /* A Composite Type larger than 4 bytes, or whose size cannot
254
+ be determined statically ... is stored in memory at an
255
+ address passed [in r0]. */
256
+ cif->flags = (unsigned)FFI_TYPE_STRUCT;
260
cif->flags = FFI_TYPE_INT;
262
@@ -141,21 +154,27 @@
266
+ int small_struct = (cif->flags == FFI_TYPE_INT
267
+ && cif->rtype->type == FFI_TYPE_STRUCT);
270
ecif.avalue = avalue;
274
/* If the return value is a struct and we don't have a return */
275
/* value address then we need to make one */
277
if ((rvalue == NULL) &&
278
- (cif->rtype->type == FFI_TYPE_STRUCT))
279
+ (cif->flags == FFI_TYPE_STRUCT))
281
ecif.rvalue = alloca(cif->rtype->size);
283
+ else if (small_struct)
284
+ ecif.rvalue = &temp;
286
ecif.rvalue = rvalue;
298
+ memcpy (rvalue, &temp, cif->rtype->size);
301
/** private members **/
306
+ size_t alignment = (*p_arg)->alignment;
309
/* Align if necessary */
310
- if ((sizeof(int) - 1) & (unsigned) argp) {
311
- argp = (char *) ALIGN(argp, sizeof(int));
312
+ if ((alignment - 1) & (unsigned) argp) {
313
+ argp = (char *) ALIGN(argp, alignment);
317
@@ -248,21 +272,16 @@
319
/* How to make a trampoline. */
321
-#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
322
-({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
323
- unsigned int __fun = (unsigned int)(FUN); \
324
- unsigned int __ctx = (unsigned int)(CTX); \
325
+#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
326
+({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
327
+ unsigned int __fun = (unsigned int)(FUN); \
328
+ unsigned int __ctx = (unsigned int)(CTX); \
329
*(unsigned int*) &__tramp[0] = 0xe92d000f; /* stmfd sp!, {r0-r3} */ \
330
- *(unsigned int*) &__tramp[4] = 0xe59f0000; /* ldr r0, [pc] */ \
331
- *(unsigned int*) &__tramp[8] = 0xe59ff000; /* ldr pc, [pc] */ \
332
- *(unsigned int*) &__tramp[12] = __ctx; \
333
- *(unsigned int*) &__tramp[16] = __fun; \
334
- register unsigned long _beg __asm ("a1") = (unsigned long) (&__tramp[0]); \
335
- register unsigned long _end __asm ("a2") = (unsigned long) (&__tramp[19]); \
336
- register unsigned long _flg __asm ("a3") = 0; \
337
- __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \
339
- : "0" (_beg), "r" (_end), "r" (_flg)); \
340
+ *(unsigned int*) &__tramp[4] = 0xe59f0000; /* ldr r0, [pc] */ \
341
+ *(unsigned int*) &__tramp[8] = 0xe59ff000; /* ldr pc, [pc] */ \
342
+ *(unsigned int*) &__tramp[12] = __ctx; \
343
+ *(unsigned int*) &__tramp[16] = __fun; \
344
+ __clear_cache((&__tramp[0]), (&__tramp[19])); \
119
348
Index: gcc/config/arm/libunwind.S
120
349
===================================================================
121
350
--- gcc/config/arm/libunwind.S (revision 126979)