1 /* -----------------------------------------------------------------------
2 sysv.S - Copyright (c) 1996, 1998, 2001, 2002 Cygnus Solutions
4 X86 Foreign Function Interface
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 ``Software''), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice shall be included
15 in all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 OTHER DEALINGS IN THE SOFTWARE.
24 ----------------------------------------------------------------------- */
37 .type ffi_call_SYSV,@function
45 /* Make room for all of the new args. */
51 /* Place all of the ffi_prep_args in position */
56 /* Return stack to previous state and call the function */
61 /* Remove the space we pushed for the args */
65 /* Load %ecx with the return type code */
68 /* If the return value pointer is NULL, assume no return value. */
72 /* Even if there is no space for the return value, we are
73 obliged to handle floating-point values. */
74 cmpl $FFI_TYPE_FLOAT,%ecx
81 cmpl $FFI_TYPE_INT,%ecx
83 /* Load %ecx with the pointer to storage for the return value */
89 cmpl $FFI_TYPE_FLOAT,%ecx
91 /* Load %ecx with the pointer to storage for the return value */
97 cmpl $FFI_TYPE_DOUBLE,%ecx
99 /* Load %ecx with the pointer to storage for the return value */
105 cmpl $FFI_TYPE_LONGDOUBLE,%ecx
107 /* Load %ecx with the pointer to storage for the return value */
113 cmpl $FFI_TYPE_SINT64,%ecx
115 /* Load %ecx with the pointer to storage for the return value */
130 .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
132 .section .eh_frame,EH_FRAME_FLAGS,@progbits
134 .long .LECIE1-.LSCIE1 # Length of Common Information Entry
136 .long 0x0 # CIE Identifier Tag
137 .byte 0x1 # CIE Version
139 .ascii "zR\0" # CIE Augmentation
141 .ascii "\0" # CIE Augmentation
143 .uleb128 0x1 # CIE Code Alignment Factor
144 .sleb128 -4 # CIE Data Alignment Factor
145 .byte 0x8 # CIE RA Column
147 .uleb128 0x1 # Augmentation size
148 .byte 0x1b # FDE Encoding (pcrel sdata4)
150 .byte 0xc # DW_CFA_def_cfa
153 .byte 0x88 # DW_CFA_offset, column 0x8
158 .long .LEFDE1-.LASFDE1 # FDE Length
160 .long .LASFDE1-.Lframe1 # FDE CIE offset
162 .long .LFB1-. # FDE initial location
164 .long .LFB1 # FDE initial location
166 .long .LFE1-.LFB1 # FDE address range
168 .uleb128 0x0 # Augmentation size
170 .byte 0x4 # DW_CFA_advance_loc4
172 .byte 0xe # DW_CFA_def_cfa_offset
174 .byte 0x85 # DW_CFA_offset, column 0x5
176 .byte 0x4 # DW_CFA_advance_loc4
178 .byte 0xd # DW_CFA_def_cfa_register
183 #endif /* ifndef __x86_64__ */