mirror of git://gcc.gnu.org/git/gcc.git
darwin_closure.S: Fix alignement bug, allocate 8 bytes for the result.
2003-02-06 Andreas Tobler <a.tobler@schweiz.ch>
* libffi/src/powerpc/darwin_closure.S:
Fix alignement bug, allocate 8 bytes for the result.
* libffi/src/powerpc/aix_closure.S:
Likewise.
* libffi/src/powerpc/ffi_darwin.c:
Update stackframe description for aix/darwin_closure.S.
From-SVN: r62514
This commit is contained in:
parent
f39a753b09
commit
79e43f898d
|
|
@ -1,3 +1,12 @@
|
||||||
|
2003-02-06 Andreas Tobler <a.tobler@schweiz.ch>
|
||||||
|
|
||||||
|
* libffi/src/powerpc/darwin_closure.S:
|
||||||
|
Fix alignement bug, allocate 8 bytes for the result.
|
||||||
|
* libffi/src/powerpc/aix_closure.S:
|
||||||
|
Likewise.
|
||||||
|
* libffi/src/powerpc/ffi_darwin.c:
|
||||||
|
Update stackframe description for aix/darwin_closure.S.
|
||||||
|
|
||||||
2003-02-06 Jakub Jelinek <jakub@redhat.com>
|
2003-02-06 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility
|
* src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
aix_closures.S - Copyright (c) 2002 Free Software Foundation, Inc.
|
aix_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc.
|
||||||
based on darwin_closures.S
|
based on darwin_closure.S
|
||||||
|
|
||||||
PowerPC Assembly glue.
|
PowerPC Assembly glue.
|
||||||
|
|
||||||
|
|
@ -106,24 +106,25 @@ ffi_closure_ASM:
|
||||||
/* 24 Bytes (Linkage Area) */
|
/* 24 Bytes (Linkage Area) */
|
||||||
/* 32 Bytes (params) */
|
/* 32 Bytes (params) */
|
||||||
/* 104 Bytes (13*8 from FPR) */
|
/* 104 Bytes (13*8 from FPR) */
|
||||||
/* 4 Bytes (result)
|
/* 8 Bytes (result)
|
||||||
/* 164 Bytes */
|
/* 168 Bytes */
|
||||||
|
|
||||||
stwu r1,-164(r1) /* skip over caller save area */
|
stwu r1,-176(r1) /* skip over caller save area
|
||||||
|
keep stack aligned to 16 */
|
||||||
|
|
||||||
/* we want to build up an area for the parameters passed */
|
/* we want to build up an area for the parameters passed */
|
||||||
/* in registers (both floating point and integer) */
|
/* in registers (both floating point and integer) */
|
||||||
|
|
||||||
/* we store gpr 3 to gpr 10 (aligned to 4) */
|
/* we store gpr 3 to gpr 10 (aligned to 4)
|
||||||
/* in the parents outgoing area */
|
in the parents outgoing area */
|
||||||
stw r3, 188(r1)
|
stw r3, 200(r1)
|
||||||
stw r4, 192(r1)
|
stw r4, 204(r1)
|
||||||
stw r5, 196(r1)
|
stw r5, 208(r1)
|
||||||
stw r6, 200(r1)
|
stw r6, 212(r1)
|
||||||
stw r7, 204(r1)
|
stw r7, 216(r1)
|
||||||
stw r8, 208(r1)
|
stw r8, 220(r1)
|
||||||
stw r9, 212(r1)
|
stw r9, 224(r1)
|
||||||
stw r10, 216(r1)
|
stw r10, 228(r1)
|
||||||
|
|
||||||
/* next save fpr 1 to fpr 13 (aligned to 8) */
|
/* next save fpr 1 to fpr 13 (aligned to 8) */
|
||||||
stfd f1, 56(r1)
|
stfd f1, 56(r1)
|
||||||
|
|
@ -148,14 +149,14 @@ ffi_closure_ASM:
|
||||||
addi r4,r1,160
|
addi r4,r1,160
|
||||||
|
|
||||||
/* now load up the pointer to the saved gpr registers */
|
/* now load up the pointer to the saved gpr registers */
|
||||||
addi r5,r1,188
|
addi r5,r1,200
|
||||||
|
|
||||||
/* now load up the pointer to the saved fpr registers */
|
/* now load up the pointer to the saved fpr registers */
|
||||||
addi r6,r1,56
|
addi r6,r1,56
|
||||||
|
|
||||||
/* now load up the pointer to the outgoing parameter */
|
/* now load up the pointer to the outgoing parameter */
|
||||||
/* stack in the previous frame */
|
/* stack in the previous frame */
|
||||||
addi r7,r1,220
|
addi r7,r1,232
|
||||||
|
|
||||||
/* make the call */
|
/* make the call */
|
||||||
bl .ffi_closure_helper_DARWIN
|
bl .ffi_closure_helper_DARWIN
|
||||||
|
|
@ -243,7 +244,7 @@ L..58:
|
||||||
/* case void / done */
|
/* case void / done */
|
||||||
L..44:
|
L..44:
|
||||||
|
|
||||||
addi r1,r1,164 /* restore stack pointer */
|
addi r1,r1,176 /* restore stack pointer */
|
||||||
lwz r0,8(r1) /* get return address */
|
lwz r0,8(r1) /* get return address */
|
||||||
mtlr r0 /* reset link register */
|
mtlr r0 /* reset link register */
|
||||||
blr
|
blr
|
||||||
|
|
|
||||||
|
|
@ -41,27 +41,28 @@ LFB1:
|
||||||
mflr r0 /* extract return address */
|
mflr r0 /* extract return address */
|
||||||
stw r0, 8(r1) /* save the return address */
|
stw r0, 8(r1) /* save the return address */
|
||||||
LCFI0:
|
LCFI0:
|
||||||
/* 24 Bytes (Linkage Area) */
|
/* 24 Bytes (Linkage Area)
|
||||||
/* 32 Bytes (outgoing parameter area, always reserved) */
|
32 Bytes (outgoing parameter area, always reserved)
|
||||||
/* 104 Bytes (13*8 from FPR) */
|
104 Bytes (13*8 from FPR)
|
||||||
/* 4 Bytes (result)
|
8 Bytes (result)
|
||||||
/* 164 Bytes */
|
168 Bytes */
|
||||||
|
|
||||||
stwu r1,-164(r1) /* skip over caller save area */
|
stwu r1,-176(r1) /* skip over caller save area
|
||||||
|
keep stack aligned to 16 */
|
||||||
LCFI1:
|
LCFI1:
|
||||||
/* we want to build up an area for the parameters passed
|
/* we want to build up an area for the parameters passed
|
||||||
in registers (both floating point and integer) */
|
in registers (both floating point and integer) */
|
||||||
|
|
||||||
/* we store gpr 3 to gpr 10 (aligned to 4) */
|
/* we store gpr 3 to gpr 10 (aligned to 4)
|
||||||
/* in the parents outgoing area */
|
in the parents outgoing area */
|
||||||
stw r3, 188(r1)
|
stw r3, 200(r1)
|
||||||
stw r4, 192(r1)
|
stw r4, 204(r1)
|
||||||
stw r5, 196(r1)
|
stw r5, 208(r1)
|
||||||
stw r6, 200(r1)
|
stw r6, 212(r1)
|
||||||
stw r7, 204(r1)
|
stw r7, 216(r1)
|
||||||
stw r8, 208(r1)
|
stw r8, 220(r1)
|
||||||
stw r9, 212(r1)
|
stw r9, 224(r1)
|
||||||
stw r10, 216(r1)
|
stw r10, 228(r1)
|
||||||
|
|
||||||
/* we save fpr 1 to fpr 13 (aligned to 8) */
|
/* we save fpr 1 to fpr 13 (aligned to 8) */
|
||||||
stfd f1, 56(r1)
|
stfd f1, 56(r1)
|
||||||
|
|
@ -85,15 +86,15 @@ LCFI1:
|
||||||
/* now load up the pointer to the result storage */
|
/* now load up the pointer to the result storage */
|
||||||
addi r4,r1,160
|
addi r4,r1,160
|
||||||
|
|
||||||
/* now load up the pointer to the saved gpr registers */
|
/* now load up the pointer to the saved gpr registers */
|
||||||
addi r5,r1,188
|
addi r5,r1,200
|
||||||
|
|
||||||
/* now load up the pointer to the saved fpr registers */
|
/* now load up the pointer to the saved fpr registers */
|
||||||
addi r6,r1,56
|
addi r6,r1,56
|
||||||
|
|
||||||
/* now load up the pointer to the outgoing parameter */
|
/* now load up the pointer to the outgoing parameter
|
||||||
/* stack in the previous frame */
|
stack in the previous frame */
|
||||||
addi r7,r1,220
|
addi r7,r1,232
|
||||||
|
|
||||||
/* make the call */
|
/* make the call */
|
||||||
bl L(_ffi_closure_helper_DARWIN)
|
bl L(_ffi_closure_helper_DARWIN)
|
||||||
|
|
@ -182,9 +183,9 @@ LFE1:
|
||||||
/* case void / done */
|
/* case void / done */
|
||||||
.L44:
|
.L44:
|
||||||
|
|
||||||
addi r1,r1,164 /* restore stack pointer */
|
addi r1,r1,176 /* restore stack pointer */
|
||||||
lwz r0,8(r1) /* get return address */
|
lwz r0,8(r1) /* get return address */
|
||||||
mtlr r0 /* reset link register */
|
mtlr r0 /* reset link register */
|
||||||
blr
|
blr
|
||||||
|
|
||||||
/* END(ffi_closure_ASM) */
|
/* END(ffi_closure_ASM) */
|
||||||
|
|
@ -223,7 +224,7 @@ LASFDE1:
|
||||||
.set L$set$3,LCFI1-LCFI0
|
.set L$set$3,LCFI1-LCFI0
|
||||||
.long L$set$3
|
.long L$set$3
|
||||||
.byte 0xe ; DW_CFA_def_cfa_offset
|
.byte 0xe ; DW_CFA_def_cfa_offset
|
||||||
.byte 164,1 ; uleb128 164
|
.byte 176,1 ; uleb128 176
|
||||||
.byte 0x4 ; DW_CFA_advance_loc4
|
.byte 0x4 ; DW_CFA_advance_loc4
|
||||||
.set L$set$4,LCFI0-LFB1
|
.set L$set$4,LCFI0-LFB1
|
||||||
.long L$set$4
|
.long L$set$4
|
||||||
|
|
|
||||||
|
|
@ -410,38 +410,40 @@ typedef struct aix_fd_struct {
|
||||||
+---------------------------------------+ 20
|
+---------------------------------------+ 20
|
||||||
| saved TOC pointer 4 |
|
| saved TOC pointer 4 |
|
||||||
+---------------------------------------+ 24
|
+---------------------------------------+ 24
|
||||||
| always reserved 8*4=32 (revious GPRs)|
|
| always reserved 8*4=32 (previous GPRs)|
|
||||||
| according to the linkage convention |
|
| according to the linkage convention |
|
||||||
| from AIX |
|
| from AIX |
|
||||||
+---------------------------------------+ 56
|
+---------------------------------------+ 56
|
||||||
| our FPR area 13*8=104 |
|
| our FPR area 13*8=104 |
|
||||||
| f1 |
|
| f1 |
|
||||||
| . |
|
| . |
|
||||||
| f13 |
|
| f13 |
|
||||||
+---------------------------------------+ 160
|
+---------------------------------------+ 160
|
||||||
| result area 4 |
|
| result area 8 |
|
||||||
SP current --> +---------------------------------------+ 164 <- parent frame
|
|
||||||
| back chain to caller 4 |
|
|
||||||
+---------------------------------------+ 168
|
+---------------------------------------+ 168
|
||||||
| saved CR 4 |
|
| alignement to the next multiple of 16 |
|
||||||
+---------------------------------------+ 172
|
SP current --> +---------------------------------------+ 176 <- parent frame
|
||||||
| saved LR 4 |
|
| back chain to caller 4 |
|
||||||
+---------------------------------------+ 176
|
|
||||||
| reserved for compilers 4 |
|
|
||||||
+---------------------------------------+ 180
|
+---------------------------------------+ 180
|
||||||
| reserved for binders 4 |
|
| saved CR 4 |
|
||||||
+---------------------------------------+ 184
|
+---------------------------------------+ 184
|
||||||
| saved TOC pointer 4 |
|
| saved LR 4 |
|
||||||
+---------------------------------------+ 188
|
+---------------------------------------+ 188
|
||||||
|
| reserved for compilers 4 |
|
||||||
|
+---------------------------------------+ 192
|
||||||
|
| reserved for binders 4 |
|
||||||
|
+---------------------------------------+ 196
|
||||||
|
| saved TOC pointer 4 |
|
||||||
|
+---------------------------------------+ 200
|
||||||
| always reserved 8*4=32 we store our |
|
| always reserved 8*4=32 we store our |
|
||||||
| GPRs here |
|
| GPRs here |
|
||||||
| r3 |
|
| r3 |
|
||||||
| . |
|
| . |
|
||||||
| r10 |
|
| r10 |
|
||||||
+---------------------------------------+ 220
|
+---------------------------------------+ 232
|
||||||
| PST area, overflow part |
|
| PST area, overflow part |
|
||||||
+---------------------------------------+ xxx
|
+---------------------------------------+ xxx
|
||||||
| ???? |
|
| ???? |
|
||||||
+---------------------------------------+ xxx
|
+---------------------------------------+ xxx
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue