32 #define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG) 42 return FFI_BAD_TYPEDEF;
47 ptr = &(arg->elements[0]);
50 return FFI_BAD_TYPEDEF;
52 while ((*ptr) !=
NULL)
56 return FFI_BAD_TYPEDEF;
61 arg->size =
ALIGN(arg->size, (*ptr)->alignment);
62 arg->size += (*ptr)->size;
64 arg->alignment = (arg->alignment > (*ptr)->alignment) ?
65 arg->alignment : (*ptr)->alignment;
77 arg->size =
ALIGN (arg->size, arg->alignment);
81 #ifdef FFI_AGGREGATE_ALIGNMENT 87 return FFI_BAD_TYPEDEF;
108 unsigned int isvariadic,
109 unsigned int nfixedargs,
110 unsigned int ntotalargs,
111 ffi_type *rtype, ffi_type **atypes)
118 FFI_ASSERT((!isvariadic) || (nfixedargs >= 1));
125 cif->arg_types = atypes;
126 cif->nargs = ntotalargs;
131 #if HAVE_LONG_DOUBLE_VARIANT 132 ffi_prep_types (abi);
137 return FFI_BAD_TYPEDEF;
139 #ifndef FFI_TARGET_HAS_COMPLEX_TYPE 140 if (rtype->type == FFI_TYPE_COMPLEX)
147 #if !defined FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION 149 if (cif->rtype->type == FFI_TYPE_STRUCT
151 && (cif->abi !=
FFI_V9 || cif->rtype->size > 32)
157 && (cif->rtype->size > 16)
160 && (cif->rtype->size > 8)
166 for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
171 return FFI_BAD_TYPEDEF;
173 #ifndef FFI_TARGET_HAS_COMPLEX_TYPE 174 if ((*ptr)->type == FFI_TYPE_COMPLEX)
181 #if !defined FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION 183 if (((*ptr)->type == FFI_TYPE_STRUCT
184 && ((*ptr)->size > 16 || cif->abi !=
FFI_V9))
187 bytes +=
sizeof(
void*);
192 if (((*ptr)->alignment - 1) & bytes)
193 bytes = (
unsigned)
ALIGN(bytes, (*ptr)->alignment);
217 #ifdef FFI_TARGET_SPECIFIC_VARIADIC 227 ffi_type *rtype, ffi_type **atypes)
234 unsigned int nfixedargs,
235 unsigned int ntotalargs,
245 ffi_prep_closure (ffi_closure* closure,
247 void (*fun)(ffi_cif*,
void*,
void**,
void*),
ffi_status ffi_prep_cif_var(ffi_cif *cif, ffi_abi abi, unsigned int nfixedargs, unsigned int ntotalargs, ffi_type *rtype, ffi_type **atypes)
#define FFI_TYPE_LONGDOUBLE
ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, void(*fun)(ffi_cif *, void *, void **, void *), void *user_data, void *codeloc)
ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi, unsigned int isvariadic, unsigned int nfixedargs, unsigned int ntotalargs, ffi_type *rtype, ffi_type **atypes)
ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
const UINT64 ffi_template_tramp_tile [] FFI_HIDDEN
#define FFI_ASSERT_VALID_TYPE(x)
ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs)
static ffi_status initialize_aggregate(ffi_type *arg)
#define STACK_ARG_SIZE(x)
#define FFI_AGGREGATE_ALIGNMENT
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)