author | Wolfgang Rosenauer <wr@rosenauer.org> |
Sat, 10 May 2014 08:13:15 +0200 | |
branch | firefox29 |
changeset 735 | 3a83cd95580e |
parent 714 | b686e856c800 |
permissions | -rw-r--r-- |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1 |
# HG changeset patch |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
2 |
# Parent 571f8d1f1501d31bd7c0d0affdc7cdc8b21203a0 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
3 |
# User Ulrich Weigand <uweigand@de.ibm.com> |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
4 |
Bug 976648 - powerpc64le-linux support - xptcall port |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
5 |
|
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
6 |
Index: mozilla/xpcom/reflect/xptcall/src/md/unix/moz.build |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
7 |
=================================================================== |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
8 |
--- mozilla.orig/xpcom/reflect/xptcall/src/md/unix/moz.build |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
9 |
+++ mozilla/xpcom/reflect/xptcall/src/md/unix/moz.build |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
10 |
@@ -224,12 +224,12 @@ if CONFIG['OS_TEST'] == 'powerpc': |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
11 |
'xptcstubs_ppc_linux.cpp', |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
12 |
] |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
13 |
|
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
14 |
-if CONFIG['OS_TEST'] == 'powerpc64': |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
15 |
+if CONFIG['OS_TEST'] in ('powerpc64', 'powerpc64le'): |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
16 |
if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'): |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
17 |
SOURCES += [ |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
18 |
- 'xptcinvoke_asm_ppc64_linux.s', |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
19 |
+ 'xptcinvoke_asm_ppc64_linux.S', |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
20 |
'xptcinvoke_ppc64_linux.cpp', |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
21 |
- 'xptcstubs_asm_ppc64_linux.s', |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
22 |
+ 'xptcstubs_asm_ppc64_linux.S', |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
23 |
'xptcstubs_ppc64_linux.cpp', |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
24 |
] |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
25 |
|
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
26 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.S |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
27 |
rename from xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
28 |
rename to xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.S |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
29 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
30 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.S |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
31 |
@@ -17,12 +17,38 @@ |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
32 |
.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
33 |
.set f30,30; .set f31,31 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
34 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
35 |
+# The ABI defines a fixed stack frame area of 4 doublewords (ELFv2) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
36 |
+# or 6 doublewords (ELFv1); the last of these doublewords is used |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
37 |
+# as TOC pointer save area. The fixed area is followed by a parameter |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
38 |
+# save area of 8 doublewords (used for vararg routines), followed |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
39 |
+# by space for parameters passed on the stack. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
40 |
+# |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
41 |
+# We set STACK_TOC to the offset of the TOC pointer save area, and |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
42 |
+# STACK_PARAMS to the offset of the first on-stack parameter. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
43 |
+ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
44 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
45 |
+#define STACK_TOC 24 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
46 |
+#define STACK_PARAMS 96 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
47 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
48 |
+#define STACK_TOC 40 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
49 |
+#define STACK_PARAMS 112 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
50 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
51 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
52 |
# |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
53 |
# NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
54 |
# uint32_t paramCount, nsXPTCVariant* params) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
55 |
# |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
56 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
57 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
58 |
+ .section ".text" |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
59 |
+ .type NS_InvokeByIndex,@function |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
60 |
+ .globl NS_InvokeByIndex |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
61 |
+ .align 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
62 |
+NS_InvokeByIndex: |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
63 |
+0: addis 2,12,(.TOC.-0b)@ha |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
64 |
+ addi 2,2,(.TOC.-0b)@l |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
65 |
+ .localentry NS_InvokeByIndex,.-NS_InvokeByIndex |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
66 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
67 |
.section ".toc","aw" |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
68 |
.section ".text" |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
69 |
.align 2 |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
70 |
@@ -34,6 +60,7 @@ NS_InvokeByIndex: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
71 |
.previous |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
72 |
.type NS_InvokeByIndex,@function |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
73 |
.NS_InvokeByIndex: |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
74 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
75 |
mflr 0 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
76 |
std 0,16(r1) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
77 |
|
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
78 |
@@ -50,13 +77,12 @@ NS_InvokeByIndex: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
79 |
# we don't actually need stack space for those. We must ensure |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
80 |
# that the stack remains 16-byte aligned. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
81 |
# |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
82 |
- # | ..128-byte stack frame.. | | 7 GP | 13 FP | 3 NV | |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
83 |
- # | |(params)........| regs | regs | regs | |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
84 |
- # (r1)...........(+112)....(+128) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
85 |
- # (-23*8).(-16*8).(-3*8)..(r31) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
86 |
+ # | (fixed area + | | 7 GP | 13 FP | 3 NV | |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
87 |
+ # | param. save) |(params)........| regs | regs | regs | |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
88 |
+ # (r1)......(+STACK_PARAMS)... (-23*8).(-16*8).(-3*8)..(r31) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
89 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
90 |
# +stack frame, -unused stack params, +regs storage, +1 for alignment |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
91 |
- addi r7,r5,((112/8)-7+7+13+3+1) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
92 |
+ addi r7,r5,((STACK_PARAMS/8)-7+7+13+3+1) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
93 |
rldicr r7,r7,3,59 # multiply by 8 and mask with ~15 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
94 |
neg r7,r7 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
95 |
stdux r1,r1,r7 |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
96 |
@@ -67,12 +93,13 @@ NS_InvokeByIndex: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
97 |
# uint64_t* d)) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
98 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
99 |
# r5, r6 are passed through intact (paramCount, params) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
100 |
- # r7 (d) has to be r1+112 -- where parameters are passed on the stack. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
101 |
+ # r7 (d) has to be r1+STACK_PARAMS |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
102 |
+ # -- where parameters are passed on the stack. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
103 |
# r3, r4 are above that, easier to address from r31 than from r1 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
104 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
105 |
subi r3,r31,(23*8) # r3 --> GPRS |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
106 |
subi r4,r31,(16*8) # r4 --> FPRS |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
107 |
- addi r7,r1,112 # r7 --> params |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
108 |
+ addi r7,r1,STACK_PARAMS # r7 --> params |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
109 |
bl invoke_copy_to_stack |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
110 |
nop |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
111 |
|
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
112 |
@@ -83,14 +110,18 @@ NS_InvokeByIndex: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
113 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
114 |
sldi r30,r30,3 # Find function descriptor |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
115 |
add r9,r9,r30 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
116 |
- ld r9,0(r9) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
117 |
+ ld r12,0(r9) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
118 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
119 |
- ld r0,0(r9) # Actual address from fd. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
120 |
- std r2,40(r1) # Save r2 (TOC pointer) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
121 |
+ std r2,STACK_TOC(r1) # Save r2 (TOC pointer) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
122 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
123 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
124 |
+ mtctr r12 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
125 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
126 |
+ ld r0,0(r12) # Actual address from fd. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
127 |
mtctr 0 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
128 |
- ld r11,16(r9) # Environment pointer from fd. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
129 |
- ld r2,8(r9) # TOC pointer from fd. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
130 |
+ ld r11,16(r12) # Environment pointer from fd. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
131 |
+ ld r2,8(r12) # TOC pointer from fd. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
132 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
133 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
134 |
# Load FP and GP registers as required |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
135 |
ld r4, -(23*8)(r31) |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
136 |
@@ -117,7 +148,7 @@ NS_InvokeByIndex: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
137 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
138 |
bctrl # Do it |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
139 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
140 |
- ld r2,40(r1) # Load our own TOC pointer |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
141 |
+ ld r2,STACK_TOC(r1) # Load our own TOC pointer |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
142 |
ld r1,0(r1) # Revert stack frame |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
143 |
ld 0,16(r1) # Reload lr |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
144 |
ld 29,-24(r1) # Restore NVGPRS |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
145 |
@@ -126,7 +157,11 @@ NS_InvokeByIndex: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
146 |
mtlr 0 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
147 |
blr |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
148 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
149 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
150 |
+ .size NS_InvokeByIndex,.-NS_InvokeByIndex |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
151 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
152 |
.size NS_InvokeByIndex,.-.NS_InvokeByIndex |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
153 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
154 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
155 |
# Magic indicating no need for an executable stack |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
156 |
.section .note.GNU-stack, "", @progbits ; .previous |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
157 |
Index: mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
158 |
=================================================================== |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
159 |
--- mozilla.orig/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
160 |
+++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
161 |
@@ -74,7 +74,9 @@ invoke_copy_to_stack(uint64_t* gpregs, |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
162 |
fpregs[i] = s->val.f; // if passed in registers, floats are promoted to doubles |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
163 |
} else { |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
164 |
float *p = (float *)d; |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
165 |
+#ifndef __LITTLE_ENDIAN__ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
166 |
p++; |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
167 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
168 |
*p = s->val.f; |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
169 |
} |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
170 |
} |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
171 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.S |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
172 |
rename from xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.s |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
173 |
rename to xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.S |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
174 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.s |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
175 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.S |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
176 |
@@ -17,6 +17,27 @@ |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
177 |
.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
178 |
.set f30,30; .set f31,31 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
179 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
180 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
181 |
+#define STACK_PARAMS 96 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
182 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
183 |
+#define STACK_PARAMS 112 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
184 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
185 |
+ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
186 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
187 |
+ .section ".text" |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
188 |
+ .type SharedStub,@function |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
189 |
+ .globl SharedStub |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
190 |
+ # Make the symbol hidden so that the branch from the stub does |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
191 |
+ # not go via a PLT. This is not only better for performance, |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
192 |
+ # but may be necessary to avoid linker errors since there is |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
193 |
+ # no place to restore the TOC register in a sibling call. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
194 |
+ .hidden SharedStub |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
195 |
+ .align 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
196 |
+SharedStub: |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
197 |
+0: addis 2,12,(.TOC.-0b)@ha |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
198 |
+ addi 2,2,(.TOC.-0b)@l |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
199 |
+ .localentry SharedStub,.-SharedStub |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
200 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
201 |
.section ".text" |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
202 |
.align 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
203 |
.globl SharedStub |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
204 |
@@ -29,6 +50,7 @@ SharedStub: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
205 |
.type SharedStub,@function |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
206 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
207 |
.SharedStub: |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
208 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
209 |
mflr r0 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
210 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
211 |
std r4, -56(r1) # Save all GPRS |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
212 |
@@ -55,7 +77,7 @@ SharedStub: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
213 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
214 |
subi r6,r1,56 # r6 --> gprData |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
215 |
subi r7,r1,160 # r7 --> fprData |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
216 |
- addi r5,r1,112 # r5 --> extra stack args |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
217 |
+ addi r5,r1,STACK_PARAMS # r5 --> extra stack args |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
218 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
219 |
std r0, 16(r1) |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
220 |
|
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
221 |
@@ -75,7 +97,11 @@ SharedStub: |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
222 |
mtlr r0 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
223 |
blr |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
224 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
225 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
226 |
+ .size SharedStub,.-SharedStub |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
227 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
228 |
.size SharedStub,.-.SharedStub |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
229 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
230 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
231 |
# Magic indicating no need for an executable stack |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
232 |
.section .note.GNU-stack, "", @progbits ; .previous |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
233 |
Index: mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
234 |
=================================================================== |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
235 |
--- mozilla.orig/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
236 |
+++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp |
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
237 |
@@ -83,7 +83,9 @@ PrepareAndDispatch(nsXPTCStubBase* self, |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
238 |
dp->val.f = (float) fprData[i]; // in registers floats are passed as doubles |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
239 |
else { |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
240 |
float *p = (float *)ap; |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
241 |
+#ifndef __LITTLE_ENDIAN__ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
242 |
p++; |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
243 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
244 |
dp->val.f = *p; |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
245 |
} |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
246 |
} else { /* integer type or pointer */ |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
247 |
@@ -153,6 +155,43 @@ PrepareAndDispatch(nsXPTCStubBase* self, |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
248 |
// etc. |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
249 |
// Use assembler directives to get the names right... |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
250 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
251 |
+#if _CALL_ELF == 2 |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
252 |
+# define STUB_ENTRY(n) \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
253 |
+__asm__ ( \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
254 |
+ ".section \".text\" \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
255 |
+ ".align 2 \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
256 |
+ ".if "#n" < 10 \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
257 |
+ ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
258 |
+ ".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
259 |
+"_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
260 |
+ "0: addis 2,12,.TOC.-0b@ha \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
261 |
+ "addi 2,2,.TOC.-0b@l \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
262 |
+ ".localentry _ZN14nsXPTCStubBase5Stub"#n"Ev,.-_ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
263 |
+ \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
264 |
+ ".elseif "#n" < 100 \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
265 |
+ ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
266 |
+ ".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
267 |
+"_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
268 |
+ "0: addis 2,12,.TOC.-0b@ha \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
269 |
+ "addi 2,2,.TOC.-0b@l \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
270 |
+ ".localentry _ZN14nsXPTCStubBase6Stub"#n"Ev,.-_ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
271 |
+ \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
272 |
+ ".elseif "#n" < 1000 \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
273 |
+ ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
274 |
+ ".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
275 |
+"_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
276 |
+ "0: addis 2,12,.TOC.-0b@ha \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
277 |
+ "addi 2,2,.TOC.-0b@l \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
278 |
+ ".localentry _ZN14nsXPTCStubBase7Stub"#n"Ev,.-_ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
279 |
+ \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
280 |
+ ".else \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
281 |
+ ".err \"stub number "#n" >= 1000 not yet supported\"\n" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
282 |
+ ".endif \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
283 |
+ \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
284 |
+ "li 11,"#n" \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
285 |
+ "b SharedStub \n" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
286 |
+); |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
287 |
+#else |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
288 |
# define STUB_ENTRY(n) \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
289 |
__asm__ ( \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
290 |
".section \".toc\",\"aw\" \n\t" \ |
714
b686e856c800
import PPC64(LE) changes from OBS
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
710
diff
changeset
|
291 |
@@ -195,6 +234,7 @@ __asm__ ( |
710
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
292 |
"li 11,"#n" \n\t" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
293 |
"b SharedStub \n" \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
294 |
); |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
295 |
+#endif |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
296 |
|
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
297 |
#define SENTINEL_ENTRY(n) \ |
5341dc98d26c
update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
298 |
nsresult nsXPTCStubBase::Sentinel##n() \ |