13 void rtems_cache_flush_multiple_data_lines(
const void *,
size_t );
15 #include <sys/syscall.h> 17 #include <mint/mintbind.h> 18 #include <mint/ssystem.h> 20 #include <asm/cachectl.h> 26 void *,
void (*fn) ());
31 void *resp,
void *args);
43 void *struct_value_ptr;
51 (((ecif->
cif->rtype->type == FFI_TYPE_STRUCT)
52 && !ecif->
cif->flags)))
53 struct_value_ptr = ecif->
rvalue;
55 struct_value_ptr =
NULL;
59 for (i = ecif->
cif->nargs, p_arg = ecif->
cif->arg_types;
63 size_t z = (*p_arg)->size;
64 int type = (*p_arg)->type;
71 *(
signed int *) argp = (
signed int) *(SINT8 *) *p_argv;
75 *(
unsigned int *) argp = (
unsigned int) *(UINT8 *) *p_argv;
79 *(
signed int *) argp = (
signed int) *(SINT16 *) *p_argv;
83 *(
unsigned int *) argp = (
unsigned int) *(UINT16 *) *p_argv;
89 memcpy (argp + 2, *p_argv, z);
93 memcpy (argp +
sizeof (
int) - z, *p_argv, z);
104 memcpy (argp, *p_argv, z);
107 if ((
sizeof(
int) - 1) & z)
108 z =
ALIGN(z,
sizeof(
int));
115 return struct_value_ptr;
118 #define CIF_FLAGS_INT 1 119 #define CIF_FLAGS_DINT 2 120 #define CIF_FLAGS_FLOAT 4 121 #define CIF_FLAGS_DOUBLE 8 122 #define CIF_FLAGS_LDOUBLE 16 123 #define CIF_FLAGS_POINTER 32 124 #define CIF_FLAGS_STRUCT1 64 125 #define CIF_FLAGS_STRUCT2 128 126 #define CIF_FLAGS_SINT8 256 127 #define CIF_FLAGS_SINT16 512 134 switch (cif->rtype->type)
140 case FFI_TYPE_STRUCT:
141 if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT &&
142 cif->rtype->elements[1])
148 switch (cif->rtype->size)
182 case FFI_TYPE_DOUBLE:
186 #if (FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE) 196 case FFI_TYPE_POINTER:
200 case FFI_TYPE_SINT64:
201 case FFI_TYPE_UINT64:
205 case FFI_TYPE_SINT16:
222 ffi_call (ffi_cif *cif,
void (*fn) (),
void *rvalue,
void **avalue)
233 && cif->rtype->type == FFI_TYPE_STRUCT
234 && cif->rtype->size > 8)
263 for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
270 cif->rtype->type == FFI_TYPE_STRUCT &&
273 *p_argv = (
void *) (argp + 2);
279 cif->rtype->type == FFI_TYPE_STRUCT &&
282 *p_argv = (
void *) (argp);
290 *p_argv = (
void *) (argp + 4 - z);
296 *p_argv = (
void *) argp;
299 if ((
sizeof(
int) - 1) & z)
300 z =
ALIGN(z,
sizeof(
int));
315 arg_area = (
void**)
alloca (cif->nargs * sizeof (
void *));
319 (closure->fun) (cif, resp, arg_area, closure->user_data);
327 void (*fun)(ffi_cif*,
void*,
void**,
void*),
334 *(
unsigned short *)closure->tramp = 0x207c;
335 *(
void **)(closure->tramp + 2) = codeloc;
336 *(
unsigned short *)(closure->tramp + 6) = 0x4ef9;
342 (((cif->rtype->type == FFI_TYPE_STRUCT)
350 #elif defined(__MINT__) 353 syscall(SYS_cacheflush, codeloc, FLUSH_SCOPE_LINE,
358 closure->user_data = user_data;
#define CIF_FLAGS_STRUCT1
#define CIF_FLAGS_STRUCT2
void FFI_HIDDEN ffi_closure_SYSV_inner(ffi_closure *closure, struct call_context *context, void *stack)
#define FFI_TRAMPOLINE_SIZE
static void ffi_prep_incoming_args_SYSV(char *stack, void **avalue, ffi_cif *cif)
void ffi_call_SYSV(unsigned(*)(struct call_context *context, unsigned char *, extended_cif *), struct call_context *context, extended_cif *, size_t, void(*fn)(void))
#define CIF_FLAGS_POINTER
#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)
#define CIF_FLAGS_LDOUBLE
void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue)
void ffi_closure_struct_SYSV(ffi_closure *)
void ffi_prep_args(char *stack, extended_cif *ecif)
ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
void ffi_closure_SYSV(ffi_closure *)