summaryrefslogtreecommitdiff
path: root/libffi/src/m68k/sysv.S
diff options
context:
space:
mode:
authorzippel <zippel@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-10 21:29:04 +0000
committerzippel <zippel@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-10 21:29:04 +0000
commit0e3a3bdbc4fc91a1fdf5a7bca1a3907e91125800 (patch)
tree78cb2774ba34e95691b63ceefd517e55587b612b /libffi/src/m68k/sysv.S
parenta53add809f636110657909ca4f563f15233f9121 (diff)
downloadgcc-0e3a3bdbc4fc91a1fdf5a7bca1a3907e91125800.tar.gz
* src/m68k/ffi.c (ffi_prep_incoming_args_SYSV,
ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support. * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise. * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. (FFI_CLOSURES): Enable closure support. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124601 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/src/m68k/sysv.S')
-rw-r--r--libffi/src/m68k/sysv.S86
1 files changed, 86 insertions, 0 deletions
diff --git a/libffi/src/m68k/sysv.S b/libffi/src/m68k/sysv.S
index a3d9a4f7ff7..d2a4ff1c64a 100644
--- a/libffi/src/m68k/sysv.S
+++ b/libffi/src/m68k/sysv.S
@@ -121,3 +121,89 @@ epilogue:
rts
CFI_ENDPROC()
.size ffi_call_SYSV,.-ffi_call_SYSV
+
+ .globl ffi_closure_SYSV
+ .type ffi_closure_SYSV, @function
+ .align 4
+
+ffi_closure_SYSV:
+ CFI_STARTPROC()
+ link %fp,#-12
+ CFI_OFFSET(14,-8)
+ CFI_DEF_CFA(14,8)
+ move.l %sp,-12(%fp)
+ pea 8(%fp)
+ pea -12(%fp)
+ move.l %a0,-(%sp)
+#if !defined __PIC__
+ jsr ffi_closure_SYSV_inner
+#else
+ bsr.l ffi_closure_SYSV_inner@PLTPC
+#endif
+
+ lsr.l #1,%d0
+ jne 1f
+ jcc .Lcls_epilogue
+ move.l -12(%fp),%d0
+.Lcls_epilogue:
+ unlk %fp
+ rts
+1:
+ lea -12(%fp),%a0
+ lsr.l #2,%d0
+ jne 1f
+ jcs .Lcls_ret_float
+ move.l (%a0)+,%d0
+ move.l (%a0),%d1
+ jra .Lcls_epilogue
+.Lcls_ret_float:
+ fmove.s (%a0),%fp0
+ jra .Lcls_epilogue
+1:
+ lsr.l #2,%d0
+ jne 1f
+ jcs .Lcls_ret_ldouble
+ fmove.d (%a0),%fp0
+ jra .Lcls_epilogue
+.Lcls_ret_ldouble:
+ fmove.x (%a0),%fp0
+ jra .Lcls_epilogue
+1:
+ lsr.l #2,%d0
+ jne .Lcls_ret_struct2
+ jcs .Lcls_ret_struct1
+ move.l (%a0),%a0
+ move.l %a0,%d0
+ jra .Lcls_epilogue
+.Lcls_ret_struct1:
+ move.b (%a0),%d0
+ jra .Lcls_epilogue
+.Lcls_ret_struct2:
+ move.w (%a0),%d0
+ jra .Lcls_epilogue
+ CFI_ENDPROC()
+
+ .size ffi_closure_SYSV,.-ffi_closure_SYSV
+
+ .globl ffi_closure_struct_SYSV
+ .type ffi_closure_struct_SYSV, @function
+ .align 4
+
+ffi_closure_struct_SYSV:
+ CFI_STARTPROC()
+ link %fp,#0
+ CFI_OFFSET(14,-8)
+ CFI_DEF_CFA(14,8)
+ move.l %sp,-12(%fp)
+ pea 8(%fp)
+ move.l %a1,-(%sp)
+ move.l %a0,-(%sp)
+#if !defined __PIC__
+ jsr ffi_closure_SYSV_inner
+#else
+ bsr.l ffi_closure_SYSV_inner@PLTPC
+#endif
+ unlk %fp
+ rts
+ CFI_ENDPROC()
+ .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV