• Home
  • Raw
  • Download

Lines Matching refs:cif

137   if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {  in ffi_prep_args_SYSV()
144 for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; in ffi_prep_args_SYSV()
166 FFI_ASSERT(ecif->cif->abi == FFI_VFP); in ffi_prep_args_VFP()
176 if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { in ffi_prep_args_VFP()
183 for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; in ffi_prep_args_VFP()
190 if(vi < ecif->cif->vfp_nargs && is_vfp_type) in ffi_prep_args_VFP()
192 char *vfp_slot = (char *)(vfp_space + ecif->cif->vfp_args[vi++]); in ffi_prep_args_VFP()
230 return ecif->cif->vfp_used; in ffi_prep_args_VFP()
234 ffi_status ffi_prep_cif_machdep(ffi_cif *cif) in ffi_prep_cif_machdep() argument
240 cif->bytes = (cif->bytes + 7) & ~7; in ffi_prep_cif_machdep()
243 switch (cif->rtype->type) in ffi_prep_cif_machdep()
248 cif->flags = (unsigned) cif->rtype->type; in ffi_prep_cif_machdep()
253 cif->flags = (unsigned) FFI_TYPE_SINT64; in ffi_prep_cif_machdep()
257 if (cif->abi == FFI_VFP in ffi_prep_cif_machdep()
258 && (type_code = vfp_type_p (cif->rtype)) != 0) in ffi_prep_cif_machdep()
262 cif->flags = (unsigned) type_code; in ffi_prep_cif_machdep()
264 else if (cif->rtype->size <= 4) in ffi_prep_cif_machdep()
266 cif->flags = (unsigned)FFI_TYPE_INT; in ffi_prep_cif_machdep()
271 cif->flags = (unsigned)FFI_TYPE_STRUCT; in ffi_prep_cif_machdep()
275 cif->flags = FFI_TYPE_INT; in ffi_prep_cif_machdep()
282 if (cif->abi == FFI_VFP) in ffi_prep_cif_machdep()
283 layout_vfp_args (cif); in ffi_prep_cif_machdep()
289 ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, in ffi_prep_cif_machdep_var() argument
294 if (cif->abi == FFI_VFP) in ffi_prep_cif_machdep_var()
295 cif->abi = FFI_SYSV; in ffi_prep_cif_machdep_var()
297 return ffi_prep_cif_machdep(cif); in ffi_prep_cif_machdep_var()
304 void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) in ffi_call() argument
308 int small_struct = (cif->flags == FFI_TYPE_INT in ffi_call()
309 && cif->rtype->type == FFI_TYPE_STRUCT); in ffi_call()
310 int vfp_struct = (cif->flags == FFI_TYPE_STRUCT_VFP_FLOAT in ffi_call()
311 || cif->flags == FFI_TYPE_STRUCT_VFP_DOUBLE); in ffi_call()
315 ecif.cif = cif; in ffi_call()
322 (cif->flags == FFI_TYPE_STRUCT)) in ffi_call()
324 ecif.rvalue = alloca(cif->rtype->size); in ffi_call()
336 switch (cif->abi) in ffi_call()
339 ffi_call_SYSV (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue); in ffi_call()
344 ffi_call_VFP (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue); in ffi_call()
355 memcpy (rvalue, &temp, cif->rtype->size); in ffi_call()
361 memcpy (rvalue, ecif.rvalue, cif->rtype->size); in ffi_call()
369 void** args, ffi_cif* cif, float *vfp_stack);
372 void** args, ffi_cif* cif, float *vfp_stack);
385 ffi_cif *cif; in ffi_closure_inner() local
388 cif = closure->cif; in ffi_closure_inner()
389 arg_area = (void**) alloca (cif->nargs * sizeof (void*)); in ffi_closure_inner()
396 if (cif->abi == FFI_VFP) in ffi_closure_inner()
397 ffi_prep_incoming_args_VFP(args, respp, arg_area, cif, vfp_args); in ffi_closure_inner()
399 ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args); in ffi_closure_inner()
401 (closure->fun) (cif, *respp, arg_area, closure->user_data); in ffi_closure_inner()
403 return cif->flags; in ffi_closure_inner()
409 void **avalue, ffi_cif *cif, in ffi_prep_incoming_args_SYSV() argument
421 if ( cif->flags == FFI_TYPE_STRUCT ) { in ffi_prep_incoming_args_SYSV()
428 for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) in ffi_prep_incoming_args_SYSV()
450 void **avalue, ffi_cif *cif, in ffi_prep_incoming_args_VFP() argument
463 FFI_ASSERT(cif->abi == FFI_VFP); in ffi_prep_incoming_args_VFP()
467 if ( cif->flags == FFI_TYPE_STRUCT ) { in ffi_prep_incoming_args_VFP()
474 for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) in ffi_prep_incoming_args_VFP()
479 if(vi < cif->vfp_nargs && is_vfp_type) in ffi_prep_incoming_args_VFP()
481 *p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]); in ffi_prep_incoming_args_VFP()
774 ffi_cif* cif, in ffi_prep_closure_loc() argument
781 if (cif->abi == FFI_SYSV) in ffi_prep_closure_loc()
784 else if (cif->abi == FFI_VFP) in ffi_prep_closure_loc()
800 closure->cif = cif; in ffi_prep_closure_loc()
872 static int place_vfp_arg (ffi_cif *cif, ffi_type *t) in place_vfp_arg() argument
874 short reg = cif->vfp_reg_free; in place_vfp_arg()
887 if (cif->vfp_used & (1 << s)) in place_vfp_arg()
894 cif->vfp_used |= new_used; in place_vfp_arg()
895 cif->vfp_args[cif->vfp_nargs++] = reg; in place_vfp_arg()
898 if (cif->vfp_used & (1 << cif->vfp_reg_free)) in place_vfp_arg()
901 while (cif->vfp_used & (1 << reg)) in place_vfp_arg()
903 cif->vfp_reg_free = reg; in place_vfp_arg()
909 cif->vfp_reg_free = 16; in place_vfp_arg()
910 cif->vfp_used = 0xFFFF; in place_vfp_arg()
914 static void layout_vfp_args (ffi_cif *cif) in layout_vfp_args() argument
918 cif->vfp_used = 0; in layout_vfp_args()
919 cif->vfp_nargs = 0; in layout_vfp_args()
920 cif->vfp_reg_free = 0; in layout_vfp_args()
921 memset (cif->vfp_args, -1, 16); /* Init to -1. */ in layout_vfp_args()
923 for (i = 0; i < cif->nargs; i++) in layout_vfp_args()
925 ffi_type *t = cif->arg_types[i]; in layout_vfp_args()
926 if (vfp_type_p (t) && place_vfp_arg (cif, t) == 1) in layout_vfp_args()