ffi 1.9.21 → 1.9.22
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ffi might be problematic. Click here for more details.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +3 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +22 -0
- data/.gitmodules +3 -0
- data/.travis.yml +52 -0
- data/.yardopts +5 -0
- data/Gemfile +15 -0
- data/{spec/ffi/LICENSE.SPECS → LICENSE.SPECS} +1 -1
- data/README.md +1 -1
- data/Rakefile +28 -3
- data/appveyor.yml +22 -0
- data/ext/ffi_c/Call.c +1 -22
- data/ext/ffi_c/Call.h +0 -9
- data/ext/ffi_c/Closure.c +54 -0
- data/ext/ffi_c/{ClosurePool.h → Closure.h} +13 -23
- data/ext/ffi_c/Function.c +16 -25
- data/ext/ffi_c/Function.h +1 -2
- data/ext/ffi_c/FunctionInfo.c +0 -4
- data/ext/ffi_c/MethodHandle.c +33 -268
- data/ext/ffi_c/extconf.rb +3 -3
- data/ext/ffi_c/ffi.c +2 -2
- data/ext/ffi_c/libffi.bsd.mk +3 -3
- data/ext/ffi_c/libffi.darwin.mk +1 -1
- data/ext/ffi_c/libffi.gnu.mk +1 -1
- data/ext/ffi_c/libffi.mk +2 -2
- data/ext/ffi_c/libffi.vc.mk +1 -1
- data/ext/ffi_c/libffi.vc64.mk +1 -1
- data/ext/ffi_c/libffi/.appveyor.yml +48 -0
- data/ext/ffi_c/libffi/.gitignore +36 -0
- data/ext/ffi_c/libffi/.travis.yml +30 -0
- data/ext/ffi_c/libffi/.travis/install.sh +14 -0
- data/ext/ffi_c/libffi/Makefile.am +5 -3
- data/ext/ffi_c/libffi/acinclude.m4 +6 -0
- data/ext/ffi_c/libffi/autogen.sh +1 -1
- data/ext/ffi_c/libffi/config.guess +1466 -0
- data/ext/ffi_c/libffi/config.sub +1836 -0
- data/ext/ffi_c/libffi/configure.ac +2 -2
- data/ext/ffi_c/libffi/configure.host +15 -3
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +11 -15
- data/ext/ffi_c/libffi/include/ffi.h.in +6 -1
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +465 -59
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +33 -10
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +2 -2
- data/ext/ffi_c/libffi/src/arm/ffi.c +12 -1
- data/ext/ffi_c/libffi/src/arm/sysv.S +1 -1
- data/ext/ffi_c/libffi/src/closures.c +143 -97
- data/ext/ffi_c/libffi/src/ia64/unix.S +2 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +8 -0
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +1 -1
- data/ext/ffi_c/libffi/src/mips/n32.S +2 -0
- data/ext/ffi_c/libffi/src/powerpc/aix.S +239 -1
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +250 -3
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +86 -5
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +3 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +3 -1
- data/ext/ffi_c/libffi/src/x86/ffi64.c +26 -5
- data/ext/ffi_c/libffi/src/x86/sysv.S +2 -2
- data/ext/ffi_c/libffi/src/x86/unix64.S +1 -1
- data/ext/ffi_c/libffi/src/x86/win64.S +1 -1
- data/ext/ffi_c/libffi/testsuite/Makefile.am +2 -1
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +2 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3float.c +95 -0
- data/ffi.gemspec +14 -1
- data/lib/ffi/library.rb +1 -1
- data/lib/ffi/version.rb +1 -1
- data/samples/getlogin.rb +8 -0
- data/samples/getpid.rb +8 -0
- data/samples/gettimeofday.rb +18 -0
- data/samples/hello.rb +7 -0
- data/samples/inotify.rb +60 -0
- data/samples/pty.rb +76 -0
- data/samples/qsort.rb +21 -0
- data/samples/sample_helper.rb +6 -0
- metadata +59 -81
- metadata.gz.sig +0 -0
- data/ext/ffi_c/ClosurePool.c +0 -283
- data/gen/Rakefile +0 -30
- data/libtest/Benchmark.c +0 -52
- data/libtest/BoolTest.c +0 -34
- data/libtest/BufferTest.c +0 -31
- data/libtest/ClosureTest.c +0 -205
- data/libtest/EnumTest.c +0 -51
- data/libtest/FunctionTest.c +0 -70
- data/libtest/GNUmakefile +0 -149
- data/libtest/GlobalVariable.c +0 -62
- data/libtest/LastErrorTest.c +0 -21
- data/libtest/NumberTest.c +0 -132
- data/libtest/PointerTest.c +0 -63
- data/libtest/ReferenceTest.c +0 -23
- data/libtest/StringTest.c +0 -34
- data/libtest/StructTest.c +0 -243
- data/libtest/UnionTest.c +0 -43
- data/libtest/VariadicTest.c +0 -99
- data/spec/ffi/async_callback_spec.rb +0 -35
- data/spec/ffi/bitmask_spec.rb +0 -575
- data/spec/ffi/bool_spec.rb +0 -32
- data/spec/ffi/buffer_spec.rb +0 -279
- data/spec/ffi/callback_spec.rb +0 -773
- data/spec/ffi/custom_param_type.rb +0 -37
- data/spec/ffi/custom_type_spec.rb +0 -74
- data/spec/ffi/dup_spec.rb +0 -52
- data/spec/ffi/enum_spec.rb +0 -423
- data/spec/ffi/errno_spec.rb +0 -20
- data/spec/ffi/ffi_spec.rb +0 -28
- data/spec/ffi/fixtures/Benchmark.c +0 -52
- data/spec/ffi/fixtures/BitmaskTest.c +0 -51
- data/spec/ffi/fixtures/BoolTest.c +0 -34
- data/spec/ffi/fixtures/BufferTest.c +0 -31
- data/spec/ffi/fixtures/ClosureTest.c +0 -205
- data/spec/ffi/fixtures/EnumTest.c +0 -51
- data/spec/ffi/fixtures/FunctionTest.c +0 -142
- data/spec/ffi/fixtures/GNUmakefile +0 -149
- data/spec/ffi/fixtures/GlobalVariable.c +0 -62
- data/spec/ffi/fixtures/LastErrorTest.c +0 -21
- data/spec/ffi/fixtures/NumberTest.c +0 -132
- data/spec/ffi/fixtures/PipeHelper.h +0 -21
- data/spec/ffi/fixtures/PipeHelperPosix.c +0 -41
- data/spec/ffi/fixtures/PipeHelperWindows.c +0 -72
- data/spec/ffi/fixtures/PointerTest.c +0 -63
- data/spec/ffi/fixtures/ReferenceTest.c +0 -23
- data/spec/ffi/fixtures/StringTest.c +0 -34
- data/spec/ffi/fixtures/StructTest.c +0 -243
- data/spec/ffi/fixtures/UnionTest.c +0 -43
- data/spec/ffi/fixtures/VariadicTest.c +0 -99
- data/spec/ffi/fixtures/classes.rb +0 -438
- data/spec/ffi/function_spec.rb +0 -97
- data/spec/ffi/io_spec.rb +0 -16
- data/spec/ffi/library_spec.rb +0 -286
- data/spec/ffi/long_double.rb +0 -30
- data/spec/ffi/managed_struct_spec.rb +0 -68
- data/spec/ffi/memorypointer_spec.rb +0 -78
- data/spec/ffi/number_spec.rb +0 -247
- data/spec/ffi/platform_spec.rb +0 -114
- data/spec/ffi/pointer_spec.rb +0 -285
- data/spec/ffi/rbx/attach_function_spec.rb +0 -34
- data/spec/ffi/rbx/memory_pointer_spec.rb +0 -198
- data/spec/ffi/rbx/spec_helper.rb +0 -6
- data/spec/ffi/rbx/struct_spec.rb +0 -18
- data/spec/ffi/spec_helper.rb +0 -93
- data/spec/ffi/string_spec.rb +0 -118
- data/spec/ffi/strptr_spec.rb +0 -50
- data/spec/ffi/struct_by_ref_spec.rb +0 -43
- data/spec/ffi/struct_callback_spec.rb +0 -69
- data/spec/ffi/struct_initialize_spec.rb +0 -35
- data/spec/ffi/struct_packed_spec.rb +0 -50
- data/spec/ffi/struct_spec.rb +0 -882
- data/spec/ffi/typedef_spec.rb +0 -91
- data/spec/ffi/union_spec.rb +0 -67
- data/spec/ffi/variadic_spec.rb +0 -132
- data/spec/spec.opts +0 -4
@@ -529,6 +529,7 @@ ffi_closure_unix:
|
|
529
529
|
data8 @pcrel(.Lst_int64) // FFI_TYPE_SINT64
|
530
530
|
data8 @pcrel(.Lst_void) // FFI_TYPE_STRUCT
|
531
531
|
data8 @pcrel(.Lst_int64) // FFI_TYPE_POINTER
|
532
|
+
data8 @pcrel(.Lst_void) // FFI_TYPE_COMPLEX (not implemented)
|
532
533
|
data8 @pcrel(.Lst_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT
|
533
534
|
data8 @pcrel(.Lst_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
|
534
535
|
data8 @pcrel(.Lst_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
|
@@ -550,6 +551,7 @@ ffi_closure_unix:
|
|
550
551
|
data8 @pcrel(.Lld_int) // FFI_TYPE_SINT64
|
551
552
|
data8 @pcrel(.Lld_void) // FFI_TYPE_STRUCT
|
552
553
|
data8 @pcrel(.Lld_int) // FFI_TYPE_POINTER
|
554
|
+
data8 @pcrel(.Lld_void) // FFI_TYPE_COMPLEX (not implemented)
|
553
555
|
data8 @pcrel(.Lld_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT
|
554
556
|
data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
|
555
557
|
data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
|
@@ -715,7 +715,11 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
|
715
715
|
/* lui $12,high(codeloc) */
|
716
716
|
tramp[2] = 0x3c0c0000 | ((unsigned)codeloc >> 16);
|
717
717
|
/* jr $25 */
|
718
|
+
#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
|
718
719
|
tramp[3] = 0x03200008;
|
720
|
+
#else
|
721
|
+
tramp[3] = 0x03200009;
|
722
|
+
#endif
|
719
723
|
/* ori $12,low(codeloc) */
|
720
724
|
tramp[4] = 0x358c0000 | ((unsigned)codeloc & 0xffff);
|
721
725
|
#else
|
@@ -743,7 +747,11 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
|
743
747
|
/* ori $25,low(fn) */
|
744
748
|
tramp[10] = 0x37390000 | ((unsigned long)fn & 0xffff);
|
745
749
|
/* jr $25 */
|
750
|
+
#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
|
746
751
|
tramp[11] = 0x03200008;
|
752
|
+
#else
|
753
|
+
tramp[11] = 0x03200009;
|
754
|
+
#endif
|
747
755
|
/* ori $12,low(codeloc) */
|
748
756
|
tramp[12] = 0x358c0000 | ((unsigned long)codeloc & 0xffff);
|
749
757
|
|
@@ -106,6 +106,10 @@ ffi_call_AIX:
|
|
106
106
|
.llong .ffi_call_AIX, TOC[tc0], 0
|
107
107
|
.csect .text[PR]
|
108
108
|
.ffi_call_AIX:
|
109
|
+
.function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0
|
110
|
+
.bf __LINE__
|
111
|
+
.line 1
|
112
|
+
LFB..0:
|
109
113
|
/* Save registers we use. */
|
110
114
|
mflr r0
|
111
115
|
|
@@ -115,8 +119,10 @@ ffi_call_AIX:
|
|
115
119
|
std r31, -8(r1)
|
116
120
|
|
117
121
|
std r0, 16(r1)
|
122
|
+
LCFI..0:
|
118
123
|
mr r28, r1 /* our AP. */
|
119
124
|
stdux r1, r1, r4
|
125
|
+
LCFI..1:
|
120
126
|
|
121
127
|
/* Save arguments over call... */
|
122
128
|
mr r31, r5 /* flags, */
|
@@ -202,12 +208,16 @@ L(fp_return_value):
|
|
202
208
|
L(float_return_value):
|
203
209
|
stfs f1, 0(r30)
|
204
210
|
b L(done_return_value)
|
205
|
-
|
211
|
+
LFE..0:
|
206
212
|
#else /* ! __64BIT__ */
|
207
213
|
|
208
214
|
.long .ffi_call_AIX, TOC[tc0], 0
|
209
215
|
.csect .text[PR]
|
210
216
|
.ffi_call_AIX:
|
217
|
+
.function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0
|
218
|
+
.bf __LINE__
|
219
|
+
.line 1
|
220
|
+
LFB..0:
|
211
221
|
/* Save registers we use. */
|
212
222
|
mflr r0
|
213
223
|
|
@@ -217,8 +227,10 @@ L(float_return_value):
|
|
217
227
|
stw r31, -4(r1)
|
218
228
|
|
219
229
|
stw r0, 8(r1)
|
230
|
+
LCFI..0:
|
220
231
|
mr r28, r1 /* out AP. */
|
221
232
|
stwux r1, r1, r4
|
233
|
+
LCFI..1:
|
222
234
|
|
223
235
|
/* Save arguments over call... */
|
224
236
|
mr r31, r5 /* flags, */
|
@@ -304,11 +316,144 @@ L(fp_return_value):
|
|
304
316
|
L(float_return_value):
|
305
317
|
stfs f1, 0(r30)
|
306
318
|
b L(done_return_value)
|
319
|
+
LFE..0:
|
307
320
|
#endif
|
321
|
+
.ef __LINE__
|
308
322
|
.long 0
|
309
323
|
.byte 0,0,0,1,128,4,0,0
|
310
324
|
/* END(ffi_call_AIX) */
|
311
325
|
|
326
|
+
/* void ffi_call_go_AIX(extended_cif *ecif, unsigned long bytes,
|
327
|
+
* unsigned int flags, unsigned int *rvalue,
|
328
|
+
* void (*fn)(),
|
329
|
+
* void (*prep_args)(extended_cif*, unsigned *const),
|
330
|
+
* void *closure);
|
331
|
+
* r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args, r9=closure
|
332
|
+
*/
|
333
|
+
|
334
|
+
.csect .text[PR]
|
335
|
+
.align 2
|
336
|
+
.globl ffi_call_go_AIX
|
337
|
+
.globl .ffi_call_go_AIX
|
338
|
+
.csect ffi_call_go_AIX[DS]
|
339
|
+
ffi_call_go_AIX:
|
340
|
+
#ifdef __64BIT__
|
341
|
+
.llong .ffi_call_go_AIX, TOC[tc0], 0
|
342
|
+
.csect .text[PR]
|
343
|
+
.ffi_call_go_AIX:
|
344
|
+
.function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1
|
345
|
+
.bf __LINE__
|
346
|
+
.line 1
|
347
|
+
LFB..1:
|
348
|
+
/* Save registers we use. */
|
349
|
+
mflr r0
|
350
|
+
|
351
|
+
std r28,-32(r1)
|
352
|
+
std r29,-24(r1)
|
353
|
+
std r30,-16(r1)
|
354
|
+
std r31, -8(r1)
|
355
|
+
|
356
|
+
std r9, 8(r1) /* closure, saved in cr field. */
|
357
|
+
std r0, 16(r1)
|
358
|
+
LCFI..2:
|
359
|
+
mr r28, r1 /* our AP. */
|
360
|
+
stdux r1, r1, r4
|
361
|
+
LCFI..3:
|
362
|
+
|
363
|
+
/* Save arguments over call... */
|
364
|
+
mr r31, r5 /* flags, */
|
365
|
+
mr r30, r6 /* rvalue, */
|
366
|
+
mr r29, r7 /* function address, */
|
367
|
+
std r2, 40(r1)
|
368
|
+
|
369
|
+
/* Call ffi_prep_args. */
|
370
|
+
mr r4, r1
|
371
|
+
bl .ffi_prep_args
|
372
|
+
nop
|
373
|
+
|
374
|
+
/* Now do the call. */
|
375
|
+
ld r0, 0(r29)
|
376
|
+
ld r2, 8(r29)
|
377
|
+
ld r11, 8(r28) /* closure */
|
378
|
+
/* Set up cr1 with bits 4-7 of the flags. */
|
379
|
+
mtcrf 0x40, r31
|
380
|
+
mtctr r0
|
381
|
+
/* Load all those argument registers. */
|
382
|
+
/* We have set up a nice stack frame, just load it into registers. */
|
383
|
+
ld r3, 40+(1*8)(r1)
|
384
|
+
ld r4, 40+(2*8)(r1)
|
385
|
+
ld r5, 40+(3*8)(r1)
|
386
|
+
ld r6, 40+(4*8)(r1)
|
387
|
+
nop
|
388
|
+
ld r7, 40+(5*8)(r1)
|
389
|
+
ld r8, 40+(6*8)(r1)
|
390
|
+
ld r9, 40+(7*8)(r1)
|
391
|
+
ld r10,40+(8*8)(r1)
|
392
|
+
|
393
|
+
b L1
|
394
|
+
LFE..1:
|
395
|
+
#else /* ! __64BIT__ */
|
396
|
+
|
397
|
+
.long .ffi_call_go_AIX, TOC[tc0], 0
|
398
|
+
.csect .text[PR]
|
399
|
+
.ffi_call_go_AIX:
|
400
|
+
.function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1
|
401
|
+
.bf __LINE__
|
402
|
+
.line 1
|
403
|
+
/* Save registers we use. */
|
404
|
+
LFB..1:
|
405
|
+
mflr r0
|
406
|
+
|
407
|
+
stw r28,-16(r1)
|
408
|
+
stw r29,-12(r1)
|
409
|
+
stw r30, -8(r1)
|
410
|
+
stw r31, -4(r1)
|
411
|
+
|
412
|
+
stw r9, 4(r1) /* closure, saved in cr field. */
|
413
|
+
stw r0, 8(r1)
|
414
|
+
LCFI..2:
|
415
|
+
mr r28, r1 /* out AP. */
|
416
|
+
stwux r1, r1, r4
|
417
|
+
LCFI..3:
|
418
|
+
|
419
|
+
/* Save arguments over call... */
|
420
|
+
mr r31, r5 /* flags, */
|
421
|
+
mr r30, r6 /* rvalue, */
|
422
|
+
mr r29, r7 /* function address, */
|
423
|
+
stw r2, 20(r1)
|
424
|
+
|
425
|
+
/* Call ffi_prep_args. */
|
426
|
+
mr r4, r1
|
427
|
+
bl .ffi_prep_args
|
428
|
+
nop
|
429
|
+
|
430
|
+
/* Now do the call. */
|
431
|
+
lwz r0, 0(r29)
|
432
|
+
lwz r2, 4(r29)
|
433
|
+
lwz r11, 4(r28) /* closure */
|
434
|
+
/* Set up cr1 with bits 4-7 of the flags. */
|
435
|
+
mtcrf 0x40, r31
|
436
|
+
mtctr r0
|
437
|
+
/* Load all those argument registers. */
|
438
|
+
/* We have set up a nice stack frame, just load it into registers. */
|
439
|
+
lwz r3, 20+(1*4)(r1)
|
440
|
+
lwz r4, 20+(2*4)(r1)
|
441
|
+
lwz r5, 20+(3*4)(r1)
|
442
|
+
lwz r6, 20+(4*4)(r1)
|
443
|
+
nop
|
444
|
+
lwz r7, 20+(5*4)(r1)
|
445
|
+
lwz r8, 20+(6*4)(r1)
|
446
|
+
lwz r9, 20+(7*4)(r1)
|
447
|
+
lwz r10,20+(8*4)(r1)
|
448
|
+
|
449
|
+
b L1
|
450
|
+
LFE..1:
|
451
|
+
#endif
|
452
|
+
.ef __LINE__
|
453
|
+
.long 0
|
454
|
+
.byte 0,0,0,1,128,4,0,0
|
455
|
+
/* END(ffi_call_go_AIX) */
|
456
|
+
|
312
457
|
.csect .text[PR]
|
313
458
|
.align 2
|
314
459
|
.globl ffi_call_DARWIN
|
@@ -326,3 +471,96 @@ ffi_call_DARWIN:
|
|
326
471
|
.long 0
|
327
472
|
.byte 0,0,0,0,0,0,0,0
|
328
473
|
/* END(ffi_call_DARWIN) */
|
474
|
+
|
475
|
+
/* EH frame stuff. */
|
476
|
+
|
477
|
+
#define LR_REGNO 0x41 /* Link Register (65), see rs6000.md */
|
478
|
+
#ifdef __64BIT__
|
479
|
+
#define PTRSIZE 8
|
480
|
+
#define LOG2_PTRSIZE 3
|
481
|
+
#define FDE_ENCODING 0x1c /* DW_EH_PE_pcrel|DW_EH_PE_sdata8 */
|
482
|
+
#define EH_DATA_ALIGN_FACT 0x78 /* LEB128 -8 */
|
483
|
+
#else
|
484
|
+
#define PTRSIZE 4
|
485
|
+
#define LOG2_PTRSIZE 2
|
486
|
+
#define FDE_ENCODING 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4 */
|
487
|
+
#define EH_DATA_ALIGN_FACT 0x7c /* LEB128 -4 */
|
488
|
+
#endif
|
489
|
+
.csect _unwind.ro_[RO],4
|
490
|
+
.align LOG2_PTRSIZE
|
491
|
+
.globl _GLOBAL__F_libffi_src_powerpc_aix
|
492
|
+
_GLOBAL__F_libffi_src_powerpc_aix:
|
493
|
+
Lframe..1:
|
494
|
+
.vbyte 4,LECIE..1-LSCIE..1 /* CIE Length */
|
495
|
+
LSCIE..1:
|
496
|
+
.vbyte 4,0 /* CIE Identifier Tag */
|
497
|
+
.byte 0x3 /* CIE Version */
|
498
|
+
.byte "zR" /* CIE Augmentation */
|
499
|
+
.byte 0
|
500
|
+
.byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */
|
501
|
+
.byte EH_DATA_ALIGN_FACT /* leb128 -4/-8; CIE Data Alignment Factor */
|
502
|
+
.byte 0x41 /* CIE RA Column */
|
503
|
+
.byte 0x1 /* uleb128 0x1; Augmentation size */
|
504
|
+
.byte FDE_ENCODING /* FDE Encoding (pcrel|sdata4/8) */
|
505
|
+
.byte 0xc /* DW_CFA_def_cfa */
|
506
|
+
.byte 0x1 /* uleb128 0x1; Register r1 */
|
507
|
+
.byte 0 /* uleb128 0x0; Offset 0 */
|
508
|
+
.align LOG2_PTRSIZE
|
509
|
+
LECIE..1:
|
510
|
+
LSFDE..1:
|
511
|
+
.vbyte 4,LEFDE..1-LASFDE..1 /* FDE Length */
|
512
|
+
LASFDE..1:
|
513
|
+
.vbyte 4,LASFDE..1-Lframe..1 /* FDE CIE offset */
|
514
|
+
.vbyte PTRSIZE,LFB..0-$ /* FDE initial location */
|
515
|
+
.vbyte PTRSIZE,LFE..0-LFB..0 /* FDE address range */
|
516
|
+
.byte 0 /* uleb128 0x0; Augmentation size */
|
517
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
518
|
+
.vbyte 4,LCFI..0-LFB..0
|
519
|
+
.byte 0x11 /* DW_CFA_def_offset_extended_sf */
|
520
|
+
.byte LR_REGNO /* uleb128 LR_REGNO; Register LR */
|
521
|
+
.byte 0x7e /* leb128 -2; Offset -2 (8/16) */
|
522
|
+
.byte 0x9f /* DW_CFA_offset Register r31 */
|
523
|
+
.byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */
|
524
|
+
.byte 0x9e /* DW_CFA_offset Register r30 */
|
525
|
+
.byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */
|
526
|
+
.byte 0x9d /* DW_CFA_offset Register r29 */
|
527
|
+
.byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */
|
528
|
+
.byte 0x9c /* DW_CFA_offset Register r28 */
|
529
|
+
.byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */
|
530
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
531
|
+
.vbyte 4,LCFI..1-LCFI..0
|
532
|
+
.byte 0xd /* DW_CFA_def_cfa_register */
|
533
|
+
.byte 0x1c /* uleb128 28; Register r28 */
|
534
|
+
.align LOG2_PTRSIZE
|
535
|
+
LEFDE..1:
|
536
|
+
LSFDE..2:
|
537
|
+
.vbyte 4,LEFDE..2-LASFDE..2 /* FDE Length */
|
538
|
+
LASFDE..2:
|
539
|
+
.vbyte 4,LASFDE..2-Lframe..1 /* FDE CIE offset */
|
540
|
+
.vbyte PTRSIZE,LFB..1-$ /* FDE initial location */
|
541
|
+
.vbyte PTRSIZE,LFE..1-LFB..1 /* FDE address range */
|
542
|
+
.byte 0 /* uleb128 0x0; Augmentation size */
|
543
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
544
|
+
.vbyte 4,LCFI..2-LFB..1
|
545
|
+
.byte 0x11 /* DW_CFA_def_offset_extended_sf */
|
546
|
+
.byte LR_REGNO /* uleb128 LR_REGNO; Register LR */
|
547
|
+
.byte 0x7e /* leb128 -2; Offset -2 (8/16) */
|
548
|
+
.byte 0x9f /* DW_CFA_offset Register r31 */
|
549
|
+
.byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */
|
550
|
+
.byte 0x9e /* DW_CFA_offset Register r30 */
|
551
|
+
.byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */
|
552
|
+
.byte 0x9d /* DW_CFA_offset Register r29 */
|
553
|
+
.byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */
|
554
|
+
.byte 0x9c /* DW_CFA_offset Register r28 */
|
555
|
+
.byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */
|
556
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
557
|
+
.vbyte 4,LCFI..3-LCFI..2
|
558
|
+
.byte 0xd /* DW_CFA_def_cfa_register */
|
559
|
+
.byte 0x1c /* uleb128 28; Register r28 */
|
560
|
+
.align LOG2_PTRSIZE
|
561
|
+
LEFDE..2:
|
562
|
+
.vbyte 4,0 /* End of FDEs */
|
563
|
+
|
564
|
+
.csect .text[PR]
|
565
|
+
.ref _GLOBAL__F_libffi_src_powerpc_aix /* Prevents garbage collection by AIX linker */
|
566
|
+
|
@@ -80,6 +80,7 @@
|
|
80
80
|
.set f21,21
|
81
81
|
|
82
82
|
.extern .ffi_closure_helper_DARWIN
|
83
|
+
.extern .ffi_go_closure_helper_DARWIN
|
83
84
|
|
84
85
|
#define LIBFFI_ASM
|
85
86
|
#define JUMPTARGET(name) name
|
@@ -101,6 +102,10 @@ ffi_closure_ASM:
|
|
101
102
|
.llong .ffi_closure_ASM, TOC[tc0], 0
|
102
103
|
.csect .text[PR]
|
103
104
|
.ffi_closure_ASM:
|
105
|
+
.function .ffi_closure_ASM,.ffi_closure_ASM,16,044,LFE..0-LFB..0
|
106
|
+
.bf __LINE__
|
107
|
+
.line 1
|
108
|
+
LFB..0:
|
104
109
|
/* we want to build up an area for the parameters passed */
|
105
110
|
/* in registers (both floating point and integer) */
|
106
111
|
|
@@ -117,8 +122,7 @@ ffi_closure_ASM:
|
|
117
122
|
std r9, 48+(6*8)(r1)
|
118
123
|
std r10, 48+(7*8)(r1)
|
119
124
|
std r0, 16(r1) /* save the return address */
|
120
|
-
|
121
|
-
|
125
|
+
LCFI..0:
|
122
126
|
/* 48 Bytes (Linkage Area) */
|
123
127
|
/* 64 Bytes (params) */
|
124
128
|
/* 16 Bytes (result) */
|
@@ -128,6 +132,7 @@ ffi_closure_ASM:
|
|
128
132
|
|
129
133
|
stdu r1, -240(r1) /* skip over caller save area
|
130
134
|
keep stack aligned to 16 */
|
135
|
+
LCFI..1:
|
131
136
|
|
132
137
|
/* next save fpr 1 to fpr 13 (aligned to 8) */
|
133
138
|
stfd f1, 128+(0*8)(r1)
|
@@ -161,6 +166,8 @@ ffi_closure_ASM:
|
|
161
166
|
bl .ffi_closure_helper_DARWIN
|
162
167
|
nop
|
163
168
|
|
169
|
+
.Ldoneclosure:
|
170
|
+
|
164
171
|
/* now r3 contains the return type */
|
165
172
|
/* so use it to look up in a table */
|
166
173
|
/* so we know how to deal with each type */
|
@@ -270,12 +277,17 @@ L..finish:
|
|
270
277
|
mtlr r0
|
271
278
|
addi r1, r1, 240
|
272
279
|
blr
|
280
|
+
LFE..0:
|
273
281
|
|
274
282
|
#else /* ! __64BIT__ */
|
275
283
|
|
276
284
|
.long .ffi_closure_ASM, TOC[tc0], 0
|
277
285
|
.csect .text[PR]
|
278
286
|
.ffi_closure_ASM:
|
287
|
+
.function .ffi_closure_ASM,.ffi_closure_ASM,16,044,LFE..0-LFB..0
|
288
|
+
.bf __LINE__
|
289
|
+
.line 1
|
290
|
+
LFB..0:
|
279
291
|
/* we want to build up an area for the parameters passed */
|
280
292
|
/* in registers (both floating point and integer) */
|
281
293
|
|
@@ -292,7 +304,7 @@ L..finish:
|
|
292
304
|
stw r9, 24+(6*4)(r1)
|
293
305
|
stw r10, 24+(7*4)(r1)
|
294
306
|
stw r0, 8(r1)
|
295
|
-
|
307
|
+
LCFI..0:
|
296
308
|
/* 24 Bytes (Linkage Area) */
|
297
309
|
/* 32 Bytes (params) */
|
298
310
|
/* 16 Bytes (result) */
|
@@ -301,6 +313,7 @@ L..finish:
|
|
301
313
|
|
302
314
|
stwu r1, -176(r1) /* skip over caller save area
|
303
315
|
keep stack aligned to 16 */
|
316
|
+
LCFI..1:
|
304
317
|
|
305
318
|
/* next save fpr 1 to fpr 13 (aligned to 8) */
|
306
319
|
stfd f1, 72+(0*8)(r1)
|
@@ -334,6 +347,8 @@ L..finish:
|
|
334
347
|
bl .ffi_closure_helper_DARWIN
|
335
348
|
nop
|
336
349
|
|
350
|
+
.Ldoneclosure:
|
351
|
+
|
337
352
|
/* now r3 contains the return type */
|
338
353
|
/* so use it to look up in a table */
|
339
354
|
/* so we know how to deal with each type */
|
@@ -443,5 +458,237 @@ L..60:
|
|
443
458
|
L..finish:
|
444
459
|
addi r1, r1, 176
|
445
460
|
blr
|
461
|
+
LFE..0:
|
446
462
|
#endif
|
463
|
+
.ef __LINE__
|
447
464
|
/* END(ffi_closure_ASM) */
|
465
|
+
|
466
|
+
|
467
|
+
.csect .text[PR]
|
468
|
+
.align 2
|
469
|
+
.globl ffi_go_closure_ASM
|
470
|
+
.globl .ffi_go_closure_ASM
|
471
|
+
.csect ffi_go_closure_ASM[DS]
|
472
|
+
ffi_go_closure_ASM:
|
473
|
+
#ifdef __64BIT__
|
474
|
+
.llong .ffi_go_closure_ASM, TOC[tc0], 0
|
475
|
+
.csect .text[PR]
|
476
|
+
.ffi_go_closure_ASM:
|
477
|
+
.function .ffi_go_closure_ASM,.ffi_go_closure_ASM,16,044,LFE..1-LFB..1
|
478
|
+
.bf __LINE__
|
479
|
+
.line 1
|
480
|
+
LFB..1:
|
481
|
+
/* we want to build up an area for the parameters passed */
|
482
|
+
/* in registers (both floating point and integer) */
|
483
|
+
|
484
|
+
/* we store gpr 3 to gpr 10 (aligned to 4)
|
485
|
+
in the parents outgoing area */
|
486
|
+
std r3, 48+(0*8)(r1)
|
487
|
+
std r4, 48+(1*8)(r1)
|
488
|
+
std r5, 48+(2*8)(r1)
|
489
|
+
std r6, 48+(3*8)(r1)
|
490
|
+
mflr r0
|
491
|
+
|
492
|
+
std r7, 48+(4*8)(r1)
|
493
|
+
std r8, 48+(5*8)(r1)
|
494
|
+
std r9, 48+(6*8)(r1)
|
495
|
+
std r10, 48+(7*8)(r1)
|
496
|
+
std r0, 16(r1) /* save the return address */
|
497
|
+
LCFI..2:
|
498
|
+
/* 48 Bytes (Linkage Area) */
|
499
|
+
/* 64 Bytes (params) */
|
500
|
+
/* 16 Bytes (result) */
|
501
|
+
/* 104 Bytes (13*8 from FPR) */
|
502
|
+
/* 8 Bytes (alignment) */
|
503
|
+
/* 240 Bytes */
|
504
|
+
|
505
|
+
stdu r1, -240(r1) /* skip over caller save area
|
506
|
+
keep stack aligned to 16 */
|
507
|
+
LCFI..3:
|
508
|
+
|
509
|
+
/* next save fpr 1 to fpr 13 (aligned to 8) */
|
510
|
+
stfd f1, 128+(0*8)(r1)
|
511
|
+
stfd f2, 128+(1*8)(r1)
|
512
|
+
stfd f3, 128+(2*8)(r1)
|
513
|
+
stfd f4, 128+(3*8)(r1)
|
514
|
+
stfd f5, 128+(4*8)(r1)
|
515
|
+
stfd f6, 128+(5*8)(r1)
|
516
|
+
stfd f7, 128+(6*8)(r1)
|
517
|
+
stfd f8, 128+(7*8)(r1)
|
518
|
+
stfd f9, 128+(8*8)(r1)
|
519
|
+
stfd f10, 128+(9*8)(r1)
|
520
|
+
stfd f11, 128+(10*8)(r1)
|
521
|
+
stfd f12, 128+(11*8)(r1)
|
522
|
+
stfd f13, 128+(12*8)(r1)
|
523
|
+
|
524
|
+
/* set up registers for the routine that actually does the work */
|
525
|
+
mr r3, r11 /* go closure */
|
526
|
+
|
527
|
+
/* now load up the pointer to the result storage */
|
528
|
+
addi r4, r1, 112
|
529
|
+
|
530
|
+
/* now load up the pointer to the saved gpr registers */
|
531
|
+
addi r5, r1, 288
|
532
|
+
|
533
|
+
/* now load up the pointer to the saved fpr registers */
|
534
|
+
addi r6, r1, 128
|
535
|
+
|
536
|
+
/* make the call */
|
537
|
+
bl .ffi_go_closure_helper_DARWIN
|
538
|
+
nop
|
539
|
+
|
540
|
+
b .Ldoneclosure
|
541
|
+
LFE..1:
|
542
|
+
|
543
|
+
#else /* ! __64BIT__ */
|
544
|
+
|
545
|
+
.long .ffi_go_closure_ASM, TOC[tc0], 0
|
546
|
+
.csect .text[PR]
|
547
|
+
.ffi_go_closure_ASM:
|
548
|
+
.function .ffi_go_closure_ASM,.ffi_go_closure_ASM,16,044,LFE..1-LFB..1
|
549
|
+
.bf __LINE__
|
550
|
+
.line 1
|
551
|
+
LFB..1:
|
552
|
+
/* we want to build up an area for the parameters passed */
|
553
|
+
/* in registers (both floating point and integer) */
|
554
|
+
|
555
|
+
/* we store gpr 3 to gpr 10 (aligned to 4)
|
556
|
+
in the parents outgoing area */
|
557
|
+
stw r3, 24+(0*4)(r1)
|
558
|
+
stw r4, 24+(1*4)(r1)
|
559
|
+
stw r5, 24+(2*4)(r1)
|
560
|
+
stw r6, 24+(3*4)(r1)
|
561
|
+
mflr r0
|
562
|
+
|
563
|
+
stw r7, 24+(4*4)(r1)
|
564
|
+
stw r8, 24+(5*4)(r1)
|
565
|
+
stw r9, 24+(6*4)(r1)
|
566
|
+
stw r10, 24+(7*4)(r1)
|
567
|
+
stw r0, 8(r1)
|
568
|
+
LCFI..2:
|
569
|
+
/* 24 Bytes (Linkage Area) */
|
570
|
+
/* 32 Bytes (params) */
|
571
|
+
/* 16 Bytes (result) */
|
572
|
+
/* 104 Bytes (13*8 from FPR) */
|
573
|
+
/* 176 Bytes */
|
574
|
+
|
575
|
+
stwu r1, -176(r1) /* skip over caller save area
|
576
|
+
keep stack aligned to 16 */
|
577
|
+
LCFI..3:
|
578
|
+
|
579
|
+
/* next save fpr 1 to fpr 13 (aligned to 8) */
|
580
|
+
stfd f1, 72+(0*8)(r1)
|
581
|
+
stfd f2, 72+(1*8)(r1)
|
582
|
+
stfd f3, 72+(2*8)(r1)
|
583
|
+
stfd f4, 72+(3*8)(r1)
|
584
|
+
stfd f5, 72+(4*8)(r1)
|
585
|
+
stfd f6, 72+(5*8)(r1)
|
586
|
+
stfd f7, 72+(6*8)(r1)
|
587
|
+
stfd f8, 72+(7*8)(r1)
|
588
|
+
stfd f9, 72+(8*8)(r1)
|
589
|
+
stfd f10, 72+(9*8)(r1)
|
590
|
+
stfd f11, 72+(10*8)(r1)
|
591
|
+
stfd f12, 72+(11*8)(r1)
|
592
|
+
stfd f13, 72+(12*8)(r1)
|
593
|
+
|
594
|
+
/* set up registers for the routine that actually does the work */
|
595
|
+
mr r3, 11 /* go closure */
|
596
|
+
|
597
|
+
/* now load up the pointer to the result storage */
|
598
|
+
addi r4, r1, 56
|
599
|
+
|
600
|
+
/* now load up the pointer to the saved gpr registers */
|
601
|
+
addi r5, r1, 200
|
602
|
+
|
603
|
+
/* now load up the pointer to the saved fpr registers */
|
604
|
+
addi r6, r1, 72
|
605
|
+
|
606
|
+
/* make the call */
|
607
|
+
bl .ffi_go_closure_helper_DARWIN
|
608
|
+
nop
|
609
|
+
|
610
|
+
b .Ldoneclosure
|
611
|
+
LFE..1:
|
612
|
+
#endif
|
613
|
+
.ef __LINE__
|
614
|
+
/* END(ffi_go_closure_ASM) */
|
615
|
+
|
616
|
+
/* EH frame stuff. */
|
617
|
+
|
618
|
+
#define LR_REGNO 0x41 /* Link Register (65), see rs6000.md */
|
619
|
+
#ifdef __64BIT__
|
620
|
+
#define PTRSIZE 8
|
621
|
+
#define LOG2_PTRSIZE 3
|
622
|
+
#define CFA_OFFSET 0xf0,0x01 /* LEB128 240 */
|
623
|
+
#define FDE_ENCODING 0x1c /* DW_EH_PE_pcrel|DW_EH_PE_sdata8 */
|
624
|
+
#define EH_DATA_ALIGN_FACT 0x78 /* LEB128 -8 */
|
625
|
+
#else
|
626
|
+
#define PTRSIZE 4
|
627
|
+
#define LOG2_PTRSIZE 2
|
628
|
+
#define CFA_OFFSET 0xb0,0x01 /* LEB128 176 */
|
629
|
+
#define FDE_ENCODING 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4 */
|
630
|
+
#define EH_DATA_ALIGN_FACT 0x7c /* LEB128 -4 */
|
631
|
+
#endif
|
632
|
+
|
633
|
+
.csect _unwind.ro_[RO],4
|
634
|
+
.align LOG2_PTRSIZE
|
635
|
+
.globl _GLOBAL__F_libffi_src_powerpc_aix_closure
|
636
|
+
_GLOBAL__F_libffi_src_powerpc_aix_closure:
|
637
|
+
Lframe..1:
|
638
|
+
.vbyte 4,LECIE..1-LSCIE..1 /* CIE Length */
|
639
|
+
LSCIE..1:
|
640
|
+
.vbyte 4,0 /* CIE Identifier Tag */
|
641
|
+
.byte 0x3 /* CIE Version */
|
642
|
+
.byte "zR" /* CIE Augmentation */
|
643
|
+
.byte 0
|
644
|
+
.byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */
|
645
|
+
.byte EH_DATA_ALIGN_FACT /* leb128 -4/-8; CIE Data Alignment Factor */
|
646
|
+
.byte LR_REGNO /* CIE RA Column */
|
647
|
+
.byte 0x1 /* uleb128 0x1; Augmentation size */
|
648
|
+
.byte FDE_ENCODING /* FDE Encoding (pcrel|sdata4/8) */
|
649
|
+
.byte 0xc /* DW_CFA_def_cfa */
|
650
|
+
.byte 0x1 /* uleb128 0x1; Register r1 */
|
651
|
+
.byte 0 /* uleb128 0x0; Offset 0 */
|
652
|
+
.align LOG2_PTRSIZE
|
653
|
+
LECIE..1:
|
654
|
+
LSFDE..1:
|
655
|
+
.vbyte 4,LEFDE..1-LASFDE..1 /* FDE Length */
|
656
|
+
LASFDE..1:
|
657
|
+
.vbyte 4,LASFDE..1-Lframe..1 /* FDE CIE offset */
|
658
|
+
.vbyte PTRSIZE,LFB..0-$ /* FDE initial location */
|
659
|
+
.vbyte PTRSIZE,LFE..0-LFB..0 /* FDE address range */
|
660
|
+
.byte 0 /* uleb128 0x0; Augmentation size */
|
661
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
662
|
+
.vbyte 4,LCFI..1-LCFI..0
|
663
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
664
|
+
.byte CFA_OFFSET /* uleb128 176/240 */
|
665
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
666
|
+
.vbyte 4,LCFI..0-LFB..0
|
667
|
+
.byte 0x11 /* DW_CFA_offset_extended_sf */
|
668
|
+
.byte LR_REGNO /* uleb128 LR_REGNO; Register LR */
|
669
|
+
.byte 0x7e /* leb128 -2; Offset -2 (8/16) */
|
670
|
+
.align LOG2_PTRSIZE
|
671
|
+
LEFDE..1:
|
672
|
+
LSFDE..2:
|
673
|
+
.vbyte 4,LEFDE..2-LASFDE..2 /* FDE Length */
|
674
|
+
LASFDE..2:
|
675
|
+
.vbyte 4,LASFDE..2-Lframe..1 /* FDE CIE offset */
|
676
|
+
.vbyte PTRSIZE,LFB..1-$ /* FDE initial location */
|
677
|
+
.vbyte PTRSIZE,LFE..1-LFB..1 /* FDE address range */
|
678
|
+
.byte 0 /* uleb128 0x0; Augmentation size */
|
679
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
680
|
+
.vbyte 4,LCFI..3-LCFI..2
|
681
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
682
|
+
.byte CFA_OFFSET /* uleb128 176/240 */
|
683
|
+
.byte 0x4 /* DW_CFA_advance_loc4 */
|
684
|
+
.vbyte 4,LCFI..2-LFB..1
|
685
|
+
.byte 0x11 /* DW_CFA_offset_extended_sf */
|
686
|
+
.byte LR_REGNO /* uleb128 LR_REGNO; Register LR */
|
687
|
+
.byte 0x7e /* leb128 -2; Offset -2 (8/16) */
|
688
|
+
.align LOG2_PTRSIZE
|
689
|
+
LEFDE..2:
|
690
|
+
.vbyte 4,0 /* End of FDEs */
|
691
|
+
|
692
|
+
.csect .text[PR]
|
693
|
+
.ref _GLOBAL__F_libffi_src_powerpc_aix_closure /* Prevents garbage collection by AIX linker */
|
694
|
+
|