ffi 1.9.25 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +212 -0
- data/Gemfile +3 -4
- data/README.md +38 -18
- data/Rakefile +55 -146
- data/ext/ffi_c/AbstractMemory.c +29 -34
- data/ext/ffi_c/Buffer.c +4 -9
- data/ext/ffi_c/Call.c +16 -49
- data/ext/ffi_c/Call.h +4 -7
- data/ext/ffi_c/ClosurePool.c +75 -25
- data/ext/ffi_c/ClosurePool.h +3 -1
- data/ext/ffi_c/DynamicLibrary.c +2 -7
- data/ext/ffi_c/Function.c +47 -131
- data/ext/ffi_c/Function.h +0 -4
- data/ext/ffi_c/FunctionInfo.c +3 -8
- data/ext/ffi_c/LastError.c +49 -8
- data/ext/ffi_c/LongDouble.c +12 -10
- data/ext/ffi_c/LongDouble.h +0 -4
- data/ext/ffi_c/MemoryPointer.c +3 -8
- data/ext/ffi_c/MemoryPointer.h +0 -4
- data/ext/ffi_c/MethodHandle.c +21 -31
- data/ext/ffi_c/MethodHandle.h +3 -2
- data/ext/ffi_c/Platform.c +3 -54
- data/ext/ffi_c/Pointer.c +25 -26
- data/ext/ffi_c/Pointer.h +0 -4
- data/ext/ffi_c/Struct.c +49 -56
- data/ext/ffi_c/Struct.h +12 -6
- data/ext/ffi_c/StructByValue.c +2 -7
- data/ext/ffi_c/StructLayout.c +22 -20
- data/ext/ffi_c/Thread.c +4 -228
- data/ext/ffi_c/Thread.h +1 -20
- data/ext/ffi_c/Type.c +1 -19
- data/ext/ffi_c/Type.h +0 -1
- data/ext/ffi_c/Types.c +7 -8
- data/ext/ffi_c/Types.h +3 -4
- data/ext/ffi_c/Variadic.c +23 -24
- data/ext/ffi_c/compat.h +4 -0
- data/ext/ffi_c/extconf.rb +53 -30
- data/ext/ffi_c/ffi.c +3 -8
- data/ext/ffi_c/libffi.darwin.mk +1 -1
- data/ext/ffi_c/libffi/.appveyor.yml +29 -13
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.travis.yml +51 -2
- data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
- data/ext/ffi_c/libffi/.travis/build-in-container.sh +12 -0
- data/ext/ffi_c/libffi/.travis/build.sh +116 -8
- data/ext/ffi_c/libffi/.travis/install.sh +65 -16
- data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/moxie-sim.exp +1 -1
- data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/site.exp +10 -1
- data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
- data/ext/ffi_c/libffi/Makefile.am +56 -72
- data/ext/ffi_c/libffi/README.md +33 -8
- data/ext/ffi_c/libffi/config.guess +552 -331
- data/ext/ffi_c/libffi/config.sub +1321 -1306
- data/ext/ffi_c/libffi/configure.ac +37 -12
- data/ext/ffi_c/libffi/configure.host +56 -27
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +997 -0
- data/ext/ffi_c/libffi/doc/version.texi +4 -0
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +2 -4
- data/ext/ffi_c/libffi/include/ffi.h.in +19 -7
- data/ext/ffi_c/libffi/include/ffi_common.h +5 -1
- data/ext/ffi_c/libffi/libffi.map.in +8 -12
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
- data/ext/ffi_c/libffi/libtool-version +1 -1
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +2 -1
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
- data/ext/ffi_c/libffi/msvcc.sh +38 -13
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +153 -69
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
- data/ext/ffi_c/libffi/src/aarch64/internal.h +1 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +22 -9
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +62 -5
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/arm/sysv.S +6 -4
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/closures.c +69 -14
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +1 -1
- data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/mips/ffi.c +5 -1
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +1 -1
- data/ext/ffi_c/libffi/src/mips/o32.S +2 -0
- data/ext/ffi_c/libffi/src/moxie/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +1 -6
- data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
- data/ext/ffi_c/libffi/src/pa/linux.S +27 -4
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +91 -28
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +81 -5
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
- data/ext/ffi_c/libffi/src/prep_cif.c +4 -2
- data/ext/ffi_c/libffi/src/riscv/ffi.c +42 -6
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
- data/ext/ffi_c/libffi/src/x86/ffi.c +29 -12
- data/ext/ffi_c/libffi/src/x86/ffi64.c +22 -11
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -2
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +20 -10
- data/ext/ffi_c/libffi/src/x86/sysv.S +105 -10
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +100 -4
- data/ext/ffi_c/libffi/src/x86/win64.S +12 -3
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
- data/ext/ffi_c/libffi/testsuite/Makefile.am +114 -109
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +32 -8
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +3 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +0 -0
- data/ext/ffi_c/rbffi.h +0 -2
- data/ffi.gemspec +13 -6
- data/lib/ffi.rb +10 -2
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +1 -1
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/ffi.rb +3 -0
- data/lib/ffi/io.rb +3 -3
- data/lib/ffi/library.rb +12 -8
- data/lib/ffi/managedstruct.rb +2 -2
- data/lib/ffi/platform.rb +34 -10
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +128 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/arm-linux/types.conf +110 -82
- data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/i386-gnu/types.conf +84 -84
- data/lib/ffi/platform/i386-linux/types.conf +77 -77
- data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
- data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
- data/lib/ffi/platform/i386-solaris/types.conf +96 -96
- data/lib/ffi/platform/i386-windows/types.conf +43 -96
- data/lib/ffi/platform/ia64-linux/types.conf +79 -79
- data/lib/ffi/platform/mips-linux/types.conf +79 -79
- data/lib/ffi/platform/mips64-linux/types.conf +81 -81
- data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
- data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
- data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
- data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +79 -79
- data/lib/ffi/platform/s390x-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
- data/lib/ffi/platform/sparc64-linux/types.conf +79 -79
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
- data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -90
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
- data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
- data/lib/ffi/pointer.rb +26 -20
- data/lib/ffi/struct.rb +13 -68
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/tools/const_generator.rb +5 -4
- data/lib/ffi/tools/generator.rb +47 -2
- data/lib/ffi/tools/generator_task.rb +13 -17
- data/lib/ffi/tools/struct_generator.rb +4 -4
- data/lib/ffi/tools/types_generator.rb +7 -4
- data/lib/ffi/types.rb +1 -1
- data/lib/ffi/variadic.rb +1 -10
- data/lib/ffi/version.rb +1 -1
- data/rakelib/ffi_gem_helper.rb +65 -0
- data/samples/getlogin.rb +1 -1
- data/samples/getpid.rb +1 -1
- data/samples/gettimeofday.rb +8 -8
- data/samples/hello.rb +2 -1
- data/samples/inotify.rb +1 -1
- data/samples/pty.rb +1 -2
- data/samples/qsort.rb +0 -1
- metadata +160 -122
- data/.gitignore +0 -22
- data/.gitmodules +0 -3
- data/.travis.yml +0 -52
- data/.yardopts +0 -5
- data/appveyor.yml +0 -22
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/StructByReference.c +0 -190
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/ext/ffi_c/win32/stdbool.h +0 -8
- data/ext/ffi_c/win32/stdint.h +0 -201
- data/samples/sample_helper.rb +0 -6
data/ext/ffi_c/libffi/msvcc.sh
CHANGED
@@ -60,7 +60,7 @@ do
|
|
60
60
|
case $1
|
61
61
|
in
|
62
62
|
--verbose)
|
63
|
-
|
63
|
+
verbose=1
|
64
64
|
shift 1
|
65
65
|
;;
|
66
66
|
--version)
|
@@ -80,6 +80,16 @@ do
|
|
80
80
|
safeseh=
|
81
81
|
shift 1
|
82
82
|
;;
|
83
|
+
-marm)
|
84
|
+
ml='armasm'
|
85
|
+
safeseh=
|
86
|
+
shift 1
|
87
|
+
;;
|
88
|
+
-marm64)
|
89
|
+
ml='armasm64'
|
90
|
+
safeseh=
|
91
|
+
shift 1
|
92
|
+
;;
|
83
93
|
-clang-cl)
|
84
94
|
cl="clang-cl"
|
85
95
|
shift 1
|
@@ -155,24 +165,24 @@ do
|
|
155
165
|
shift 1
|
156
166
|
;;
|
157
167
|
-I)
|
158
|
-
p=$(cygpath -
|
159
|
-
args="$args -I$p"
|
160
|
-
includes="$includes -I$p"
|
168
|
+
p=$(cygpath -ma "$2")
|
169
|
+
args="$args -I\"$p\""
|
170
|
+
includes="$includes -I\"$p\""
|
161
171
|
shift 2
|
162
172
|
;;
|
163
173
|
-I*)
|
164
|
-
p=$(cygpath -
|
165
|
-
args="$args -I$p"
|
166
|
-
includes="$includes -I$p"
|
174
|
+
p=$(cygpath -ma "${1#-I}")
|
175
|
+
args="$args -I\"$p\""
|
176
|
+
includes="$includes -I\"$p\""
|
167
177
|
shift 1
|
168
178
|
;;
|
169
179
|
-L)
|
170
|
-
p=$(cygpath -
|
180
|
+
p=$(cygpath -ma $2)
|
171
181
|
linkargs="$linkargs -LIBPATH:$p"
|
172
182
|
shift 2
|
173
183
|
;;
|
174
184
|
-L*)
|
175
|
-
p=$(cygpath -
|
185
|
+
p=$(cygpath -ma ${1#-L})
|
176
186
|
linkargs="$linkargs -LIBPATH:$p"
|
177
187
|
shift 1
|
178
188
|
;;
|
@@ -237,6 +247,7 @@ do
|
|
237
247
|
else
|
238
248
|
output="-Fe$2"
|
239
249
|
fi
|
250
|
+
armasm_output="-o $2"
|
240
251
|
if [ -n "$assembly" ]; then
|
241
252
|
args="$args $output"
|
242
253
|
else
|
@@ -245,12 +256,12 @@ do
|
|
245
256
|
shift 2
|
246
257
|
;;
|
247
258
|
*.S)
|
248
|
-
src
|
259
|
+
src="$(cygpath -ma $1)"
|
249
260
|
assembly="true"
|
250
261
|
shift 1
|
251
262
|
;;
|
252
263
|
*.c)
|
253
|
-
args="$args $1"
|
264
|
+
args="$args $(cygpath -ma $1)"
|
254
265
|
shift 1
|
255
266
|
;;
|
256
267
|
*)
|
@@ -289,13 +300,27 @@ if [ -n "$assembly" ]; then
|
|
289
300
|
fi
|
290
301
|
ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')"
|
291
302
|
|
303
|
+
if [ $ml = "armasm" ]; then
|
304
|
+
defines="$defines -D_M_ARM"
|
305
|
+
fi
|
306
|
+
|
307
|
+
if [ $ml = "armasm64" ]; then
|
308
|
+
defines="$defines -D_M_ARM64"
|
309
|
+
fi
|
310
|
+
|
292
311
|
if test -n "$verbose"; then
|
293
312
|
echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
|
294
313
|
fi
|
295
314
|
|
296
|
-
"$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $?
|
315
|
+
eval "\"$cl\" -nologo -EP $includes $defines $src" > $ppsrc || exit $?
|
297
316
|
output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')"
|
298
|
-
|
317
|
+
if [ $ml = "armasm" ]; then
|
318
|
+
args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt"
|
319
|
+
elif [ $ml = "armasm64" ]; then
|
320
|
+
args="-nologo -g $armasm_output $ppsrc -errorReport:prompt"
|
321
|
+
else
|
322
|
+
args="-nologo $safeseh $single $output $ppsrc"
|
323
|
+
fi
|
299
324
|
|
300
325
|
if test -n "$verbose"; then
|
301
326
|
echo "$ml $args"
|
@@ -19,6 +19,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
19
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
20
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
21
21
|
|
22
|
+
#if defined(__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)
|
22
23
|
#include <stdio.h>
|
23
24
|
#include <stdlib.h>
|
24
25
|
#include <stdint.h>
|
@@ -26,6 +27,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
26
27
|
#include <ffi.h>
|
27
28
|
#include <ffi_common.h>
|
28
29
|
#include "internal.h"
|
30
|
+
#ifdef _WIN32
|
31
|
+
#include <windows.h> /* FlushInstructionCache */
|
32
|
+
#endif
|
29
33
|
|
30
34
|
/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
|
31
35
|
all further uses in this file will refer to the 128-bit type. */
|
@@ -58,6 +62,9 @@ struct call_context
|
|
58
62
|
#if FFI_EXEC_TRAMPOLINE_TABLE
|
59
63
|
|
60
64
|
#ifdef __MACH__
|
65
|
+
#ifdef HAVE_PTRAUTH
|
66
|
+
#include <ptrauth.h>
|
67
|
+
#endif
|
61
68
|
#include <mach/vm_param.h>
|
62
69
|
#endif
|
63
70
|
|
@@ -74,6 +81,8 @@ ffi_clear_cache (void *start, void *end)
|
|
74
81
|
sys_icache_invalidate (start, (char *)end - (char *)start);
|
75
82
|
#elif defined (__GNUC__)
|
76
83
|
__builtin___clear_cache (start, end);
|
84
|
+
#elif defined (_WIN32)
|
85
|
+
FlushInstructionCache(GetCurrentProcess(), start, (char*)end - (char*)start);
|
77
86
|
#else
|
78
87
|
#error "Missing builtin to flush instruction cache"
|
79
88
|
#endif
|
@@ -315,6 +324,9 @@ extend_integer_type (void *source, int type)
|
|
315
324
|
}
|
316
325
|
}
|
317
326
|
|
327
|
+
#if defined(_MSC_VER)
|
328
|
+
void extend_hfa_type (void *dest, void *src, int h);
|
329
|
+
#else
|
318
330
|
static void
|
319
331
|
extend_hfa_type (void *dest, void *src, int h)
|
320
332
|
{
|
@@ -350,10 +362,10 @@ extend_hfa_type (void *dest, void *src, int h)
|
|
350
362
|
" b 1f\n"
|
351
363
|
" nop\n"
|
352
364
|
" ldp q16, q17, [%3]\n" /* Q4 */
|
353
|
-
" ldp q18, q19, [%3, #
|
365
|
+
" ldp q18, q19, [%3, #32]\n"
|
354
366
|
" b 4f\n"
|
355
367
|
" ldp q16, q17, [%3]\n" /* Q3 */
|
356
|
-
" ldr q18, [%3, #
|
368
|
+
" ldr q18, [%3, #32]\n"
|
357
369
|
" b 3f\n"
|
358
370
|
" ldp q16, q17, [%3]\n" /* Q2 */
|
359
371
|
" b 2f\n"
|
@@ -368,7 +380,11 @@ extend_hfa_type (void *dest, void *src, int h)
|
|
368
380
|
: "r"(f * 12), "r"(dest), "r"(src)
|
369
381
|
: "memory", "v16", "v17", "v18", "v19");
|
370
382
|
}
|
383
|
+
#endif
|
371
384
|
|
385
|
+
#if defined(_MSC_VER)
|
386
|
+
void* compress_hfa_type (void *dest, void *src, int h);
|
387
|
+
#else
|
372
388
|
static void *
|
373
389
|
compress_hfa_type (void *dest, void *reg, int h)
|
374
390
|
{
|
@@ -437,6 +453,7 @@ compress_hfa_type (void *dest, void *reg, int h)
|
|
437
453
|
}
|
438
454
|
return dest;
|
439
455
|
}
|
456
|
+
#endif
|
440
457
|
|
441
458
|
/* Either allocate an appropriate register for the argument type, or if
|
442
459
|
none are available, allocate a stack slot and return a pointer
|
@@ -454,7 +471,7 @@ allocate_int_to_reg_or_stack (struct call_context *context,
|
|
454
471
|
return allocate_to_stack (state, stack, size, size);
|
455
472
|
}
|
456
473
|
|
457
|
-
ffi_status
|
474
|
+
ffi_status FFI_HIDDEN
|
458
475
|
ffi_prep_cif_machdep (ffi_cif *cif)
|
459
476
|
{
|
460
477
|
ffi_type *rtype = cif->rtype;
|
@@ -539,14 +556,22 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
|
539
556
|
|
540
557
|
#if defined (__APPLE__)
|
541
558
|
/* Perform Apple-specific cif processing for variadic calls */
|
542
|
-
ffi_status
|
543
|
-
|
544
|
-
|
559
|
+
ffi_status FFI_HIDDEN
|
560
|
+
ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs,
|
561
|
+
unsigned int ntotalargs)
|
545
562
|
{
|
546
563
|
ffi_status status = ffi_prep_cif_machdep (cif);
|
547
564
|
cif->aarch64_nfixedargs = nfixedargs;
|
548
565
|
return status;
|
549
566
|
}
|
567
|
+
#else
|
568
|
+
ffi_status FFI_HIDDEN
|
569
|
+
ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs)
|
570
|
+
{
|
571
|
+
ffi_status status = ffi_prep_cif_machdep (cif);
|
572
|
+
cif->flags |= AARCH64_FLAG_VARARG;
|
573
|
+
return status;
|
574
|
+
}
|
550
575
|
#endif /* __APPLE__ */
|
551
576
|
|
552
577
|
extern void ffi_call_SYSV (struct call_context *context, void *frame,
|
@@ -563,7 +588,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
563
588
|
void *stack, *frame, *rvalue;
|
564
589
|
struct arg_state state;
|
565
590
|
size_t stack_bytes, rtype_size, rsize;
|
566
|
-
int i, nargs, flags;
|
591
|
+
int i, nargs, flags, isvariadic = 0;
|
567
592
|
ffi_type *rtype;
|
568
593
|
|
569
594
|
flags = cif->flags;
|
@@ -571,6 +596,12 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
571
596
|
rtype_size = rtype->size;
|
572
597
|
stack_bytes = cif->bytes;
|
573
598
|
|
599
|
+
if (flags & AARCH64_FLAG_VARARG)
|
600
|
+
{
|
601
|
+
isvariadic = 1;
|
602
|
+
flags &= ~AARCH64_FLAG_VARARG;
|
603
|
+
}
|
604
|
+
|
574
605
|
/* If the target function returns a structure via hidden pointer,
|
575
606
|
then we cannot allow a null rvalue. Otherwise, mash a null
|
576
607
|
rvalue to void return type. */
|
@@ -588,8 +619,8 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
588
619
|
/* Allocate consectutive stack for everything we'll need. */
|
589
620
|
context = alloca (sizeof(struct call_context) + stack_bytes + 32 + rsize);
|
590
621
|
stack = context + 1;
|
591
|
-
frame = stack + stack_bytes;
|
592
|
-
rvalue = (rsize ? frame + 32 : orig_rvalue);
|
622
|
+
frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes);
|
623
|
+
rvalue = (rsize ? (void*)((uintptr_t)frame + 32) : orig_rvalue);
|
593
624
|
|
594
625
|
arg_init (&state);
|
595
626
|
for (i = 0, nargs = cif->nargs; i < nargs; i++)
|
@@ -650,16 +681,31 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
650
681
|
h = is_vfp_type (ty);
|
651
682
|
if (h)
|
652
683
|
{
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
684
|
+
int elems = 4 - (h & 3);
|
685
|
+
if (cif->abi == FFI_WIN64 && isvariadic)
|
686
|
+
{
|
687
|
+
if (state.ngrn + elems <= N_X_ARG_REG)
|
688
|
+
{
|
689
|
+
dest = &context->x[state.ngrn];
|
690
|
+
state.ngrn += elems;
|
691
|
+
extend_hfa_type(dest, a, h);
|
692
|
+
break;
|
693
|
+
}
|
694
|
+
state.nsrn = N_X_ARG_REG;
|
695
|
+
dest = allocate_to_stack(&state, stack, ty->alignment, s);
|
696
|
+
}
|
697
|
+
else
|
698
|
+
{
|
699
|
+
if (state.nsrn + elems <= N_V_ARG_REG)
|
700
|
+
{
|
701
|
+
dest = &context->v[state.nsrn];
|
702
|
+
state.nsrn += elems;
|
703
|
+
extend_hfa_type (dest, a, h);
|
704
|
+
break;
|
705
|
+
}
|
706
|
+
state.nsrn = N_V_ARG_REG;
|
707
|
+
dest = allocate_to_stack (&state, stack, ty->alignment, s);
|
708
|
+
}
|
663
709
|
}
|
664
710
|
else if (s > 16)
|
665
711
|
{
|
@@ -681,7 +727,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
681
727
|
X registers, then the argument is copied into
|
682
728
|
consecutive X registers. */
|
683
729
|
dest = &context->x[state.ngrn];
|
684
|
-
|
730
|
+
state.ngrn += (unsigned int)n;
|
685
731
|
}
|
686
732
|
else
|
687
733
|
{
|
@@ -756,6 +802,9 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
|
756
802
|
|
757
803
|
#if FFI_EXEC_TRAMPOLINE_TABLE
|
758
804
|
#ifdef __MACH__
|
805
|
+
#ifdef HAVE_PTRAUTH
|
806
|
+
codeloc = ptrauth_strip (codeloc, ptrauth_key_asia);
|
807
|
+
#endif
|
759
808
|
void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE);
|
760
809
|
config[0] = closure;
|
761
810
|
config[1] = start;
|
@@ -773,6 +822,16 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
|
773
822
|
*(UINT64 *)(tramp + 16) = (uintptr_t)start;
|
774
823
|
|
775
824
|
ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
|
825
|
+
|
826
|
+
/* Also flush the cache for code mapping. */
|
827
|
+
#ifdef _WIN32
|
828
|
+
// Not using dlmalloc.c for Windows ARM64 builds
|
829
|
+
// so calling ffi_data_to_code_pointer() isn't necessary
|
830
|
+
unsigned char *tramp_code = tramp;
|
831
|
+
#else
|
832
|
+
unsigned char *tramp_code = ffi_data_to_code_pointer (tramp);
|
833
|
+
#endif
|
834
|
+
ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE);
|
776
835
|
#endif
|
777
836
|
|
778
837
|
closure->cif = cif;
|
@@ -871,55 +930,78 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
|
|
871
930
|
if (h)
|
872
931
|
{
|
873
932
|
n = 4 - (h & 3);
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
933
|
+
#ifdef _WIN32 /* for handling armasm calling convention */
|
934
|
+
if (cif->is_variadic)
|
935
|
+
{
|
936
|
+
if (state.ngrn + n <= N_X_ARG_REG)
|
937
|
+
{
|
938
|
+
void *reg = &context->x[state.ngrn];
|
939
|
+
state.ngrn += (unsigned int)n;
|
940
|
+
|
941
|
+
/* Eeek! We need a pointer to the structure, however the
|
942
|
+
homogeneous float elements are being passed in individual
|
943
|
+
registers, therefore for float and double the structure
|
944
|
+
is not represented as a contiguous sequence of bytes in
|
945
|
+
our saved register context. We don't need the original
|
946
|
+
contents of the register storage, so we reformat the
|
947
|
+
structure into the same memory. */
|
948
|
+
avalue[i] = compress_hfa_type(reg, reg, h);
|
949
|
+
}
|
950
|
+
else
|
951
|
+
{
|
952
|
+
state.ngrn = N_X_ARG_REG;
|
953
|
+
state.nsrn = N_V_ARG_REG;
|
954
|
+
avalue[i] = allocate_to_stack(&state, stack,
|
955
|
+
ty->alignment, s);
|
956
|
+
}
|
957
|
+
}
|
958
|
+
else
|
959
|
+
{
|
960
|
+
#endif /* for handling armasm calling convention */
|
961
|
+
if (state.nsrn + n <= N_V_ARG_REG)
|
962
|
+
{
|
963
|
+
void *reg = &context->v[state.nsrn];
|
964
|
+
state.nsrn += (unsigned int)n;
|
965
|
+
avalue[i] = compress_hfa_type(reg, reg, h);
|
966
|
+
}
|
967
|
+
else
|
968
|
+
{
|
969
|
+
state.nsrn = N_V_ARG_REG;
|
970
|
+
avalue[i] = allocate_to_stack(&state, stack,
|
971
|
+
ty->alignment, s);
|
972
|
+
}
|
973
|
+
#ifdef _WIN32 /* for handling armasm calling convention */
|
974
|
+
}
|
975
|
+
#endif /* for handling armasm calling convention */
|
976
|
+
}
|
977
|
+
else if (s > 16)
|
978
|
+
{
|
979
|
+
/* Replace Composite type of size greater than 16 with a
|
980
|
+
pointer. */
|
981
|
+
avalue[i] = *(void **)
|
982
|
+
allocate_int_to_reg_or_stack (context, &state, stack,
|
983
|
+
sizeof (void *));
|
984
|
+
}
|
985
|
+
else
|
986
|
+
{
|
987
|
+
n = (s + 7) / 8;
|
988
|
+
if (state.ngrn + n <= N_X_ARG_REG)
|
989
|
+
{
|
990
|
+
avalue[i] = &context->x[state.ngrn];
|
991
|
+
state.ngrn += (unsigned int)n;
|
992
|
+
}
|
993
|
+
else
|
994
|
+
{
|
995
|
+
state.ngrn = N_X_ARG_REG;
|
996
|
+
avalue[i] = allocate_to_stack(&state, stack,
|
997
|
+
ty->alignment, s);
|
998
|
+
}
|
999
|
+
}
|
1000
|
+
break;
|
1001
|
+
|
1002
|
+
default:
|
1003
|
+
abort();
|
1004
|
+
}
|
923
1005
|
|
924
1006
|
#if defined (__APPLE__)
|
925
1007
|
if (i + 1 == cif->aarch64_nfixedargs)
|
@@ -939,3 +1021,5 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
|
|
939
1021
|
|
940
1022
|
return flags;
|
941
1023
|
}
|
1024
|
+
|
1025
|
+
#endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/
|