1 /* -----------------------------------------------------------------------
2 sysv.S - Copyright (c) 1998 Andreas Schwab
3 Copyright (c) 2008 Red Hat, Inc.
5 m68k Foreign Function Interface
7 Permission is hereby granted, free of charge, to any person obtaining
8 a copy of this software and associated documentation files (the
9 ``Software''), to deal in the Software without restriction, including
10 without limitation the rights to use, copy, modify, merge, publish,
11 distribute, sublicense, and/or sell copies of the Software, and to
12 permit persons to whom the Software is furnished to do so, subject to
13 the following conditions:
15 The above copyright notice and this permission notice shall be included
16 in all copies or substantial portions of the Software.
18 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 ----------------------------------------------------------------------- */
29 #include <fficonfig.h>
32 #ifdef HAVE_AS_CFI_PSEUDO_OP
33 #define CFI_STARTPROC() .cfi_startproc
34 #define CFI_OFFSET(reg,off) .cfi_offset reg,off
35 #define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off
36 #define CFI_ENDPROC() .cfi_endproc
38 #define CFI_STARTPROC()
39 #define CFI_OFFSET(reg,off)
40 #define CFI_DEF_CFA(reg,off)
47 .type ffi_call_SYSV,@function
58 | Make room for all of the new args.
67 bsr.l ffi_prep_args@PLTPC
71 | Pass pointer to struct value, if any
78 | Remove the space we pushed for the args
81 | Load the pointer to storage for the return value
84 | Load the return type code
87 | If the return value pointer is NULL, assume no return value.
144 .size ffi_call_SYSV,.-ffi_call_SYSV
146 .globl ffi_closure_SYSV
147 .type ffi_closure_SYSV, @function
160 jsr ffi_closure_SYSV_inner
162 bsr.l ffi_closure_SYSV_inner@PLTPC
186 jcs .Lcls_ret_ldouble
194 jne .Lcls_ret_struct2
195 jcs .Lcls_ret_struct1
207 .size ffi_closure_SYSV,.-ffi_closure_SYSV
209 .globl ffi_closure_struct_SYSV
210 .type ffi_closure_struct_SYSV, @function
213 ffi_closure_struct_SYSV:
223 jsr ffi_closure_SYSV_inner
225 bsr.l ffi_closure_SYSV_inner@PLTPC
230 .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
232 #if defined __ELF__ && defined __linux__
233 .section .note.GNU-stack,"",@progbits