diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-20 21:49:12 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-20 21:49:12 +0000 |
commit | c9c81ef3c667aaa14c498a5449ec6d134b4b66ff (patch) | |
tree | 0ac440db6513ee01deb5e5dc6142769d1e5b7b2d /libffi/src/pa/linux.S | |
parent | 12cdcb9d74f55c165366ca1b1eeec013a0ce72ef (diff) | |
parent | 891196d7325e4c55d92d5ac5cfe7161c4f36c0ce (diff) | |
download | gcc-fortran-dev.tar.gz |
Merge from trunk (r239915 to r240230)fortran-dev
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@240290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/src/pa/linux.S')
-rw-r--r-- | libffi/src/pa/linux.S | 135 |
1 files changed, 59 insertions, 76 deletions
diff --git a/libffi/src/pa/linux.S b/libffi/src/pa/linux.S index f11ae768074..602690432c0 100644 --- a/libffi/src/pa/linux.S +++ b/libffi/src/pa/linux.S @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- linux.S - (c) 2003-2004 Randolph Chung <tausq@debian.org> (c) 2008 Red Hat, Inc. + (c) 2016 John David Anglin HPPA Foreign Function Interface @@ -37,24 +38,26 @@ unsigned bytes, unsigned flags, unsigned *rvalue, - void (*fn)(void)); + void (*fn)(void), + ffi_go_closure *closure); */ .export ffi_call_pa32,code .import ffi_prep_args_pa32,code .type ffi_call_pa32, @function -.LFB1: + .cfi_startproc ffi_call_pa32: .proc .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4 .entry stw %rp, -20(%sp) copy %r3, %r1 -.LCFI11: + .cfi_offset 2, -20 + .cfi_register 3, 1 copy %sp, %r3 -.LCFI12: + .cfi_def_cfa_register 3 /* Setup the stack for calling prep_args... We want the stack to look like this: @@ -70,8 +73,8 @@ ffi_call_pa32: */ stwm %r1, 64(%sp) + .cfi_offset 3, 0 stw %r4, 12(%r3) -.LCFI13: copy %sp, %r4 addl %arg2, %r4, %arg0 /* arg stack */ @@ -98,6 +101,7 @@ ffi_call_pa32: we need to give it a place to put the result. */ ldw -52(%r3), %ret0 /* %ret0 <- rvalue */ ldw -56(%r3), %r22 /* %r22 <- function to call */ + ldw -60(%r3), %ret1 /* %ret1 <- closure */ bl $$dyncall, %r31 /* Call the user function */ copy %r31, %rp @@ -249,27 +253,27 @@ ffi_call_pa32: nop .exit .procend -.LFE1: + .cfi_endproc /* void ffi_closure_pa32(void); - Called with closure argument in %r21 */ + Called with ffi_closure argument in %r21. */ .export ffi_closure_pa32,code .import ffi_closure_inner_pa32,code - .type ffi_closure_pa32, @function -.LFB2: + .cfi_startproc ffi_closure_pa32: .proc .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 .entry stw %rp, -20(%sp) -.LCFI20: copy %r3, %r1 -.LCFI21: + .cfi_offset 2, -20 + .cfi_register 3, 1 copy %sp, %r3 -.LCFI22: + .cfi_def_cfa_register 3 stwm %r1, 64(%sp) + .cfi_offset 3, 0 /* Put arguments onto the stack and call ffi_closure_inner. */ stw %arg0, -36(%r3) @@ -277,7 +281,9 @@ ffi_closure_pa32: stw %arg2, -44(%r3) stw %arg3, -48(%r3) + /* Closure type 0. */ copy %r21, %arg0 + copy %r0, %arg2 bl ffi_closure_inner_pa32, %r2 copy %r3, %arg1 @@ -289,69 +295,46 @@ ffi_closure_pa32: .exit .procend -.LFE2: - - .section ".eh_frame",EH_FRAME_FLAGS,@progbits -.Lframe1: - .word .LECIE1-.LSCIE1 ;# Length of Common Information Entry -.LSCIE1: - .word 0x0 ;# CIE Identifier Tag - .byte 0x1 ;# CIE Version - .ascii "\0" ;# CIE Augmentation - .uleb128 0x1 ;# CIE Code Alignment Factor - .sleb128 4 ;# CIE Data Alignment Factor - .byte 0x2 ;# CIE RA Column - .byte 0xc ;# DW_CFA_def_cfa - .uleb128 0x1e - .uleb128 0x0 - .align 4 -.LECIE1: -.LSFDE1: - .word .LEFDE1-.LASFDE1 ;# FDE Length -.LASFDE1: - .word .LASFDE1-.Lframe1 ;# FDE CIE offset - .word .LFB1 ;# FDE initial location - .word .LFE1-.LFB1 ;# FDE address range - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI11-.LFB1 - .byte 0x83 ;# DW_CFA_offset, column 0x3 - .uleb128 0x0 - .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20] - .uleb128 0x2 - .sleb128 -5 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI12-.LCFI11 - .byte 0xd ;# DW_CFA_def_cfa_register = r3 - .uleb128 0x3 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI13-.LCFI12 - .byte 0x84 ;# DW_CFA_offset, column 0x4 - .uleb128 0x3 + .cfi_endproc - .align 4 -.LEFDE1: - -.LSFDE2: - .word .LEFDE2-.LASFDE2 ;# FDE Length -.LASFDE2: - .word .LASFDE2-.Lframe1 ;# FDE CIE offset - .word .LFB2 ;# FDE initial location - .word .LFE2-.LFB2 ;# FDE address range - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI21-.LFB2 - .byte 0x83 ;# DW_CFA_offset, column 0x3 - .uleb128 0x0 - .byte 0x11 ;# DW_CFA_offset_extended_sf - .uleb128 0x2 - .sleb128 -5 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI22-.LCFI21 - .byte 0xd ;# DW_CFA_def_cfa_register = r3 - .uleb128 0x3 + /* void ffi_go_closure_pa32(void); + Called with ffi_go_closure argument in %ret1. */ + .export ffi_go_closure_pa32,code + .import ffi_closure_inner_pa32,code + .type ffi_go_closure_pa32, @function + .cfi_startproc +ffi_go_closure_pa32: + .proc + .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 + .entry - .align 4 -.LEFDE2: + stw %rp, -20(%sp) + copy %r3, %r1 + .cfi_offset 2, -20 + .cfi_register 3, 1 + copy %sp, %r3 + .cfi_def_cfa_register 3 + stwm %r1, 64(%sp) + .cfi_offset 3, 0 + + /* Put arguments onto the stack and call ffi_closure_inner. */ + stw %arg0, -36(%r3) + stw %arg1, -40(%r3) + stw %arg2, -44(%r3) + stw %arg3, -48(%r3) + + /* Closure type 1. */ + copy %ret1, %arg0 + ldi 1, %arg2 + bl ffi_closure_inner_pa32, %r2 + copy %r3, %arg1 + + ldwm -64(%sp), %r3 + ldw -20(%sp), %rp + ldw -36(%sp), %ret0 + bv %r0(%r2) + ldw -40(%sp), %ret1 + + .exit + .procend + .cfi_endproc |