1 /* -----------------------------------------------------------------------
3 sysv.S - Copyright (c) 1998, 2012 Andreas Schwab
4 Copyright (c) 2008 Red Hat, Inc.
6 m68k Foreign Function Interface
8 Permission is hereby granted, free of charge, to any person obtaining
9 a copy of this software and associated documentation files (the
10 ``Software''), to deal in the Software without restriction, including
11 without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense, and/or sell copies of the Software, and to
13 permit persons to whom the Software is furnished to do so, subject to
14 the following conditions:
16 The above copyright notice and this permission notice shall be included
17 in all copies or substantial portions of the Software.
19 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
20 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 DEALINGS IN THE SOFTWARE.
27 ----------------------------------------------------------------------- */
30 #include <fficonfig.h>
33 #ifdef HAVE_AS_CFI_PSEUDO_OP
34 #define CFI_STARTPROC() .cfi_startproc
35 #define CFI_OFFSET(reg,off) .cfi_offset reg,off
36 #define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off
37 #define CFI_ENDPROC() .cfi_endproc
39 #define CFI_STARTPROC()
40 #define CFI_OFFSET(reg,off)
41 #define CFI_DEF_CFA(reg,off)
48 .type ffi_call_SYSV,@function
59 | Make room for all of the new args.
68 bsr.l ffi_prep_args@PLTPC
72 | Pass pointer to struct value, if any
79 | Remove the space we pushed for the args
82 | Load the pointer to storage for the return value
85 | Load the return type code
88 | If the return value pointer is NULL, assume no return value.
89 | NOTE: On the mc68000, tst on an address register is not supported.
90 #if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
112 #if defined(__MC68881__) || defined(__HAVE_68881__)
122 #if defined(__MC68881__) || defined(__HAVE_68881__)
133 #if defined(__MC68881__) || defined(__HAVE_68881__)
165 .size ffi_call_SYSV,.-ffi_call_SYSV
167 .globl ffi_closure_SYSV
168 .type ffi_closure_SYSV, @function
181 jsr ffi_closure_SYSV_inner
183 bsr.l ffi_closure_SYSV_inner@PLTPC
202 #if defined(__MC68881__) || defined(__HAVE_68881__)
211 jcs .Lcls_ret_ldouble
212 #if defined(__MC68881__) || defined(__HAVE_68881__)
220 #if defined(__MC68881__) || defined(__HAVE_68881__)
230 jne .Lcls_ret_struct2
231 jcs .Lcls_ret_struct1
243 .size ffi_closure_SYSV,.-ffi_closure_SYSV
245 .globl ffi_closure_struct_SYSV
246 .type ffi_closure_struct_SYSV, @function
249 ffi_closure_struct_SYSV:
259 jsr ffi_closure_SYSV_inner
261 bsr.l ffi_closure_SYSV_inner@PLTPC
266 .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
268 #if defined __ELF__ && defined __linux__
269 .section .note.GNU-stack,"",@progbits