diff options
Diffstat (limited to 'libffi/src/powerpc/darwin_closure.S')
-rw-r--r-- | libffi/src/powerpc/darwin_closure.S | 117 |
1 files changed, 82 insertions, 35 deletions
diff --git a/libffi/src/powerpc/darwin_closure.S b/libffi/src/powerpc/darwin_closure.S index 9e54d2231b9..9ae17d8cce8 100644 --- a/libffi/src/powerpc/darwin_closure.S +++ b/libffi/src/powerpc/darwin_closure.S @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- - darwin_closures.S - Copyright (c) 2002 Free Software Foundation, Inc. - based on ppc_closures.S + darwin_closure.S - Copyright (c) 2002 2003 Free Software Foundation, + Inc. based on ppc_closure.S PowerPC Assembly glue. @@ -37,31 +37,32 @@ .text .align 2 _ffi_closure_ASM: +LFB1: + mflr r0 /* extract return address */ + stw r0, 8(r1) /* save the return address */ +LCFI0: + /* 24 Bytes (Linkage Area) + 32 Bytes (outgoing parameter area, always reserved) + 104 Bytes (13*8 from FPR) + 8 Bytes (result) + 168 Bytes */ - mflr r0 /* extract return address */ - stw r0, 8(r1) /* save the return address */ + stwu r1,-176(r1) /* skip over caller save area + keep stack aligned to 16 */ +LCFI1: + /* we want to build up an area for the parameters passed + in registers (both floating point and integer) */ - /* 24 Bytes (Linkage Area) */ - /* 32 Bytes (outgoing parameter area, always reserved) */ - /* 104 Bytes (13*8 from FPR) */ - /* 4 Bytes (result) - /* 164 Bytes */ - - stwu r1,-164(r1) /* skip over caller save area */ - -/* we want to build up an area for the parameters passed */ -/* in registers (both floating point and integer) */ - - /* we store gpr 3 to gpr 10 (aligned to 4) */ - /* in the parents outgoing area */ - stw r3, 188(r1) - stw r4, 192(r1) - stw r5, 196(r1) - stw r6, 200(r1) - stw r7, 204(r1) - stw r8, 208(r1) - stw r9, 212(r1) - stw r10, 216(r1) + /* we store gpr 3 to gpr 10 (aligned to 4) + in the parents outgoing area */ + stw r3, 200(r1) + stw r4, 204(r1) + stw r5, 208(r1) + stw r6, 212(r1) + stw r7, 216(r1) + stw r8, 220(r1) + stw r9, 224(r1) + stw r10, 228(r1) /* we save fpr 1 to fpr 13 (aligned to 8) */ stfd f1, 56(r1) @@ -85,15 +86,15 @@ _ffi_closure_ASM: /* now load up the pointer to the result storage */ addi r4,r1,160 - /* now load up the pointer to the saved gpr registers */ - addi r5,r1,188 + /* now load up the pointer to the saved gpr registers */ + addi r5,r1,200 /* now load up the pointer to the saved fpr registers */ addi r6,r1,56 - /* now load up the pointer to the outgoing parameter */ - /* stack in the previous frame */ - addi r7,r1,220 + /* now load up the pointer to the outgoing parameter + stack in the previous frame */ + addi r7,r1,232 /* make the call */ bl L(_ffi_closure_helper_DARWIN) @@ -111,7 +112,9 @@ _ffi_closure_ASM: lwzx r3,r4,r3 /* get the contents of that table value */ add r3,r3,r4 /* add contents of table to table address */ mtctr r3 - bctr /* jump to it */ + bctr /* jump to it */ +LFE1: + .align 2 .L60: .long .L44-.L60 /* FFI_TYPE_VOID */ @@ -180,10 +183,54 @@ _ffi_closure_ASM: /* case void / done */ .L44: - addi r1,r1,164 /* restore stack pointer */ - lwz r0,8(r1) /* get return address */ - mtlr r0 /* reset link register */ + addi r1,r1,176 /* restore stack pointer */ + lwz r0,8(r1) /* get return address */ + mtlr r0 /* reset link register */ blr -/* END(ffi_closure_ASM) */ +/* END(ffi_closure_ASM) */ + +.data +.section __TEXT,__eh_frame +Lframe1: + .set L$set$0,LECIE1-LSCIE1 + .long L$set$0 ; Length of Common Information Entry +LSCIE1: + .long 0x0 ; CIE Identifier Tag + .byte 0x1 ; CIE Version + .ascii "zR\0" ; CIE Augmentation + .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor + .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor + .byte 0x41 ; CIE RA Column + .byte 0x1 ; uleb128 0x1; Augmentation size + .byte 0x10 ; FDE Encoding (pcrel) + .byte 0xc ; DW_CFA_def_cfa + .byte 0x1 ; uleb128 0x1 + .byte 0x0 ; uleb128 0x0 + .align 2 +LECIE1: +LSFDE1: + .set L$set$1,LEFDE1-LASFDE1 + .long L$set$1 ; FDE Length + +LASFDE1: + .set L$set$2,LASFDE1-Lframe1 + .long L$set$2 ; FDE CIE offset + .long LFB1-. ; FDE initial location + .set L$set$3,LFE1-LFB1 + .long L$set$3 ; FDE address range + .byte 0x0 ; uleb128 0x0; Augmentation size + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$3,LCFI1-LCFI0 + .long L$set$3 + .byte 0xe ; DW_CFA_def_cfa_offset + .byte 176,1 ; uleb128 176 + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$4,LCFI0-LFB1 + .long L$set$4 + .byte 0x11 ; DW_CFA_offset_extended_sf + .byte 0x41 ; uleb128 0x41 + .byte 0x7e ; sleb128 -2 + .align 2 +LEFDE1: |