2
xpcom/reflect/xptcall/src/md/unix/Makefile.in | 14 +
3
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_parisc_linux.s | 128 ++++++++++
4
xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_parisc_linux.s | 73 +++++
5
3 files changed, 215 insertions(+)
7
## 38_hppa_xpcom.patch converted from dpatch file initially by Mike Hommey <glandium@debian.org>
9
# patch from Ivar (Contributed by Randolph Chung) to fix Firefox on hppa.
12
Index: iceape-1.1.4/xpcom/reflect/xptcall/src/md/unix/Makefile.in
13
===================================================================
14
--- iceape-1.1.4.orig/xpcom/reflect/xptcall/src/md/unix/Makefile.in
15
+++ iceape-1.1.4/xpcom/reflect/xptcall/src/md/unix/Makefile.in
17
ASFILES := xptcstubs_asm_ipf32.s xptcinvoke_asm_ipf32.s
20
# #18875 Building the CPP's (CXX) optimized causes a crash
21
CXXFLAGS := $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(CXXFLAGS))
28
+ifeq ($(OS_ARCH),Linux)
29
+ifneq (,$(filter hppa,$(OS_TEST)))
31
+CPPSRCS := xptcinvoke_pa32.cpp xptcstubs_pa32.cpp
32
+ASFILES := xptcstubs_asm_parisc_linux.s xptcinvoke_asm_parisc_linux.s
39
######################################################################
41
######################################################################
45
ifeq ($(OS_ARCH),NetBSD)
46
ifneq (,$(filter amiga atari hp300 mac68k mvme68k next68k sun3 sun3x x68k,$(OS_TEST)))
47
Index: iceape-1.1.4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_parisc_linux.s
48
===================================================================
50
+++ iceape-1.1.4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_parisc_linux.s
60
+; XPTC_InvokeByIndex(nsISuppots* that, PRUint32 methodIndex,
61
+; PRUint32 paramCount, nsXPTCVariant* params);
63
+.globl XPTC_InvokeByIndex
64
+ .type XPTC_InvokeByIndex, @function
69
+ .CALLINFO FRAME=72, CALLER,SAVE_RP, SAVE_SP, ENTRY_GR=3
72
+ ; frame marker takes 48 bytes,
73
+ ; register spill area takes 8 bytes,
74
+ ; local stack area takes 72 bytes result in 128 bytes total
79
+ LDO -framesz(%r30),%r28
80
+ STW %r28,-4(%r30) ; save previous sp
83
+ STW %r26,-36-framesz(%r30) ; save argument registers in
84
+ STW %r25,-40-framesz(%r30) ; in PREVIOUS frame
85
+ STW %r24,-44-framesz(%r30) ;
86
+ STW %r23,-48-framesz(%r30) ;
89
+; ADDIL L'invoke_count_bytes-$PIC_pcrel$1+4,%r2,%r1
90
+; ; LDO R'invoke_count_bytes-$PIC_pcrel$2+8(%r1),%r1
96
+ .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR ;in=24,25,26;out=28
97
+ BL invoke_count_bytes,%r31
100
+ CMPIB,>= 0,%r28, .+76
101
+ COPY %r30,%r3 ; copy stack ptr to saved stack ptr
102
+ ADD %r30,%r28,%r30 ; extend stack frame
103
+ LDW -4(%r3),%r28 ; move frame
120
+ LDO -40(%r30),%r26 ; load copy address
121
+ LDW -44-framesz(%r3),%r25 ; load rest of 2 arguments
122
+ LDW -48-framesz(%r3),%r24 ;
124
+ LDW -32(%r30),%r19 ; shared lib call destroys r19; reload
126
+; ADDIL L'invoke_copy_to_stack-$PIC_pcrel$3+4,%r2,%r1
127
+; LDO R'invoke_copy_to_stack-$PIC_pcrel$4+8(%r1),%r1
132
+ .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR ;in=24,25,26
133
+ BL invoke_copy_to_stack,%r31
137
+ EXTRW,U,= %r28,31,1,%r22
138
+ FLDD 0(%r20),%fr7 ; load double arg 1
139
+ EXTRW,U,= %r28,30,1,%r22
140
+ FLDW 8(%r20),%fr5L ; load float arg 1
141
+ EXTRW,U,= %r28,29,1,%r22
142
+ FLDW 4(%r20),%fr6L ; load float arg 2
143
+ EXTRW,U,= %r28,28,1,%r22
144
+ FLDW 0(%r20),%fr7L ; load float arg 3
146
+ LDW -36-framesz(%r3),%r26 ; load ptr to 'that'
147
+ LDW -40(%r30),%r25 ; load the rest of dispatch argument registers
151
+ LDW -36-framesz(%r3),%r20 ; load vtable addr
152
+ LDW -40-framesz(%r3),%r28 ; load index
153
+ LDW 0(%r20),%r20 ; follow vtable
154
+; LDO 0(%r20),%r20 ; offset vtable by 16 bytes (g++: 8, aCC: 16)
155
+ SH2ADDL %r28,%r20,%r28 ; add 4*index to vtable entry
156
+ LDW 0(%r28),%r22 ; load vtable entry
159
+; ADDIL L'$$dyncall_external-$PIC_pcrel$5+4,%r2,%r1
160
+; LDO R'$$dyncall_external-$PIC_pcrel$6+8(%r1),%r1
165
+ .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,RTNVAL=GR ;in=22-26;out=28;
170
+ COPY %r3,%r30 ; restore saved stack ptr
177
+ .PROCEND ;in=23,24,25,26;
178
+ .SIZE XPTC_InvokeByIndex, .-XPTC_InvokeByIndex
180
Index: iceape-1.1.4/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_parisc_linux.s
181
===================================================================
183
+++ iceape-1.1.4/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_parisc_linux.s
193
+; SharedStub has stack size of 128 bytes
198
+; the StubN C++ function has a small stack size of 64 bytes
202
+ .type SharedStub, @function
206
+ .CALLINFO CALLER,FRAME=80,SAVE_RP
213
+ STW %r26,-36-curframesz(%r30) ; save arg0 in previous frame
216
+ FSTD,MA %fr5,8(%r28) ; save darg0
217
+ FSTD,MA %fr7,8(%r28) ; save darg1
218
+ FSTW,MA %fr4L,4(%r28) ; save farg0
219
+ FSTW,MA %fr5L,4(%r28) ; save farg1
220
+ FSTW,MA %fr6L,4(%r28) ; save farg2
221
+ FSTW,MA %fr7L,4(%r28) ; save farg3
223
+ ; Former value of register 26 is already properly saved by StubN,
224
+ ; but register 25-23 are not because of the arguments mismatch
225
+ STW %r25,-40-curframesz-lastframesz(%r30) ; save r25
226
+ STW %r24,-44-curframesz-lastframesz(%r30) ; save r24
227
+ STW %r23,-48-curframesz-lastframesz(%r30) ; save r23
228
+ COPY %r26,%r25 ; method index is arg1
229
+ LDW -36-curframesz-lastframesz(%r30),%r26 ; self is arg0
230
+ LDO -40-curframesz-lastframesz(%r30),%r24 ; normal args is arg2
231
+ LDO -80(%r30),%r23 ; floating args is arg3
234
+; ADDIL L'PrepareAndDispatch-$PIC_pcrel$0+4,%r2
235
+; LDO R'PrepareAndDispatch-$PIC_pcrel$1+8(%r1),%r1
240
+ .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,RTNVAL=GR ;in=23-26;out=28;
241
+ BL PrepareAndDispatch, %r31
255
+ .PROCEND ;in=26;out=28;
257
+ .SIZE SharedStub, .-SharedStub