1 | /* -----------------------------------------------------------------------
|
---|
2 | ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions
|
---|
3 |
|
---|
4 | Sparc Foreign Function Interface
|
---|
5 |
|
---|
6 | Permission is hereby granted, free of charge, to any person obtaining
|
---|
7 | a copy of this software and associated documentation files (the
|
---|
8 | ``Software''), to deal in the Software without restriction, including
|
---|
9 | without limitation the rights to use, copy, modify, merge, publish,
|
---|
10 | distribute, sublicense, and/or sell copies of the Software, and to
|
---|
11 | permit persons to whom the Software is furnished to do so, subject to
|
---|
12 | the following conditions:
|
---|
13 |
|
---|
14 | The above copyright notice and this permission notice shall be included
|
---|
15 | in all copies or substantial portions of the Software.
|
---|
16 |
|
---|
17 | THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
---|
18 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
---|
19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
---|
20 | IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
21 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
23 | OTHER DEALINGS IN THE SOFTWARE.
|
---|
24 | ----------------------------------------------------------------------- */
|
---|
25 |
|
---|
26 | #include <ffi.h>
|
---|
27 | #include <ffi_common.h>
|
---|
28 |
|
---|
29 | #include <stdlib.h>
|
---|
30 |
|
---|
31 | #ifdef SPARC64
|
---|
32 | extern void ffi_closure_v9(void);
|
---|
33 | #else
|
---|
34 | extern void ffi_closure_v8(void);
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | /* ffi_prep_args is called by the assembly routine once stack space
|
---|
38 | has been allocated for the function's arguments */
|
---|
39 |
|
---|
40 | void ffi_prep_args_v8(char *stack, extended_cif *ecif)
|
---|
41 | {
|
---|
42 | int i;
|
---|
43 | void **p_argv;
|
---|
44 | char *argp;
|
---|
45 | ffi_type **p_arg;
|
---|
46 |
|
---|
47 | /* Skip 16 words for the window save area */
|
---|
48 | argp = stack + 16*sizeof(int);
|
---|
49 |
|
---|
50 | /* This should only really be done when we are returning a structure,
|
---|
51 | however, it's faster just to do it all the time...
|
---|
52 |
|
---|
53 | if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) */
|
---|
54 | *(int *) argp = (long)ecif->rvalue;
|
---|
55 |
|
---|
56 | /* And 1 word for the structure return value. */
|
---|
57 | argp += sizeof(int);
|
---|
58 |
|
---|
59 | #ifdef USING_PURIFY
|
---|
60 | /* Purify will probably complain in our assembly routine, unless we
|
---|
61 | zero out this memory. */
|
---|
62 |
|
---|
63 | ((int*)argp)[0] = 0;
|
---|
64 | ((int*)argp)[1] = 0;
|
---|
65 | ((int*)argp)[2] = 0;
|
---|
66 | ((int*)argp)[3] = 0;
|
---|
67 | ((int*)argp)[4] = 0;
|
---|
68 | ((int*)argp)[5] = 0;
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | p_argv = ecif->avalue;
|
---|
72 |
|
---|
73 | for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
|
---|
74 | {
|
---|
75 | size_t z;
|
---|
76 |
|
---|
77 | if ((*p_arg)->type == FFI_TYPE_STRUCT
|
---|
78 | #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
---|
79 | || (*p_arg)->type == FFI_TYPE_LONGDOUBLE
|
---|
80 | #endif
|
---|
81 | )
|
---|
82 | {
|
---|
83 | *(unsigned int *) argp = (unsigned long)(* p_argv);
|
---|
84 | z = sizeof(int);
|
---|
85 | }
|
---|
86 | else
|
---|
87 | {
|
---|
88 | z = (*p_arg)->size;
|
---|
89 | if (z < sizeof(int))
|
---|
90 | {
|
---|
91 | z = sizeof(int);
|
---|
92 | switch ((*p_arg)->type)
|
---|
93 | {
|
---|
94 | case FFI_TYPE_SINT8:
|
---|
95 | *(signed int *) argp = *(SINT8 *)(* p_argv);
|
---|
96 | break;
|
---|
97 |
|
---|
98 | case FFI_TYPE_UINT8:
|
---|
99 | *(unsigned int *) argp = *(UINT8 *)(* p_argv);
|
---|
100 | break;
|
---|
101 |
|
---|
102 | case FFI_TYPE_SINT16:
|
---|
103 | *(signed int *) argp = *(SINT16 *)(* p_argv);
|
---|
104 | break;
|
---|
105 |
|
---|
106 | case FFI_TYPE_UINT16:
|
---|
107 | *(unsigned int *) argp = *(UINT16 *)(* p_argv);
|
---|
108 | break;
|
---|
109 |
|
---|
110 | default:
|
---|
111 | FFI_ASSERT(0);
|
---|
112 | }
|
---|
113 | }
|
---|
114 | else
|
---|
115 | {
|
---|
116 | memcpy(argp, *p_argv, z);
|
---|
117 | }
|
---|
118 | }
|
---|
119 | p_argv++;
|
---|
120 | argp += z;
|
---|
121 | }
|
---|
122 |
|
---|
123 | return;
|
---|
124 | }
|
---|
125 |
|
---|
126 | int ffi_prep_args_v9(char *stack, extended_cif *ecif)
|
---|
127 | {
|
---|
128 | int i, ret = 0;
|
---|
129 | int tmp;
|
---|
130 | void **p_argv;
|
---|
131 | char *argp;
|
---|
132 | ffi_type **p_arg;
|
---|
133 |
|
---|
134 | tmp = 0;
|
---|
135 |
|
---|
136 | /* Skip 16 words for the window save area */
|
---|
137 | argp = stack + 16*sizeof(long long);
|
---|
138 |
|
---|
139 | #ifdef USING_PURIFY
|
---|
140 | /* Purify will probably complain in our assembly routine, unless we
|
---|
141 | zero out this memory. */
|
---|
142 |
|
---|
143 | ((long long*)argp)[0] = 0;
|
---|
144 | ((long long*)argp)[1] = 0;
|
---|
145 | ((long long*)argp)[2] = 0;
|
---|
146 | ((long long*)argp)[3] = 0;
|
---|
147 | ((long long*)argp)[4] = 0;
|
---|
148 | ((long long*)argp)[5] = 0;
|
---|
149 | #endif
|
---|
150 |
|
---|
151 | p_argv = ecif->avalue;
|
---|
152 |
|
---|
153 | if (ecif->cif->rtype->type == FFI_TYPE_STRUCT &&
|
---|
154 | ecif->cif->rtype->size > 32)
|
---|
155 | {
|
---|
156 | *(unsigned long long *) argp = (unsigned long)ecif->rvalue;
|
---|
157 | tmp = 1;
|
---|
158 | }
|
---|
159 |
|
---|
160 | for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs;
|
---|
161 | i++, p_arg++)
|
---|
162 | {
|
---|
163 | size_t z;
|
---|
164 |
|
---|
165 | z = (*p_arg)->size;
|
---|
166 | switch ((*p_arg)->type)
|
---|
167 | {
|
---|
168 | case FFI_TYPE_STRUCT:
|
---|
169 | if (z > 16)
|
---|
170 | {
|
---|
171 | /* For structures larger than 16 bytes we pass reference. */
|
---|
172 | *(unsigned long long *) argp = (unsigned long)* p_argv;
|
---|
173 | argp += sizeof(long long);
|
---|
174 | tmp++;
|
---|
175 | p_argv++;
|
---|
176 | continue;
|
---|
177 | }
|
---|
178 | /* FALLTHROUGH */
|
---|
179 | case FFI_TYPE_FLOAT:
|
---|
180 | case FFI_TYPE_DOUBLE:
|
---|
181 | #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
---|
182 | case FFI_TYPE_LONGDOUBLE:
|
---|
183 | #endif
|
---|
184 | ret = 1; /* We should promote into FP regs as well as integer. */
|
---|
185 | break;
|
---|
186 | }
|
---|
187 | if (z < sizeof(long long))
|
---|
188 | {
|
---|
189 | switch ((*p_arg)->type)
|
---|
190 | {
|
---|
191 | case FFI_TYPE_SINT8:
|
---|
192 | *(signed long long *) argp = *(SINT8 *)(* p_argv);
|
---|
193 | break;
|
---|
194 |
|
---|
195 | case FFI_TYPE_UINT8:
|
---|
196 | *(unsigned long long *) argp = *(UINT8 *)(* p_argv);
|
---|
197 | break;
|
---|
198 |
|
---|
199 | case FFI_TYPE_SINT16:
|
---|
200 | *(signed long long *) argp = *(SINT16 *)(* p_argv);
|
---|
201 | break;
|
---|
202 |
|
---|
203 | case FFI_TYPE_UINT16:
|
---|
204 | *(unsigned long long *) argp = *(UINT16 *)(* p_argv);
|
---|
205 | break;
|
---|
206 |
|
---|
207 | case FFI_TYPE_SINT32:
|
---|
208 | *(signed long long *) argp = *(SINT32 *)(* p_argv);
|
---|
209 | break;
|
---|
210 |
|
---|
211 | case FFI_TYPE_UINT32:
|
---|
212 | *(unsigned long long *) argp = *(UINT32 *)(* p_argv);
|
---|
213 | break;
|
---|
214 |
|
---|
215 | case FFI_TYPE_FLOAT:
|
---|
216 | *(float *) (argp + 4) = *(FLOAT32 *)(* p_argv); /* Right justify */
|
---|
217 | break;
|
---|
218 |
|
---|
219 | case FFI_TYPE_STRUCT:
|
---|
220 | memcpy(argp, *p_argv, z);
|
---|
221 | break;
|
---|
222 |
|
---|
223 | default:
|
---|
224 | FFI_ASSERT(0);
|
---|
225 | }
|
---|
226 | z = sizeof(long long);
|
---|
227 | tmp++;
|
---|
228 | }
|
---|
229 | else if (z == sizeof(long long))
|
---|
230 | {
|
---|
231 | memcpy(argp, *p_argv, z);
|
---|
232 | z = sizeof(long long);
|
---|
233 | tmp++;
|
---|
234 | }
|
---|
235 | else
|
---|
236 | {
|
---|
237 | if ((tmp & 1) && (*p_arg)->alignment > 8)
|
---|
238 | {
|
---|
239 | tmp++;
|
---|
240 | argp += sizeof(long long);
|
---|
241 | }
|
---|
242 | memcpy(argp, *p_argv, z);
|
---|
243 | z = 2 * sizeof(long long);
|
---|
244 | tmp += 2;
|
---|
245 | }
|
---|
246 | p_argv++;
|
---|
247 | argp += z;
|
---|
248 | }
|
---|
249 |
|
---|
250 | return ret;
|
---|
251 | }
|
---|
252 |
|
---|
253 | /* Perform machine dependent cif processing */
|
---|
254 | ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
|
---|
255 | {
|
---|
256 | int wordsize;
|
---|
257 |
|
---|
258 | if (cif->abi != FFI_V9)
|
---|
259 | {
|
---|
260 | wordsize = 4;
|
---|
261 |
|
---|
262 | /* If we are returning a struct, this will already have been added.
|
---|
263 | Otherwise we need to add it because it's always got to be there! */
|
---|
264 |
|
---|
265 | if (cif->rtype->type != FFI_TYPE_STRUCT)
|
---|
266 | cif->bytes += wordsize;
|
---|
267 |
|
---|
268 | /* sparc call frames require that space is allocated for 6 args,
|
---|
269 | even if they aren't used. Make that space if necessary. */
|
---|
270 |
|
---|
271 | if (cif->bytes < 4*6+4)
|
---|
272 | cif->bytes = 4*6+4;
|
---|
273 | }
|
---|
274 | else
|
---|
275 | {
|
---|
276 | wordsize = 8;
|
---|
277 |
|
---|
278 | /* sparc call frames require that space is allocated for 6 args,
|
---|
279 | even if they aren't used. Make that space if necessary. */
|
---|
280 |
|
---|
281 | if (cif->bytes < 8*6)
|
---|
282 | cif->bytes = 8*6;
|
---|
283 | }
|
---|
284 |
|
---|
285 | /* Adjust cif->bytes. to include 16 words for the window save area,
|
---|
286 | and maybe the struct/union return pointer area, */
|
---|
287 |
|
---|
288 | cif->bytes += 16 * wordsize;
|
---|
289 |
|
---|
290 | /* The stack must be 2 word aligned, so round bytes up
|
---|
291 | appropriately. */
|
---|
292 |
|
---|
293 | cif->bytes = ALIGN(cif->bytes, 2 * wordsize);
|
---|
294 |
|
---|
295 | /* Set the return type flag */
|
---|
296 | switch (cif->rtype->type)
|
---|
297 | {
|
---|
298 | case FFI_TYPE_VOID:
|
---|
299 | case FFI_TYPE_FLOAT:
|
---|
300 | case FFI_TYPE_DOUBLE:
|
---|
301 | #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
---|
302 | case FFI_TYPE_LONGDOUBLE:
|
---|
303 | #endif
|
---|
304 | cif->flags = cif->rtype->type;
|
---|
305 | break;
|
---|
306 |
|
---|
307 | case FFI_TYPE_STRUCT:
|
---|
308 | if (cif->abi == FFI_V9 && cif->rtype->size > 32)
|
---|
309 | cif->flags = FFI_TYPE_VOID;
|
---|
310 | else
|
---|
311 | cif->flags = FFI_TYPE_STRUCT;
|
---|
312 | break;
|
---|
313 |
|
---|
314 | case FFI_TYPE_SINT64:
|
---|
315 | case FFI_TYPE_UINT64:
|
---|
316 | if (cif->abi != FFI_V9)
|
---|
317 | {
|
---|
318 | cif->flags = FFI_TYPE_SINT64;
|
---|
319 | break;
|
---|
320 | }
|
---|
321 | /* FALLTHROUGH */
|
---|
322 | default:
|
---|
323 | cif->flags = FFI_TYPE_INT;
|
---|
324 | break;
|
---|
325 | }
|
---|
326 | return FFI_OK;
|
---|
327 | }
|
---|
328 |
|
---|
329 | int ffi_V9_return_struct(ffi_type *arg, int off, char *ret, char *intg, char *flt)
|
---|
330 | {
|
---|
331 | ffi_type **ptr = &arg->elements[0];
|
---|
332 |
|
---|
333 | while (*ptr != NULL)
|
---|
334 | {
|
---|
335 | if (off & ((*ptr)->alignment - 1))
|
---|
336 | off = ALIGN(off, (*ptr)->alignment);
|
---|
337 |
|
---|
338 | switch ((*ptr)->type)
|
---|
339 | {
|
---|
340 | case FFI_TYPE_STRUCT:
|
---|
341 | off = ffi_V9_return_struct(*ptr, off, ret, intg, flt);
|
---|
342 | break;
|
---|
343 | case FFI_TYPE_FLOAT:
|
---|
344 | case FFI_TYPE_DOUBLE:
|
---|
345 | #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
---|
346 | case FFI_TYPE_LONGDOUBLE:
|
---|
347 | #endif
|
---|
348 | memcpy(ret + off, flt + off, (*ptr)->size);
|
---|
349 | off += (*ptr)->size;
|
---|
350 | break;
|
---|
351 | default:
|
---|
352 | memcpy(ret + off, intg + off, (*ptr)->size);
|
---|
353 | off += (*ptr)->size;
|
---|
354 | break;
|
---|
355 | }
|
---|
356 | ptr++;
|
---|
357 | }
|
---|
358 | return off;
|
---|
359 | }
|
---|
360 |
|
---|
361 | extern int ffi_call_V8(void *, extended_cif *, unsigned,
|
---|
362 | unsigned, unsigned *, void (*fn)());
|
---|
363 | extern int ffi_call_V9(void *, extended_cif *, unsigned,
|
---|
364 | unsigned, unsigned *, void (*fn)());
|
---|
365 |
|
---|
366 | void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue)
|
---|
367 | {
|
---|
368 | extended_cif ecif;
|
---|
369 | void *rval = rvalue;
|
---|
370 |
|
---|
371 | ecif.cif = cif;
|
---|
372 | ecif.avalue = avalue;
|
---|
373 |
|
---|
374 | /* If the return value is a struct and we don't have a return */
|
---|
375 | /* value address then we need to make one */
|
---|
376 |
|
---|
377 | ecif.rvalue = rvalue;
|
---|
378 | if (cif->rtype->type == FFI_TYPE_STRUCT)
|
---|
379 | {
|
---|
380 | if (cif->rtype->size <= 32)
|
---|
381 | rval = alloca(64);
|
---|
382 | else
|
---|
383 | {
|
---|
384 | rval = NULL;
|
---|
385 | if (rvalue == NULL)
|
---|
386 | ecif.rvalue = alloca(cif->rtype->size);
|
---|
387 | }
|
---|
388 | }
|
---|
389 |
|
---|
390 | switch (cif->abi)
|
---|
391 | {
|
---|
392 | case FFI_V8:
|
---|
393 | #ifdef SPARC64
|
---|
394 | /* We don't yet support calling 32bit code from 64bit */
|
---|
395 | FFI_ASSERT(0);
|
---|
396 | #else
|
---|
397 | ffi_call_V8(ffi_prep_args_v8, &ecif, cif->bytes,
|
---|
398 | cif->flags, rvalue, fn);
|
---|
399 | #endif
|
---|
400 | break;
|
---|
401 | case FFI_V9:
|
---|
402 | #ifdef SPARC64
|
---|
403 | ffi_call_V9(ffi_prep_args_v9, &ecif, cif->bytes,
|
---|
404 | cif->flags, rval, fn);
|
---|
405 | if (rvalue && rval && cif->rtype->type == FFI_TYPE_STRUCT)
|
---|
406 | ffi_V9_return_struct(cif->rtype, 0, (char *)rvalue, (char *)rval, ((char *)rval)+32);
|
---|
407 | #else
|
---|
408 | /* And vice versa */
|
---|
409 | FFI_ASSERT(0);
|
---|
410 | #endif
|
---|
411 | break;
|
---|
412 | default:
|
---|
413 | FFI_ASSERT(0);
|
---|
414 | break;
|
---|
415 | }
|
---|
416 |
|
---|
417 | }
|
---|
418 |
|
---|
419 | ffi_status
|
---|
420 | ffi_prep_closure (ffi_closure* closure,
|
---|
421 | ffi_cif* cif,
|
---|
422 | void (*fun)(ffi_cif*, void*, void**, void*),
|
---|
423 | void *user_data)
|
---|
424 | {
|
---|
425 | unsigned int *tramp = (unsigned int *) &closure->tramp[0];
|
---|
426 | unsigned long fn;
|
---|
427 | unsigned long ctx = (unsigned long) closure;
|
---|
428 |
|
---|
429 | #ifdef SPARC64
|
---|
430 | /* Trampoline address is equal to the closure address. We take advantage
|
---|
431 | of that to reduce the trampoline size by 8 bytes. */
|
---|
432 | FFI_ASSERT (cif->abi == FFI_V9);
|
---|
433 | fn = (unsigned long) ffi_closure_v9;
|
---|
434 | tramp[0] = 0x83414000; /* rd %pc, %g1 */
|
---|
435 | tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */
|
---|
436 | tramp[2] = 0x81c14000; /* jmp %g5 */
|
---|
437 | tramp[3] = 0x01000000; /* nop */
|
---|
438 | *((unsigned long *) &tramp[4]) = fn;
|
---|
439 | #else
|
---|
440 | FFI_ASSERT (cif->abi == FFI_V8);
|
---|
441 | fn = (unsigned long) ffi_closure_v8;
|
---|
442 | tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */
|
---|
443 | tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */
|
---|
444 | tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */
|
---|
445 | tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */
|
---|
446 | #endif
|
---|
447 |
|
---|
448 | closure->cif = cif;
|
---|
449 | closure->fun = fun;
|
---|
450 | closure->user_data = user_data;
|
---|
451 |
|
---|
452 | /* Flush the Icache. FIXME: alignment isn't certain, assume 8 bytes */
|
---|
453 | #ifdef SPARC64
|
---|
454 | asm volatile ("flush %0" : : "r" (closure) : "memory");
|
---|
455 | asm volatile ("flush %0" : : "r" (((char *) closure) + 8) : "memory");
|
---|
456 | #else
|
---|
457 | asm volatile ("iflush %0" : : "r" (closure) : "memory");
|
---|
458 | asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory");
|
---|
459 | #endif
|
---|
460 |
|
---|
461 | return FFI_OK;
|
---|
462 | }
|
---|
463 |
|
---|
464 | int
|
---|
465 | ffi_closure_sparc_inner(ffi_closure *closure,
|
---|
466 | void *rvalue, unsigned long *gpr, double *fpr)
|
---|
467 | {
|
---|
468 | ffi_cif *cif;
|
---|
469 | void **avalue;
|
---|
470 | ffi_type **arg_types;
|
---|
471 | int i, avn, argn;
|
---|
472 |
|
---|
473 | cif = closure->cif;
|
---|
474 | avalue = alloca(cif->nargs * sizeof(void *));
|
---|
475 |
|
---|
476 | argn = 0;
|
---|
477 |
|
---|
478 | /* Copy the caller's structure return address to that the closure
|
---|
479 | returns the data directly to the caller. */
|
---|
480 | if (cif->flags == FFI_TYPE_STRUCT)
|
---|
481 | {
|
---|
482 | rvalue = (void *) gpr[0];
|
---|
483 | argn = 1;
|
---|
484 | }
|
---|
485 |
|
---|
486 | i = 0;
|
---|
487 | avn = cif->nargs;
|
---|
488 | arg_types = cif->arg_types;
|
---|
489 |
|
---|
490 | /* Grab the addresses of the arguments from the stack frame. */
|
---|
491 | while (i < avn)
|
---|
492 | {
|
---|
493 | /* Assume big-endian. FIXME */
|
---|
494 | argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG;
|
---|
495 |
|
---|
496 | #ifdef SPARC64
|
---|
497 | if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT
|
---|
498 | || arg_types[i]->type == FFI_TYPE_DOUBLE
|
---|
499 | #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
|
---|
500 | || arg_types[i]->type == FFI_TYPE_LONGDOUBLE
|
---|
501 | #endif
|
---|
502 | ))
|
---|
503 | avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size;
|
---|
504 | else
|
---|
505 | #endif
|
---|
506 | avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size;
|
---|
507 | i++;
|
---|
508 | }
|
---|
509 |
|
---|
510 | /* Invoke the closure. */
|
---|
511 | (closure->fun) (cif, rvalue, avalue, closure->user_data);
|
---|
512 |
|
---|
513 | /* Tell ffi_closure_sparc how to perform return type promotions. */
|
---|
514 | return cif->rtype->type;
|
---|
515 | }
|
---|