2 #include <powerpc/asm.h>
6 ENTRY(ffi_closure_SYSV)
14 # we want to build up an areas for the parameters passed
15 # in registers (both floating point and integer)
17 # so first save gpr 3 to gpr 10 (aligned to 4)
27 # next save fpr 1 to fpr 8 (aligned to 8)
37 # set up registers for the routine that actually does the work
38 # get the context pointer from the trampoline
41 # now load up the pointer to the result storage
44 # now load up the pointer to the saved gpr registers
47 # now load up the pointer to the saved fpr registers */
50 # now load up the pointer to the outgoing parameter
51 # stack in the previous frame
52 # i.e. the previous frame pointer + 8
56 bl JUMPTARGET(ffi_closure_helper_SYSV)
58 # now r3 contains the return type
59 # so use it to look up in a table
60 # so we know how to deal with each type
62 # look up the proper starting point in table
63 # by using return type as offset
64 addi %r5,%r1,112 # get pointer to results area
65 bl .Lget_ret_type0_addr # get pointer to .Lret_type0 into LR
67 slwi %r3,%r3,4 # now multiply return type by 16
68 add %r3,%r3,%r4 # add contents of table to table address
73 # Each of the ret_typeX code fragments has to be exactly 16 bytes long
74 # (4 instructions). For cache effectiveness we align to a 16 byte boundary
105 # case FFI_TYPE_DOUBLE
112 # case FFI_TYPE_LONGDOUBLE
119 # case FFI_TYPE_UINT8
126 # case FFI_TYPE_SINT8
133 # case FFI_TYPE_UINT16
140 # case FFI_TYPE_SINT16
147 # case FFI_TYPE_UINT32
154 # case FFI_TYPE_SINT32
161 # case FFI_TYPE_UINT64
168 # case FFI_TYPE_SINT64
175 # case FFI_TYPE_STRUCT
182 # case FFI_TYPE_POINTER
196 END(ffi_closure_SYSV)
198 .section ".eh_frame","aw"
200 .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
202 .4byte 0x0 # CIE Identifier Tag
203 .byte 0x1 # CIE Version
204 .ascii "\0" # CIE Augmentation
205 .byte 0x1 # uleb128 0x1; CIE Code Alignment Factor
206 .byte 0x7c # sleb128 -4; CIE Data Alignment Factor
207 .byte 0x41 # CIE RA Column
208 .byte 0xc # DW_CFA_def_cfa
209 .byte 0x1 # uleb128 0x1
210 .byte 0x0 # uleb128 0x0
214 .4byte .LEFDE1-.LASFDE1 # FDE Length
216 .4byte .LASFDE1-__FRAME_BEGIN__ # FDE CIE offset
217 .4byte .LFB1 # FDE initial location
218 .4byte .LFE1-.LFB1 # FDE address range
219 .byte 0x4 # DW_CFA_advance_loc4
221 .byte 0xe # DW_CFA_def_cfa_offset
222 .byte 144,1 # uleb128 144
223 .byte 0x4 # DW_CFA_advance_loc4
225 .byte 0x2f # DW_CFA_GNU_negative_offset_extended
226 .byte 0x41 # uleb128 0x41
227 .byte 0x1 # uleb128 0x1