1 /* -----------------------------------------------------------------------
2 sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Red Hat, Inc.
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 ----------------------------------------------------------------------- */
29 #include <fficonfig.h>
38 .type ffi_call_SYSV,@function
46 /* Make room for all of the new args. */
52 /* Place all of the ffi_prep_args in position */
57 /* Return stack to previous state and call the function */
62 /* Remove the space we pushed for the args */
66 /* Load %ecx with the return type code */
69 /* If the return value pointer is NULL, assume no return value. */
73 /* Even if there is no space for the return value, we are
74 obliged to handle floating-point values. */
75 cmpl $FFI_TYPE_FLOAT,%ecx
82 cmpl $FFI_TYPE_INT,%ecx
84 /* Load %ecx with the pointer to storage for the return value */
90 cmpl $FFI_TYPE_FLOAT,%ecx
92 /* Load %ecx with the pointer to storage for the return value */
98 cmpl $FFI_TYPE_DOUBLE,%ecx
100 /* Load %ecx with the pointer to storage for the return value */
106 cmpl $FFI_TYPE_LONGDOUBLE,%ecx
108 /* Load %ecx with the pointer to storage for the return value */
114 cmpl $FFI_TYPE_SINT64,%ecx
116 /* Load %ecx with the pointer to storage for the return value */
131 .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
133 .section .eh_frame,EH_FRAME_FLAGS,@progbits
135 .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
137 .long 0x0 /* CIE Identifier Tag */
138 .byte 0x1 /* CIE Version */
140 .ascii "zR\0" /* CIE Augmentation */
142 .ascii "\0" /* CIE Augmentation */
144 .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
145 .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
146 .byte 0x8 /* CIE RA Column */
148 .byte 0x1 /* .uleb128 0x1; Augmentation size */
149 .byte 0x1b /* FDE Encoding (pcrel sdata4) */
151 .byte 0xc /* DW_CFA_def_cfa */
152 .byte 0x4 /* .uleb128 0x4 */
153 .byte 0x4 /* .uleb128 0x4 */
154 .byte 0x88 /* DW_CFA_offset, column 0x8 */
155 .byte 0x1 /* .uleb128 0x1 */
159 .long .LEFDE1-.LASFDE1 /* FDE Length */
161 .long .LASFDE1-.Lframe1 /* FDE CIE offset */
163 .long .LFB1-. /* FDE initial location */
165 .long .LFB1 /* FDE initial location */
167 .long .LFE1-.LFB1 /* FDE address range */
169 .byte 0x0 /* .uleb128 0x0; Augmentation size */
171 .byte 0x4 /* DW_CFA_advance_loc4 */
173 .byte 0xe /* DW_CFA_def_cfa_offset */
174 .byte 0x8 /* .uleb128 0x8 */
175 .byte 0x85 /* DW_CFA_offset, column 0x5 */
176 .byte 0x2 /* .uleb128 0x2 */
177 .byte 0x4 /* DW_CFA_advance_loc4 */
179 .byte 0xd /* DW_CFA_def_cfa_register */
180 .byte 0x5 /* .uleb128 0x5 */
184 #endif /* ifndef __x86_64__ */