diff options
Diffstat (limited to 'meta-linaro-integration/recipes-overlayed/firefox/firefox/porting')
12 files changed, 913 insertions, 0 deletions
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Add-xptcall-support-for-SH4-processors.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Add-xptcall-support-for-SH4-processors.patch new file mode 100644 index 0000000..9e2f26c --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Add-xptcall-support-for-SH4-processors.patch | |||
@@ -0,0 +1,522 @@ | |||
1 | From: Mike Hommey <glandium@debian.org> | ||
2 | Date: Fri, 30 Apr 2010 11:03:50 +0200 | ||
3 | Subject: Add xptcall support for SH4 processors | ||
4 | |||
5 | Closes: #553593 | ||
6 | https://bugzilla.mozilla.org/show_bug.cgi?id=382214 | ||
7 | --- | ||
8 | xpcom/reflect/xptcall/src/md/unix/Makefile.in | 11 + | ||
9 | .../xptcall/src/md/unix/xptcinvoke_linux_sh.cpp | 203 +++++++++++++++ | ||
10 | .../xptcall/src/md/unix/xptcstubs_linux_sh.cpp | 271 ++++++++++++++++++++ | ||
11 | 3 files changed, 485 insertions(+) | ||
12 | create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp | ||
13 | create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp | ||
14 | |||
15 | diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in | ||
16 | index 6c50821..44d6ab1 100644 | ||
17 | --- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in | ||
18 | +++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in | ||
19 | @@ -430,6 +430,17 @@ CPPSRCS := xptcinvoke_linux_s390x.cpp xptcstubs_linux_s390x.cpp | ||
20 | CXXFLAGS += -fno-strict-aliasing -fno-inline -fomit-frame-pointer -mbackchain | ||
21 | endif | ||
22 | |||
23 | +############ | ||
24 | +# SuperH | ||
25 | +############ | ||
26 | +# | ||
27 | +# | ||
28 | +# Currently, tested on sh4 and sh4a (non sh4al and sh4al-dsp..) | ||
29 | +ifeq ($(OS_ARCH),Linux) | ||
30 | +ifneq (,$(filter sh4 sh4a,$(OS_TEST))) | ||
31 | +CPPSRCS := xptcinvoke_linux_sh.cpp xptcstubs_linux_sh.cpp | ||
32 | +endif | ||
33 | +endif | ||
34 | |||
35 | # we don't want the shared lib, but we want to force the creation of a static lib. | ||
36 | FORCE_STATIC_LIB = 1 | ||
37 | diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp | ||
38 | new file mode 100644 | ||
39 | index 0000000..ca4807d | ||
40 | --- /dev/null | ||
41 | +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp | ||
42 | @@ -0,0 +1,203 @@ | ||
43 | +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
44 | + * | ||
45 | + * ***** BEGIN LICENSE BLOCK ***** | ||
46 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
47 | + * | ||
48 | + * The contents of this file are subject to the Mozilla Public License Version | ||
49 | + * 1.1 (the "License"); you may not use this file except in compliance with | ||
50 | + * the License. You may obtain a copy of the License at | ||
51 | + * http://www.mozilla.org/MPL/ | ||
52 | + * | ||
53 | + * Software distributed under the License is distributed on an "AS IS" basis, | ||
54 | + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
55 | + * for the specific language governing rights and limitations under the | ||
56 | + * License. | ||
57 | + * | ||
58 | + * The Original Code is mozilla.org code. | ||
59 | + * | ||
60 | + * The Initial Developer of the Original Code is | ||
61 | + * Netscape Communications Corporation. | ||
62 | + * Portions created by the Initial Developer are Copyright (C) 1998 | ||
63 | + * the Initial Developer. All Rights Reserved. | ||
64 | + * | ||
65 | + * Contributor(s): | ||
66 | + * - Copyright (C) 2008-2009 STMicroelectronics | ||
67 | + * | ||
68 | + * Alternatively, the contents of this file may be used under the terms of | ||
69 | + * either of the GNU General Public License Version 2 or later (the "GPL"), | ||
70 | + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
71 | + * in which case the provisions of the GPL or the LGPL are applicable instead | ||
72 | + * of those above. If you wish to allow use of your version of this file only | ||
73 | + * under the terms of either the GPL or the LGPL, and not to allow others to | ||
74 | + * use your version of this file under the terms of the MPL, indicate your | ||
75 | + * decision by deleting the provisions above and replace them with the notice | ||
76 | + * and other provisions required by the GPL or the LGPL. If you do not delete | ||
77 | + * the provisions above, a recipient may use your version of this file under | ||
78 | + * the terms of any one of the MPL, the GPL or the LGPL. | ||
79 | + * | ||
80 | + * Based on the neutroni port, however that assumed that the compiler was pushing params | ||
81 | + * onto the stack. Change to take this into account. | ||
82 | + * | ||
83 | + * ***** END LICENSE BLOCK ***** */ | ||
84 | + | ||
85 | +#include "xptcprivate.h" | ||
86 | + | ||
87 | +extern "C" { | ||
88 | + | ||
89 | +const int c_int_register_params = 4; | ||
90 | +const int c_float_register_params = 8; | ||
91 | + | ||
92 | +static PRUint32 __attribute__((__used__)) | ||
93 | +copy_to_stack(PRUint32 **that,PRUint32 methodIndex,PRUint32 paramCount, nsXPTCVariant* s,PRUint32* data) | ||
94 | +{ | ||
95 | + int intCount = 1; // Because of that | ||
96 | + int floatCount = 0; | ||
97 | + PRUint32 *intRegParams=data+1 ; | ||
98 | + float *floatRegParams = (float *)(data+4); | ||
99 | + | ||
100 | + /* Push the that register into the right place so it can be restored on exit */ | ||
101 | + *data= (PRUint32)(that); | ||
102 | + data+=12; /* 4 integer registers, and 8 floating point registers */ | ||
103 | + | ||
104 | + for ( PRUint32 i = 0; i < paramCount; ++i, ++s ) | ||
105 | + { | ||
106 | + nsXPTType type = s->IsPtrData() ? nsXPTType::T_I32 : s->type; | ||
107 | + | ||
108 | + switch ( type ) { | ||
109 | + case nsXPTType::T_I64: | ||
110 | + case nsXPTType::T_U64: | ||
111 | + // Space to pass in registers? | ||
112 | + if ( (c_int_register_params - intCount) >= 2 ) { | ||
113 | + *((PRInt64 *) intRegParams) = s->val.i64; | ||
114 | + intRegParams += 2; | ||
115 | + intCount += 2; | ||
116 | + } | ||
117 | + else { | ||
118 | + *((PRInt64*) data) = s->val.i64; | ||
119 | + data += 2; | ||
120 | + } | ||
121 | + break; | ||
122 | + case nsXPTType::T_FLOAT: | ||
123 | + // Space to pass in registers? | ||
124 | + if ( floatCount < c_float_register_params ) { | ||
125 | + *floatRegParams = s->val.f; | ||
126 | + ++floatCount; | ||
127 | + ++floatRegParams; | ||
128 | + } | ||
129 | + else { | ||
130 | + *((float*) data) = s->val.f; | ||
131 | + ++data; | ||
132 | + } | ||
133 | + break; | ||
134 | + case nsXPTType::T_DOUBLE: | ||
135 | + // Space to pass in registers? | ||
136 | + if ( (c_float_register_params - floatCount) >= 2 ) { | ||
137 | + if ( (floatCount & 1) != 0 ) { | ||
138 | + ++floatCount; | ||
139 | + ++floatRegParams; | ||
140 | + } | ||
141 | + *(double *)floatRegParams = s->val.d; | ||
142 | + floatCount += 2; | ||
143 | + floatRegParams += 2; | ||
144 | + } | ||
145 | + else { | ||
146 | + *((double *) data) = s->val.d; | ||
147 | + data += 2; | ||
148 | + } | ||
149 | + break; | ||
150 | + default: // 32 (non-float) value | ||
151 | + PRInt32 value = (PRInt32) (s->IsPtrData() ? s->ptr : s->val.p); | ||
152 | + // Space to pass in registers? | ||
153 | + if ( intCount < c_int_register_params ) { | ||
154 | + *intRegParams = value; | ||
155 | + ++intRegParams; | ||
156 | + ++intCount; | ||
157 | + } | ||
158 | + else { | ||
159 | + *data = value; | ||
160 | + ++data; | ||
161 | + } | ||
162 | + break; | ||
163 | + } | ||
164 | + } | ||
165 | + | ||
166 | + /* Now calculate the return address | ||
167 | + * Dereference that to get vtable pointer | ||
168 | + */ | ||
169 | + return *( (*(that))+(methodIndex) ); | ||
170 | + | ||
171 | +} | ||
172 | + | ||
173 | +} | ||
174 | + | ||
175 | + /* This was originally done as a C function, but the original code was | ||
176 | + * relying on how the compiler laid out the stack. Later versions of | ||
177 | + * gcc do a better job of optimising and never push the parameters on the | ||
178 | + * stack. So it is simpler to just write the whole thing in assembler anyway | ||
179 | + */ | ||
180 | + | ||
181 | + /* Because the SH processor passes the first few parameters in registers | ||
182 | + it is a bit tricky setting things up right. To make things easier, | ||
183 | + all the hard work will be done by copy_to_stack above. We pass to it | ||
184 | + a chunk of memory, the bottom of which will be copied to registers r4 to r7 | ||
185 | + and fr4 to fr11 before calling the target function. | ||
186 | + */ | ||
187 | + | ||
188 | +/* r4= that, r5=methodIndex,r6=paramCount,r7=params */ | ||
189 | + | ||
190 | + __asm__ ( | ||
191 | + | ||
192 | + | ||
193 | + /* Make space for parameters to be passed to the method. Assume worst case | ||
194 | + 8 bytes per parameter. Also leave space for 4 longs and 8 floats that | ||
195 | + will be put into registers. The worst case is all int64 parameters | ||
196 | + and even in this case 8 bytes are passed in registers so we can | ||
197 | + deduct this from our allocation. | ||
198 | + */ | ||
199 | + ".section .text\n" | ||
200 | + ".balign 4\n" | ||
201 | + ".global NS_InvokeByIndex_P\n" | ||
202 | + "NS_InvokeByIndex_P:\n" | ||
203 | + "mov.l r14, @-r15 \n\t" // Push frame | ||
204 | + "sts.l pr, @-r15 \n\t" // Push link | ||
205 | + "mov.l r8, @-r15 \n\t" // Save | ||
206 | + "mov r15, r14\n\t" // Set frame | ||
207 | + "mov #3, r1 \n\t" // Assume worse case, all params are 64bit, hence *8 | ||
208 | + "mov r6, r2\n\t" | ||
209 | + "shld r1, r2 \n\t" | ||
210 | + "mov r2, r8 \n\t" // Save stack drop | ||
211 | + "add #48, r2 \n\t" // Space for 4 longs, 8 floats | ||
212 | + "sub r2, r15 \n\t" // Drop stack | ||
213 | + "mov.l 1f, r1 \n\t" // Get address of copy_to_stack_function | ||
214 | + "jsr @r1 \n\t" | ||
215 | + "mov.l r15, @-r15 \n\t" // Params will be dumped here | ||
216 | + "add #4, r15 \n\t" // Pop stack ptr param. r0 contains method address | ||
217 | + | ||
218 | + /* Now everything is laid out nicely in the stack. We just have to | ||
219 | + load values at the top end of the memory area into registers and | ||
220 | + make the call. We may load more things into registers than needed, | ||
221 | + but nobody will care about that. | ||
222 | + */ | ||
223 | + | ||
224 | + "mov.l @r15+, r4 \n\t" // that | ||
225 | + "mov.l @r15+, r5 \n\t" | ||
226 | + "mov.l @r15+, r6 \n\t" | ||
227 | + "mov.l @r15+, r7 \n\t" | ||
228 | + "fmov.s @r15+, fr5 \n\t" | ||
229 | + "fmov.s @r15+, fr4 \n\t" | ||
230 | + "fmov.s @r15+, fr7 \n\t" | ||
231 | + "fmov.s @r15+, fr6 \n\t" | ||
232 | + "fmov.s @r15+, fr9 \n\t" | ||
233 | + "fmov.s @r15+, fr8 \n\t" | ||
234 | + "fmov.s @r15+, fr11 \n\t" | ||
235 | + "jsr @r0 \n\t" // Invoke method | ||
236 | + "fmov.s @r15+, fr10 \n\t" | ||
237 | + "add r8, r15\n\t" // Pop stack back | ||
238 | + "mov.l @r15+, r8\n\t" // Restore r8 | ||
239 | + "lds.l @r15+, pr\n\t" | ||
240 | + "rts\n\t" | ||
241 | + "mov.l @r15+, r14\n\t" | ||
242 | + ".balign 4\n\t" | ||
243 | + "1: .long copy_to_stack \n\t" | ||
244 | + ); | ||
245 | + | ||
246 | diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp | ||
247 | new file mode 100644 | ||
248 | index 0000000..cf9fcea | ||
249 | --- /dev/null | ||
250 | +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp | ||
251 | @@ -0,0 +1,271 @@ | ||
252 | +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
253 | +/* ***** BEGIN LICENSE BLOCK ***** | ||
254 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
255 | + * | ||
256 | + * The contents of this file are subject to the Mozilla Public License Version | ||
257 | + * 1.1 (the "License"); you may not use this file except in compliance with | ||
258 | + * the License. You may obtain a copy of the License at | ||
259 | + * http://www.mozilla.org/MPL/ | ||
260 | + * | ||
261 | + * Software distributed under the License is distributed on an "AS IS" basis, | ||
262 | + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
263 | + * for the specific language governing rights and limitations under the | ||
264 | + * License. | ||
265 | + * | ||
266 | + * The Original Code is mozilla.org code. | ||
267 | + * | ||
268 | + * The Initial Developer of the Original Code is | ||
269 | + * Netscape Communications Corporation. | ||
270 | + * Portions created by the Initial Developer are Copyright (C) 1999 | ||
271 | + * the Initial Developer. All Rights Reserved. | ||
272 | + * | ||
273 | + * Contributor(s): | ||
274 | + * - Copyright (C) 2008-2009 STMicroelectronics | ||
275 | + * | ||
276 | + * Alternatively, the contents of this file may be used under the terms of | ||
277 | + * either of the GNU General Public License Version 2 or later (the "GPL"), | ||
278 | + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
279 | + * in which case the provisions of the GPL or the LGPL are applicable instead | ||
280 | + * of those above. If you wish to allow use of your version of this file only | ||
281 | + * under the terms of either the GPL or the LGPL, and not to allow others to | ||
282 | + * use your version of this file under the terms of the MPL, indicate your | ||
283 | + * decision by deleting the provisions above and replace them with the notice | ||
284 | + * and other provisions required by the GPL or the LGPL. If you do not delete | ||
285 | + * the provisions above, a recipient may use your version of this file under | ||
286 | + * the terms of any one of the MPL, the GPL or the LGPL. | ||
287 | + * | ||
288 | + * Based on the neutrino code, with some bug fixes and using the C preprocessor | ||
289 | + * like all the other ports rather than the python script. | ||
290 | + * | ||
291 | + * ***** END LICENSE BLOCK ***** */ | ||
292 | + | ||
293 | +#include "xptcprivate.h" | ||
294 | +#include "xptiprivate.h" | ||
295 | + | ||
296 | +const int c_int_register_params = 3; | ||
297 | +const int c_float_register_params = 8; | ||
298 | + | ||
299 | +/* | ||
300 | + Dispatch function for all stubs. | ||
301 | + | ||
302 | + The parameters to the original function are spread between 'data' which | ||
303 | + is value of the stack pointer when the stub was called, intRegParams which | ||
304 | + points to an area containing the values of r5, r6 and r7 when the stub was | ||
305 | + called and floatRegParams which points to an area containing the values | ||
306 | + of float registers fr4 to fr11 when the stub was called. | ||
307 | + | ||
308 | + */ | ||
309 | +extern "C" nsresult | ||
310 | +PrepareAndDispatch(nsXPTCStubBase* self, int methodIndex, PRUint32* data, | ||
311 | + PRUint32 *intRegParams, float *floatRegParams) | ||
312 | +{ | ||
313 | +#define PARAM_BUFFER_COUNT 16 | ||
314 | + | ||
315 | + nsresult result = NS_ERROR_FAILURE; | ||
316 | + int intCount = 0; | ||
317 | + int floatCount = 0; | ||
318 | + nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; | ||
319 | + nsXPTCMiniVariant* dispatchParams = NULL; | ||
320 | + const nsXPTMethodInfo* info; | ||
321 | + PRUint8 paramCount; | ||
322 | + PRUint8 i; | ||
323 | + | ||
324 | + NS_ASSERTION(self,"no self"); | ||
325 | + | ||
326 | + self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); | ||
327 | + NS_ASSERTION(info,"no interface info"); | ||
328 | + | ||
329 | + paramCount = info->GetParamCount(); | ||
330 | + | ||
331 | + // setup variant array pointer | ||
332 | + if(paramCount > PARAM_BUFFER_COUNT) | ||
333 | + dispatchParams = new nsXPTCMiniVariant[paramCount]; | ||
334 | + else | ||
335 | + dispatchParams = paramBuffer; | ||
336 | + NS_ASSERTION(dispatchParams,"no place for params"); | ||
337 | + | ||
338 | + for ( i = 0; i < paramCount; ++i ) { | ||
339 | + const nsXPTParamInfo& param = info->GetParam(i); | ||
340 | + nsXPTCMiniVariant* dp = &dispatchParams[i]; | ||
341 | + nsXPTType type = param.IsOut() ? nsXPTType::T_I32 : param.GetType(); | ||
342 | + | ||
343 | + switch ( type ) { | ||
344 | + case nsXPTType::T_I64: | ||
345 | + case nsXPTType::T_U64: | ||
346 | + // Was this passed in a register? | ||
347 | + if ( (c_int_register_params - intCount) >= 2 ) { | ||
348 | + dp->val.i64 = *((PRInt64 *) intRegParams); | ||
349 | + intRegParams += 2; | ||
350 | + intCount += 2; | ||
351 | + } | ||
352 | + else { | ||
353 | + dp->val.i64 = *((PRInt64*) data); | ||
354 | + data += 2; | ||
355 | + } | ||
356 | + break; | ||
357 | + case nsXPTType::T_FLOAT: | ||
358 | + // Was this passed in a register? | ||
359 | + if ( floatCount < c_float_register_params ) { | ||
360 | + dp->val.f = *floatRegParams; | ||
361 | + ++floatCount; | ||
362 | + ++floatRegParams; | ||
363 | + } | ||
364 | + else { | ||
365 | + dp->val.f = *((float*) data); | ||
366 | + ++data; | ||
367 | + } | ||
368 | + break; | ||
369 | + case nsXPTType::T_DOUBLE: | ||
370 | + // Was this passed in a register? | ||
371 | + if ( (c_float_register_params - floatCount) >= 2 ) { | ||
372 | + if ( floatCount & 1 != 0 ) { | ||
373 | + ++floatCount; | ||
374 | + ++floatRegParams; | ||
375 | + } | ||
376 | + dp->val.d = *(double *)floatRegParams; | ||
377 | + floatCount += 2; | ||
378 | + floatRegParams += 2; | ||
379 | + } | ||
380 | + else { | ||
381 | + dp->val.d = *((double *) data); | ||
382 | + data += 2; | ||
383 | + } | ||
384 | + break; | ||
385 | + default: // 32-bit (non-float) value | ||
386 | + // Was this passed in a register? | ||
387 | + if ( intCount < c_int_register_params ) { | ||
388 | + dp->val.i32 = *intRegParams; | ||
389 | + ++intRegParams; | ||
390 | + ++intCount; | ||
391 | + } | ||
392 | + else { | ||
393 | + dp->val.i32 = *data; | ||
394 | + ++data; | ||
395 | + } | ||
396 | + break; | ||
397 | + } | ||
398 | + } | ||
399 | + | ||
400 | + result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); | ||
401 | + | ||
402 | + if(dispatchParams != paramBuffer) | ||
403 | + delete [] dispatchParams; | ||
404 | + | ||
405 | + return result; | ||
406 | +} | ||
407 | + | ||
408 | + | ||
409 | +__asm__ ( | ||
410 | + ".text\n" | ||
411 | + ".little\n" | ||
412 | + ".section .rodata\n" | ||
413 | + | ||
414 | + ".globl SharedStub\n" | ||
415 | + ".type SharedStub, @function\n" | ||
416 | + "SharedStub:\n" | ||
417 | + "mov r15, r1\n" | ||
418 | + "mov.l r14,@-r15\n" | ||
419 | + "sts.l pr,@-r15\n" | ||
420 | + "mov r15, r14\n" | ||
421 | + | ||
422 | + /* Some parameters might have been passed in registers, so push them | ||
423 | + * all onto the stack, PrepareAndDispatch can then work out whats what | ||
424 | + * given method type information. | ||
425 | + */ | ||
426 | + "mov.l r7, @-r15\n" | ||
427 | + "mov.l r6, @-r15\n" | ||
428 | + "mov.l r5, @-r15\n" | ||
429 | + "mov r15, r7\n" /* r7 = PrepareAndDispatch intRegParams param */ | ||
430 | + | ||
431 | + "fmov.s fr10, @-r15\n" | ||
432 | + "fmov.s fr11, @-r15\n" | ||
433 | + "fmov.s fr8, @-r15\n" | ||
434 | + "fmov.s fr9, @-r15\n" | ||
435 | + "fmov.s fr6, @-r15\n" | ||
436 | + "fmov.s fr7, @-r15\n" | ||
437 | + "fmov.s fr4, @-r15\n" | ||
438 | + "fmov.s fr5, @-r15\n" | ||
439 | + "mov.l r15, @-r15\n" /* PrepareAndDispatch floatRegParams param */ | ||
440 | + | ||
441 | + "mov r1, r6\n" /* r6 = PrepareAndDispatch data param */ | ||
442 | + | ||
443 | + "mov.l 1f, r1\n" | ||
444 | + "jsr @r1\n" /* Note, following instruction is executed first*/ | ||
445 | + "mov r2, r5\n" /* r5 = PrepareAndDispatch methodIndex param */ | ||
446 | + | ||
447 | + "mov r14,r15\n" | ||
448 | + "lds.l @r15+,pr\n" | ||
449 | + "mov.l @r15+,r14\n" | ||
450 | + "rts\n" | ||
451 | + "nop\n" | ||
452 | + ".align 2\n" | ||
453 | + "1:\n" | ||
454 | + ".long PrepareAndDispatch\n" | ||
455 | + ); | ||
456 | + | ||
457 | +#define STUB_ENTRY(n) \ | ||
458 | +__asm__( \ | ||
459 | + ".text\n" \ | ||
460 | + ".align 1 \n" \ | ||
461 | + ".if " #n " < 10\n\t" \ | ||
462 | + ".globl _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \ | ||
463 | + ".type _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n"\ | ||
464 | + "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \ | ||
465 | + ".elseif " #n " < 100\n\t" \ | ||
466 | + ".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \ | ||
467 | + ".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n"\ | ||
468 | + "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \ | ||
469 | + ".elseif " #n " < 1000\n\t" \ | ||
470 | + ".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \ | ||
471 | + ".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n"\ | ||
472 | + "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \ | ||
473 | + ".else\n\t" \ | ||
474 | + ".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \ | ||
475 | + ".endif\n\t" \ | ||
476 | + "mov.l 1f, r1 \n" \ | ||
477 | + ".if "#n" < 128 \n" \ | ||
478 | + "jmp @r1 \n" \ | ||
479 | + " mov #"#n",r2 \n" \ | ||
480 | + ".elseif "#n" < 256 \n" \ | ||
481 | + "mov #"#n", r2 \n" \ | ||
482 | + "jmp @r1 \n" \ | ||
483 | + " extu.b r2, r2 \n" \ | ||
484 | + ".else \n" \ | ||
485 | + "mov #"#n" & 0xff,r2 \n" \ | ||
486 | + "extu.b r2, r2 \n" \ | ||
487 | + "mov #"#n">>8, r3 \n" \ | ||
488 | + "shll8 r3 \n" \ | ||
489 | + "jmp @r1 \n" \ | ||
490 | + " or r3, r2 \n" \ | ||
491 | + ".endif \n" \ | ||
492 | + ".if "#n" % 20 == 0\n" \ | ||
493 | + ".align 2\n" \ | ||
494 | + "1:\n" \ | ||
495 | + ".long SharedStub\n" \ | ||
496 | + ".endif\n" \ | ||
497 | + ); | ||
498 | + | ||
499 | + | ||
500 | +/* Due to the fact that the SH4 can only load forward labels, we have | ||
501 | + * to use sentinel_entry to output the last label. A better solution | ||
502 | + * would be to introduce a STUB_LAST macro in the defs.in file, but | ||
503 | + * this will do for now | ||
504 | + */ | ||
505 | + | ||
506 | +#define SENTINEL_ENTRY(n) \ | ||
507 | +__asm__( \ | ||
508 | +".if "#n" == 0 \n" \ | ||
509 | + ".text \n" \ | ||
510 | + ".align 2\n" \ | ||
511 | + "1:\n" \ | ||
512 | + ".long SharedStub\n" \ | ||
513 | +".endif\n" \ | ||
514 | +); \ | ||
515 | + \ | ||
516 | +nsresult nsXPTCStubBase::Sentinel##n() \ | ||
517 | +{ \ | ||
518 | + NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ | ||
519 | + return NS_ERROR_NOT_IMPLEMENTED; \ | ||
520 | +} | ||
521 | + | ||
522 | +#include "xptcstubsdef.inc" | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch new file mode 100644 index 0000000..bf73dc0 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Fri, 5 Aug 2011 11:24:58 +0200 | ||
3 | Subject: Allow ipc code to build on GNU/Hurd | ||
4 | |||
5 | --- | ||
6 | ipc/chromium/src/base/debug_util_posix.cc | 1 - | ||
7 | ipc/chromium/src/base/third_party/nspr/prcpucfg.h | 2 +- | ||
8 | ipc/chromium/src/build/build_config.h | 2 +- | ||
9 | 3 files changed, 2 insertions(+), 3 deletions(-) | ||
10 | |||
11 | diff --git a/ipc/chromium/src/base/debug_util_posix.cc b/ipc/chromium/src/base/debug_util_posix.cc | ||
12 | index 72a4ebf..5a45ac9 100644 | ||
13 | --- a/ipc/chromium/src/base/debug_util_posix.cc | ||
14 | +++ b/ipc/chromium/src/base/debug_util_posix.cc | ||
15 | @@ -17,7 +17,6 @@ | ||
16 | #include <unistd.h> | ||
17 | #if MOZ_HAVE_EXECINFO_H | ||
18 | #include <execinfo.h> | ||
19 | -#include <sys/sysctl.h> | ||
20 | #endif | ||
21 | |||
22 | #include "base/basictypes.h" | ||
23 | diff --git a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h | ||
24 | index 30fef1b..c7e47ba 100644 | ||
25 | --- a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h | ||
26 | +++ b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h | ||
27 | @@ -34,7 +34,7 @@ | ||
28 | #include "base/third_party/nspr/prcpucfg_win.h" | ||
29 | #elif defined(__APPLE__) | ||
30 | #include "base/third_party/nspr/prcpucfg_mac.h" | ||
31 | -#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) | ||
32 | +#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) || defined(__GNU__) | ||
33 | #include "base/third_party/nspr/prcpucfg_linux.h" | ||
34 | #elif defined(__OpenBSD__) | ||
35 | #include "base/third_party/nspr/prcpucfg_openbsd.h" | ||
36 | diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h | ||
37 | index 4ef0c76..463b3d9 100644 | ||
38 | --- a/ipc/chromium/src/build/build_config.h | ||
39 | +++ b/ipc/chromium/src/build/build_config.h | ||
40 | @@ -17,7 +17,7 @@ | ||
41 | // A set of macros to use for platform detection. | ||
42 | #if defined(__APPLE__) | ||
43 | #define OS_MACOSX 1 | ||
44 | -#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) | ||
45 | +#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) || defined(__GNU__) | ||
46 | #define OS_LINUX 1 | ||
47 | #elif defined(__OpenBSD__) | ||
48 | #define OS_OPENBSD 1 | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch new file mode 100644 index 0000000..5c680f6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Thu, 30 Jun 2011 18:29:22 +0200 | ||
3 | Subject: Allow ipc code to build on GNU/kfreebsd | ||
4 | |||
5 | --- | ||
6 | ipc/chromium/src/base/platform_thread_posix.cc | 4 ++++ | ||
7 | ipc/chromium/src/base/third_party/nspr/prcpucfg.h | 2 +- | ||
8 | ipc/chromium/src/build/build_config.h | 2 +- | ||
9 | 3 files changed, 6 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc | ||
12 | index e3f49c7..f1d3b2f 100644 | ||
13 | --- a/ipc/chromium/src/base/platform_thread_posix.cc | ||
14 | +++ b/ipc/chromium/src/base/platform_thread_posix.cc | ||
15 | @@ -37,7 +37,11 @@ PlatformThreadId PlatformThread::CurrentId() { | ||
16 | // TODO(BSD): find a better thread ID | ||
17 | return (intptr_t)(pthread_self()); | ||
18 | #elif defined(OS_LINUX) | ||
19 | +#ifdef __NR_gettid | ||
20 | return syscall(__NR_gettid); | ||
21 | +#else | ||
22 | + return getpid(); | ||
23 | +#endif | ||
24 | #endif | ||
25 | } | ||
26 | |||
27 | diff --git a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h | ||
28 | index ef40994..30fef1b 100644 | ||
29 | --- a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h | ||
30 | +++ b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h | ||
31 | @@ -34,7 +34,7 @@ | ||
32 | #include "base/third_party/nspr/prcpucfg_win.h" | ||
33 | #elif defined(__APPLE__) | ||
34 | #include "base/third_party/nspr/prcpucfg_mac.h" | ||
35 | -#elif defined(__linux__) || defined(ANDROID) | ||
36 | +#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) | ||
37 | #include "base/third_party/nspr/prcpucfg_linux.h" | ||
38 | #elif defined(__OpenBSD__) | ||
39 | #include "base/third_party/nspr/prcpucfg_openbsd.h" | ||
40 | diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h | ||
41 | index 0952ab1..4ef0c76 100644 | ||
42 | --- a/ipc/chromium/src/build/build_config.h | ||
43 | +++ b/ipc/chromium/src/build/build_config.h | ||
44 | @@ -17,7 +17,7 @@ | ||
45 | // A set of macros to use for platform detection. | ||
46 | #if defined(__APPLE__) | ||
47 | #define OS_MACOSX 1 | ||
48 | -#elif defined(__linux__) || defined(ANDROID) | ||
49 | +#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) | ||
50 | #define OS_LINUX 1 | ||
51 | #elif defined(__OpenBSD__) | ||
52 | #define OS_OPENBSD 1 | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch new file mode 100644 index 0000000..83907bf --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Fri, 18 Nov 2011 11:27:29 +0100 | ||
3 | Subject: Bug 698923 - Don't require 16 bytes alignment for VMFrame on sparc | ||
4 | |||
5 | --- | ||
6 | js/src/methodjit/MethodJIT.cpp | 2 +- | ||
7 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
8 | |||
9 | diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp | ||
10 | index 4f7f5db..c3d01cb 100644 | ||
11 | --- a/js/src/methodjit/MethodJIT.cpp | ||
12 | +++ b/js/src/methodjit/MethodJIT.cpp | ||
13 | @@ -257,7 +257,7 @@ JS_STATIC_ASSERT(offsetof(FrameRegs, sp) == 0); | ||
14 | #if defined(__GNUC__) && !defined(_WIN64) | ||
15 | |||
16 | /* If this assert fails, you need to realign VMFrame to 16 bytes. */ | ||
17 | -#ifdef JS_CPU_ARM | ||
18 | +#if defined(JS_CPU_ARM) || defined(JS_CPU_SPARC) | ||
19 | JS_STATIC_ASSERT(sizeof(VMFrame) % 8 == 0); | ||
20 | #else | ||
21 | JS_STATIC_ASSERT(sizeof(VMFrame) % 16 == 0); | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch new file mode 100644 index 0000000..509b46a --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Fri, 18 Nov 2011 11:32:09 +0100 | ||
3 | Subject: Bug 703531 - Fix ARMAssembler::getOp2RegScale on < ARMv5 | ||
4 | |||
5 | --- | ||
6 | js/src/assembler/assembler/ARMAssembler.cpp | 4 ++-- | ||
7 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
8 | |||
9 | diff --git a/js/src/assembler/assembler/ARMAssembler.cpp b/js/src/assembler/assembler/ARMAssembler.cpp | ||
10 | index 78b8a7d..0458446 100644 | ||
11 | --- a/js/src/assembler/assembler/ARMAssembler.cpp | ||
12 | +++ b/js/src/assembler/assembler/ARMAssembler.cpp | ||
13 | @@ -112,10 +112,10 @@ ARMWord ARMAssembler::getOp2RegScale(RegisterID reg, ARMWord scale) | ||
14 | : // No clobbers. | ||
15 | ); | ||
16 | #else | ||
17 | - ARMWord lz = 0; // Accumulate leading zeroes. | ||
18 | + lz = 0; // Accumulate leading zeroes. | ||
19 | for (ARMWord s = 16; s > 0; s /= 2) { | ||
20 | ARMWord mask = 0xffffffff << (32-lz-s); | ||
21 | - if ((x & mask) == 0) { | ||
22 | + if ((scale & mask) == 0) { | ||
23 | lz += s; | ||
24 | } | ||
25 | } | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch new file mode 100644 index 0000000..981e7a7 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Fri, 18 Nov 2011 11:55:49 +0100 | ||
3 | Subject: Bug 703534 - Fix build failure on platforms without YARR JIT | ||
4 | |||
5 | --- | ||
6 | js/src/jscompartment.cpp | 1 - | ||
7 | 1 file changed, 1 deletion(-) | ||
8 | |||
9 | diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp | ||
10 | index 721c38e..af5a96e 100644 | ||
11 | --- a/js/src/jscompartment.cpp | ||
12 | +++ b/js/src/jscompartment.cpp | ||
13 | @@ -50,7 +50,6 @@ | ||
14 | #include "jswatchpoint.h" | ||
15 | #include "jswrapper.h" | ||
16 | #include "assembler/wtf/Platform.h" | ||
17 | -#include "assembler/jit/ExecutableAllocator.h" | ||
18 | #include "yarr/BumpPointerAllocator.h" | ||
19 | #include "methodjit/MethodJIT.h" | ||
20 | #include "methodjit/PolyIC.h" | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch new file mode 100644 index 0000000..e4e339e --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | From: Mike Hommey <mh+mozilla@glandium.org> | ||
2 | Date: Sat, 19 Nov 2011 09:44:10 +0100 | ||
3 | Subject: Bug 703833 - Avoid invalid conversion from 'const size_t*' to 'const | ||
4 | jsuword*' on s390 | ||
5 | |||
6 | --- | ||
7 | js/src/jsgc.cpp | 4 ++-- | ||
8 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp | ||
11 | index e8818d1..f25f0a5 100644 | ||
12 | --- a/js/src/jsgc.cpp | ||
13 | +++ b/js/src/jsgc.cpp | ||
14 | @@ -1052,8 +1052,8 @@ MarkStackRangeConservatively(JSTracer *trc, Value *beginv, Value *endv) | ||
15 | ~AutoSkipChecking() { runtime->gcCheckCompartment = savedCompartment; } | ||
16 | } as(trc->context->runtime); | ||
17 | |||
18 | - const jsuword *begin = beginv->payloadWord(); | ||
19 | - const jsuword *end = endv->payloadWord(); | ||
20 | + const jsuword *begin = (const jsuword *) beginv->payloadWord(); | ||
21 | + const jsuword *end = (const jsuword *) endv->payloadWord();; | ||
22 | #ifdef JS_NUNBOX32 | ||
23 | /* | ||
24 | * With 64-bit jsvals on 32-bit systems, we can optimize a bit by | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch new file mode 100644 index 0000000..c687ff4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From: Mike Hommey <mh+mozilla@glandium.org> | ||
2 | Date: Sat, 19 Nov 2011 09:37:34 +0100 | ||
3 | Subject: Bug 703842 - Avoid R_SPARC_WDISP22 relocation in TrampolineSparc.s | ||
4 | |||
5 | --- | ||
6 | js/src/methodjit/TrampolineSparc.s | 3 ++- | ||
7 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
8 | |||
9 | diff --git a/js/src/methodjit/TrampolineSparc.s b/js/src/methodjit/TrampolineSparc.s | ||
10 | index 0fa9cfd..1b15369 100644 | ||
11 | --- a/js/src/methodjit/TrampolineSparc.s | ||
12 | +++ b/js/src/methodjit/TrampolineSparc.s | ||
13 | @@ -112,7 +112,7 @@ throwpoline_exit: | ||
14 | JaegerInterpolineScripted: | ||
15 | ld [%l0 + 0x10], %l0 /* Load f->prev_ */ | ||
16 | st %l0, [%fp - 36] /* Update f->regs->fp_ */ | ||
17 | - ba JaegerInterpoline | ||
18 | + ba interpoline_enter | ||
19 | nop | ||
20 | .size JaegerInterpolineScripted, . - JaegerInterpolineScripted | ||
21 | |||
22 | @@ -120,6 +120,7 @@ JaegerInterpolineScripted: | ||
23 | .global JaegerInterpoline | ||
24 | .type JaegerInterpoline, #function | ||
25 | JaegerInterpoline: | ||
26 | +interpoline_enter: | ||
27 | mov %o0,%o2 | ||
28 | mov %l3,%o0 | ||
29 | mov %l2,%o1 | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch new file mode 100644 index 0000000..c20e218 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | From: Martin Stransky <stransky@redhat.com> | ||
2 | Date: Mon, 5 Dec 2011 10:49:56 +0100 | ||
3 | Subject: Bug 706787 - Crash on s390x | ||
4 | (nsXPCComponents::AttachNewComponentsObject() fails). r=glandium | ||
5 | |||
6 | --- | ||
7 | .../xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp | 50 ++++---------------- | ||
8 | 1 file changed, 9 insertions(+), 41 deletions(-) | ||
9 | |||
10 | diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp | ||
11 | index c12482a..ec9dd98 100644 | ||
12 | --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp | ||
13 | +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp | ||
14 | @@ -194,55 +194,23 @@ invoke_copy_to_stack(PRUint32 paramCount, nsXPTCVariant* s, PRUint64* d_ov, PRUi | ||
15 | } | ||
16 | } | ||
17 | |||
18 | +typedef nsresult (*vtable_func)(nsISupports *, PRUint64, PRUint64, PRUint64, PRUint64, double, double, double, double); | ||
19 | + | ||
20 | EXPORT_XPCOM_API(nsresult) | ||
21 | NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, | ||
22 | PRUint32 paramCount, nsXPTCVariant* params) | ||
23 | { | ||
24 | - PRUint64 *vtable = *(PRUint64 **)that; | ||
25 | - PRUint64 method = vtable[methodIndex]; | ||
26 | + vtable_func *vtable = *reinterpret_cast<vtable_func **>(that); | ||
27 | + vtable_func method = vtable[methodIndex]; | ||
28 | PRUint64 overflow = invoke_count_words (paramCount, params); | ||
29 | + PRUint64 *stack_space = reinterpret_cast<PRUint64 *>(__builtin_alloca((overflow + 8 /* 4 64-bits gpr + 4 64-bits fpr */) * 8)); | ||
30 | PRUint64 result; | ||
31 | |||
32 | - __asm__ __volatile__ | ||
33 | - ( | ||
34 | - "lgr 7,15\n\t" | ||
35 | - "aghi 7,-64\n\t" | ||
36 | - | ||
37 | - "lgr 3,%3\n\t" | ||
38 | - "sllg 3,3,3\n\t" | ||
39 | - "lcgr 3,3\n\t" | ||
40 | - "lg 2,0(15)\n\t" | ||
41 | - "la 15,0(3,7)\n\t" | ||
42 | - "stg 2,0(15)\n\t" | ||
43 | - | ||
44 | - "lgr 2,%1\n\t" | ||
45 | - "lgr 3,%2\n\t" | ||
46 | - "la 4,160(15)\n\t" | ||
47 | - "lgr 5,%3\n\t" | ||
48 | - "basr 14,%4\n\t" | ||
49 | - | ||
50 | - "lgr 2,%5\n\t" | ||
51 | - "ld 0,192(7)\n\t" | ||
52 | - "ld 2,200(7)\n\t" | ||
53 | - "ld 4,208(7)\n\t" | ||
54 | - "ld 6,216(7)\n\t" | ||
55 | - "lmg 3,6,160(7)\n\t" | ||
56 | - "basr 14,%6\n\t" | ||
57 | + invoke_copy_to_stack(paramCount, params, stack_space, overflow); | ||
58 | |||
59 | - "la 15,64(7)\n\t" | ||
60 | + PRUint64 *d_gpr = stack_space + overflow; | ||
61 | + double *d_fpr = reinterpret_cast<double *>(d_gpr + 4); | ||
62 | |||
63 | - "lgr %0,2\n\t" | ||
64 | - : "=r" (result) | ||
65 | - : "r" ((PRUint64)paramCount), | ||
66 | - "r" (params), | ||
67 | - "r" (overflow), | ||
68 | - "a" (invoke_copy_to_stack), | ||
69 | - "a" (that), | ||
70 | - "a" (method) | ||
71 | - : "2", "3", "4", "5", "6", "7", "14", "cc", "memory", | ||
72 | - "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7" | ||
73 | - ); | ||
74 | - | ||
75 | - return result; | ||
76 | + return method(that, d_gpr[0], d_gpr[1], d_gpr[2], d_gpr[3], d_fpr[0], d_fpr[1], d_fpr[2], d_fpr[3]); | ||
77 | } | ||
78 | |||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch new file mode 100644 index 0000000..721caf4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | From: Mike Hommey <mh+mozilla@glandium.org> | ||
2 | Date: Fri, 16 Dec 2011 11:29:43 +0100 | ||
3 | Subject: Bug 711353 - Add support for GNU/kFreeBSD and GNU/Hurd to | ||
4 | gfx/angle/src/compiler/osinclude.h | ||
5 | |||
6 | --- | ||
7 | gfx/angle/src/compiler/osinclude.h | 3 ++- | ||
8 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/gfx/angle/src/compiler/osinclude.h b/gfx/angle/src/compiler/osinclude.h | ||
11 | index dacdc22..6e84774 100644 | ||
12 | --- a/gfx/angle/src/compiler/osinclude.h | ||
13 | +++ b/gfx/angle/src/compiler/osinclude.h | ||
14 | @@ -16,7 +16,8 @@ | ||
15 | #define ANGLE_OS_WIN | ||
16 | #elif defined(__APPLE__) || defined(__linux__) || \ | ||
17 | defined(__FreeBSD__) || defined(__OpenBSD__) || \ | ||
18 | - defined(__sun) || defined(ANDROID) | ||
19 | + defined(__sun) || defined(ANDROID) || \ | ||
20 | + defined(__GLIBC__) || defined(__GNU__) | ||
21 | #define ANGLE_OS_POSIX | ||
22 | #else | ||
23 | #error Unsupported platform. | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch new file mode 100644 index 0000000..ea01a1c --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Mon, 23 Apr 2012 12:32:10 +0200 | ||
3 | Subject: Bug 747870 - Properly align XPCLazyCallContext::mData. r=bholley | ||
4 | |||
5 | --- | ||
6 | js/xpconnect/src/xpcprivate.h | 13 +++++++------ | ||
7 | 1 file changed, 7 insertions(+), 6 deletions(-) | ||
8 | |||
9 | diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h | ||
10 | index d57f66e..ca23216 100644 | ||
11 | --- a/js/xpconnect/src/xpcprivate.h | ||
12 | +++ b/js/xpconnect/src/xpcprivate.h | ||
13 | @@ -1328,12 +1328,13 @@ public: | ||
14 | XPCCallContext &GetXPCCallContext() | ||
15 | { | ||
16 | if (!mCcx) { | ||
17 | + XPCCallContext *data = mData.addr(); | ||
18 | mCcxToDestroy = mCcx = | ||
19 | - new (mData) XPCCallContext(mCallerLanguage, mCx, | ||
20 | - mCallBeginRequest == CALL_BEGINREQUEST, | ||
21 | - mObj, | ||
22 | - mFlattenedJSObject, mWrapper, | ||
23 | - mTearOff); | ||
24 | + new (data) XPCCallContext(mCallerLanguage, mCx, | ||
25 | + mCallBeginRequest == CALL_BEGINREQUEST, | ||
26 | + mObj, | ||
27 | + mFlattenedJSObject, mWrapper, | ||
28 | + mTearOff); | ||
29 | if (!mCcx->IsValid()) { | ||
30 | NS_ERROR("This is not supposed to fail!"); | ||
31 | } | ||
32 | @@ -1361,7 +1362,7 @@ private: | ||
33 | JSObject *mFlattenedJSObject; | ||
34 | XPCWrappedNative *mWrapper; | ||
35 | XPCWrappedNativeTearOff *mTearOff; | ||
36 | - char mData[sizeof(XPCCallContext)]; | ||
37 | + mozilla::AlignedStorage2<XPCCallContext> mData; | ||
38 | }; | ||
39 | |||
40 | /*************************************************************************** | ||
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch new file mode 100644 index 0000000..6ef2226 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From: Mike Hommey <mh@glandium.org> | ||
2 | Date: Fri, 18 Nov 2011 11:28:30 +0100 | ||
3 | Subject: Fix GNU/non-Linux failure to build because of | ||
4 | ipc/chromium/src/base/dir_reader_posix.h | ||
5 | |||
6 | --- | ||
7 | ipc/chromium/src/base/dir_reader_posix.h | 4 ++-- | ||
8 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/ipc/chromium/src/base/dir_reader_posix.h b/ipc/chromium/src/base/dir_reader_posix.h | ||
11 | index f591ae0..4b74a08 100644 | ||
12 | --- a/ipc/chromium/src/base/dir_reader_posix.h | ||
13 | +++ b/ipc/chromium/src/base/dir_reader_posix.h | ||
14 | @@ -18,7 +18,7 @@ | ||
15 | // seems worse than falling back to enumerating all file descriptors so we will | ||
16 | // probably never implement this on the Mac. | ||
17 | |||
18 | -#if defined(OS_LINUX) | ||
19 | +#if defined(OS_LINUX) && defined(__linux__) | ||
20 | #include "base/dir_reader_linux.h" | ||
21 | #else | ||
22 | #include "base/dir_reader_fallback.h" | ||
23 | @@ -26,7 +26,7 @@ | ||
24 | |||
25 | namespace base { | ||
26 | |||
27 | -#if defined(OS_LINUX) | ||
28 | +#if defined(OS_LINUX) && defined(__linux__) | ||
29 | typedef DirReaderLinux DirReaderPosix; | ||
30 | #else | ||
31 | typedef DirReaderFallback DirReaderPosix; | ||