Lines Matching defs:cif
90 if ( ecif->cif->rstruct_flag != 0 )
92 if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT )
102 for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
127 (ecif->cif->abi == FFI_N64) ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
289 /* Perform machine dependent cif processing */
290 ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
292 cif->flags = 0;
299 if (cif->rtype->type != FFI_TYPE_STRUCT && cif->abi == FFI_O32)
301 if (cif->nargs > 0)
303 switch ((cif->arg_types)[0]->type)
307 cif->flags += (cif->arg_types)[0]->type;
314 if (cif->nargs > 1)
318 if (cif->flags)
320 switch ((cif->arg_types)[1]->type)
324 cif->flags += (cif->arg_types)[1]->type << FFI_FLAG_BITS;
337 if (cif->abi == FFI_O32_SOFT_FLOAT)
339 switch (cif->rtype->type)
343 cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2);
349 cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2);
354 cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2);
361 switch (cif->rtype->type)
367 cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2);
372 cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2);
376 cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2);
387 unsigned count = (cif->nargs < 8) ? cif->nargs : 8;
392 if (cif->rtype->type == FFI_TYPE_STRUCT)
394 struct_flags = calc_n32_return_struct_flags(cif->rtype);
402 count = (cif->nargs < 7) ? cif->nargs : 7;
404 cif->rstruct_flag = !0;
407 cif->rstruct_flag = 0;
410 cif->rstruct_flag = 0;
414 switch ((cif->arg_types)[index]->type)
418 cif->flags +=
419 ((cif->arg_types)[index]->type << (arg_reg * FFI_FLAG_BITS));
426 cif->flags +=
429 cif->flags +=
436 cif->flags += calc_n32_struct_flags((cif->arg_types)[index],
449 switch (cif->rtype->type)
463 cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
464 cif->flags += struct_flags << (4 + (FFI_FLAG_BITS * 8));
475 cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8);
480 cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
481 cif->flags += (FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
485 cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
504 void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
508 ecif.cif = cif;
515 (cif->rtype->type == FFI_TYPE_STRUCT))
516 ecif.rvalue = alloca(cif->rtype->size);
520 switch (cif->abi)
525 ffi_call_O32(ffi_prep_args, &ecif, cif->bytes,
526 cif->flags, ecif.rvalue, fn);
536 if (cif->rtype->type == FFI_TYPE_STRUCT && cif->rtype->size < 16)
544 ffi_call_N32(ffi_prep_args, &ecif, cif->bytes,
545 cif->flags, rvalue_copy, fn);
547 memcpy(ecif.rvalue, rvalue_copy, cif->rtype->size);
567 ffi_cif *cif,
577 FFI_ASSERT(cif->abi == FFI_O32 || cif->abi == FFI_O32_SOFT_FLOAT);
580 FFI_ASSERT(cif->abi == FFI_N32 || cif->abi == FFI_N64);
626 closure->cif = cif;
660 ffi_cif *cif;
666 cif = closure->cif;
667 avalue = alloca (cif->nargs * sizeof (ffi_arg));
668 avaluep = alloca (cif->nargs * sizeof (ffi_arg));
670 seen_int = (cif->abi == FFI_O32_SOFT_FLOAT);
673 if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_STRUCT)
680 avn = cif->nargs;
681 arg_types = cif->arg_types;
733 (closure->fun) (cif, rvalue, avaluep, closure->user_data);
735 if (cif->abi == FFI_O32_SOFT_FLOAT)
737 switch (cif->rtype->type)
744 return cif->rtype->type;
749 return cif->rtype->type;
813 ffi_cif *cif;
819 cif = closure->cif;
820 avalue = alloca (cif->nargs * sizeof (ffi_arg));
821 avaluep = alloca (cif->nargs * sizeof (ffi_arg));
825 if (cif->rstruct_flag)
836 avn = cif->nargs;
837 arg_types = cif->arg_types;
863 type = (cif->abi == FFI_N64) ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
903 copy_struct_N32(avaluep[i], 0, cif->abi, arg_types[i],
919 (closure->fun) (cif, rvalue, avaluep, closure->user_data);
921 return cif->flags >> (FFI_FLAG_BITS * 8);