ffi 1.1.5 → 1.15.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +338 -0
- data/COPYING +49 -0
- data/Gemfile +14 -0
- data/LICENSE +21 -11
- data/LICENSE.SPECS +22 -0
- data/README.md +136 -0
- data/Rakefile +149 -154
- data/ext/ffi_c/AbstractMemory.c +133 -57
- data/ext/ffi_c/AbstractMemory.h +21 -12
- data/ext/ffi_c/ArrayType.c +27 -14
- data/ext/ffi_c/ArrayType.h +21 -12
- data/ext/ffi_c/Buffer.c +29 -25
- data/ext/ffi_c/Call.c +154 -125
- data/ext/ffi_c/Call.h +43 -20
- data/ext/ffi_c/ClosurePool.c +100 -42
- data/ext/ffi_c/ClosurePool.h +24 -13
- data/ext/ffi_c/DynamicLibrary.c +47 -28
- data/ext/ffi_c/DynamicLibrary.h +70 -12
- data/ext/ffi_c/Function.c +119 -167
- data/ext/ffi_c/Function.h +23 -19
- data/ext/ffi_c/FunctionInfo.c +55 -25
- data/ext/ffi_c/LastError.c +70 -21
- data/ext/ffi_c/LastError.h +21 -12
- data/ext/ffi_c/LongDouble.c +15 -9
- data/ext/ffi_c/LongDouble.h +21 -16
- data/ext/ffi_c/MappedType.c +22 -15
- data/ext/ffi_c/MappedType.h +21 -12
- data/ext/ffi_c/MemoryPointer.c +58 -33
- data/ext/ffi_c/MemoryPointer.h +22 -19
- data/ext/ffi_c/MethodHandle.c +49 -50
- data/ext/ffi_c/MethodHandle.h +24 -14
- data/ext/ffi_c/Platform.c +28 -62
- data/ext/ffi_c/Platform.h +21 -12
- data/ext/ffi_c/Pointer.c +63 -46
- data/ext/ffi_c/Pointer.h +22 -19
- data/ext/ffi_c/Struct.c +198 -80
- data/ext/ffi_c/Struct.h +33 -18
- data/ext/ffi_c/StructByValue.c +23 -20
- data/ext/ffi_c/StructByValue.h +21 -12
- data/ext/ffi_c/StructLayout.c +184 -39
- data/ext/ffi_c/Thread.c +73 -270
- data/ext/ffi_c/Thread.h +32 -35
- data/ext/ffi_c/Type.c +26 -32
- data/ext/ffi_c/Type.h +24 -10
- data/ext/ffi_c/Types.c +28 -20
- data/ext/ffi_c/Types.h +25 -16
- data/ext/ffi_c/Variadic.c +78 -39
- data/ext/ffi_c/compat.h +25 -17
- data/ext/ffi_c/extconf.rb +68 -31
- data/ext/ffi_c/ffi.c +27 -20
- data/ext/ffi_c/libffi/.appveyor.yml +66 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
- data/ext/ffi_c/libffi/.gitignore +38 -0
- data/ext/ffi_c/libffi/.travis/ar-lib +270 -0
- 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 +142 -0
- data/ext/ffi_c/libffi/.travis/compile +351 -0
- data/ext/ffi_c/libffi/.travis/install.sh +71 -0
- data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/moxie-sim.exp +60 -0
- 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 +27 -0
- data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.travis.yml +83 -0
- data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6366 -3559
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
- data/ext/ffi_c/libffi/Makefile.am +123 -169
- data/ext/ffi_c/libffi/Makefile.in +1243 -1003
- data/ext/ffi_c/libffi/README.md +486 -0
- data/ext/ffi_c/libffi/acinclude.m4 +387 -0
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/config.guess +690 -504
- data/ext/ffi_c/libffi/config.sub +1353 -1207
- data/ext/ffi_c/libffi/configure +7308 -2449
- data/ext/ffi_c/libffi/configure.ac +178 -259
- data/ext/ffi_c/libffi/configure.host +311 -4
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/Makefile.in +815 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +455 -58
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +37 -13
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +201 -0
- data/ext/ffi_c/libffi/include/Makefile.am +3 -3
- data/ext/ffi_c/libffi/include/Makefile.in +196 -75
- data/ext/ffi_c/libffi/include/ffi.h.in +163 -67
- data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +39 -12
- data/ext/ffi_c/libffi/install-sh +207 -209
- data/ext/ffi_c/libffi/libffi.map.in +76 -0
- data/ext/ffi_c/libffi/libffi.pc.in +3 -2
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +997 -0
- data/ext/ffi_c/libffi/libtool-ldflags +106 -0
- data/ext/ffi_c/libffi/libtool-version +1 -1
- data/ext/ffi_c/libffi/ltmain.sh +3641 -2026
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +50 -0
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +32 -14
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +33 -106
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +38 -13
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +8 -29
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +11 -9
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +104 -52
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +18 -8
- data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.am +2 -2
- data/ext/ffi_c/libffi/man/Makefile.in +151 -55
- data/ext/ffi_c/libffi/man/ffi.3 +10 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
- data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
- data/ext/ffi_c/libffi/missing +153 -314
- 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/{include/ffi.h.vc64 → msvc_build/aarch64/aarch64_include/ffi.h} +151 -67
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +176 -20
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +1025 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +68 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +451 -0
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
- data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +161 -266
- data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
- data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +663 -515
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +32 -8
- data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +305 -417
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
- data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
- data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
- data/ext/ffi_c/libffi/src/closures.c +465 -59
- data/ext/ffi_c/libffi/src/cris/ffi.c +10 -7
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +6 -1
- 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/debug.c +6 -1
- data/ext/ffi_c/libffi/src/dlmalloc.c +17 -12
- data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +35 -13
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +8 -2
- data/ext/ffi_c/libffi/src/ia64/unix.S +8 -1
- data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
- 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/m32r/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/ffi.c +87 -13
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/sysv.S +119 -32
- data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
- data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
- data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
- data/ext/ffi_c/libffi/{fficonfig.hw → src/metag/ffitarget.h} +22 -26
- data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
- data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
- data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +135 -37
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +16 -14
- data/ext/ffi_c/libffi/src/mips/n32.S +128 -56
- data/ext/ffi_c/libffi/src/mips/o32.S +150 -27
- data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
- data/ext/ffi_c/libffi/src/moxie/ffi.c +55 -46
- data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
- data/ext/ffi_c/libffi/src/or1k/ffi.c +328 -0
- data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +9 -7
- 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/aix.S +245 -7
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +253 -4
- data/ext/ffi_c/libffi/src/powerpc/asm.h +2 -2
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +2 -7
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +22 -26
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +105 -1378
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +123 -30
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1153 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +105 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +110 -45
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +189 -85
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +436 -108
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +73 -119
- data/ext/ffi_c/libffi/src/prep_cif.c +111 -25
- data/ext/ffi_c/libffi/src/raw_api.c +18 -5
- data/ext/ffi_c/libffi/src/riscv/ffi.c +481 -0
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +9 -1
- data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
- data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/sparc/ffi.c +326 -527
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -7
- data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
- data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
- data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
- data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
- data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
- data/ext/ffi_c/libffi/src/types.c +46 -15
- data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
- data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
- data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +624 -498
- data/ext/ffi_c/libffi/src/x86/ffi64.c +379 -119
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +74 -35
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +318 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +1070 -400
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +494 -299
- data/ext/ffi_c/libffi/src/x86/win64.S +231 -458
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +258 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +115 -73
- data/ext/ffi_c/libffi/testsuite/Makefile.in +262 -114
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +334 -24
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +21 -1
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1745 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +743 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +28 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +25 -40
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +15 -12
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +107 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -0
- 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/closure_stdcall.c → libffi.closures/closure_simple.c} +7 -16
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +95 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +4 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +4 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +4 -4
- 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 +10 -9
- 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 +3 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +10 -9
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +55 -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 +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +11 -9
- 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.closures/cls_struct_va1.c +114 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +44 -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 +20 -19
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +8 -8
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +121 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +6 -6
- 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 +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +2 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +3 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +3 -2
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
- data/ext/ffi_c/libffi.bsd.mk +12 -6
- data/ext/ffi_c/libffi.darwin.mk +21 -9
- data/ext/ffi_c/libffi.gnu.mk +3 -2
- data/ext/ffi_c/libffi.mk +11 -6
- data/ext/ffi_c/libffi.vc.mk +1 -1
- data/ext/ffi_c/libffi.vc64.mk +1 -1
- data/ext/ffi_c/rbffi.h +22 -14
- data/ext/ffi_c/rbffi_endian.h +11 -2
- data/ffi.gemspec +42 -0
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +70 -50
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/enum.rb +159 -24
- data/lib/ffi/errno.rb +21 -11
- data/lib/ffi/ffi.rb +25 -11
- data/lib/ffi/io.rb +24 -14
- data/lib/ffi/library.rb +174 -67
- data/lib/ffi/managedstruct.rb +63 -34
- 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 +181 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +104 -0
- 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 +3 -0
- 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/{i486-gnu → 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 -87
- 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 +104 -0
- data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
- 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 +104 -0
- 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 +102 -0
- 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 +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +93 -63
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -88
- 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 -87
- data/lib/ffi/platform/x86_64-openbsd/types.conf +100 -92
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
- data/lib/ffi/platform.rb +81 -26
- data/lib/ffi/pointer.rb +72 -27
- data/lib/ffi/struct.rb +99 -66
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +82 -17
- data/lib/ffi/tools/const_generator.rb +11 -8
- data/lib/ffi/tools/generator.rb +48 -1
- data/lib/ffi/tools/generator_task.rb +13 -16
- data/lib/ffi/tools/struct_generator.rb +6 -5
- data/lib/ffi/tools/types_generator.rb +14 -10
- data/lib/ffi/types.rb +31 -14
- data/lib/ffi/union.rb +23 -12
- data/lib/ffi/variadic.rb +25 -21
- data/lib/ffi/version.rb +3 -0
- data/lib/ffi.rb +20 -8
- data/rakelib/ffi_gem_helper.rb +65 -0
- data/samples/getlogin.rb +8 -0
- data/samples/getpid.rb +8 -0
- data/samples/gettimeofday.rb +18 -0
- data/samples/hello.rb +8 -0
- data/samples/inotify.rb +60 -0
- data/samples/pty.rb +75 -0
- data/samples/qsort.rb +20 -0
- metadata +413 -263
- data/History.txt +0 -1
- data/README.rdoc +0 -102
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/Ffi_c.iml +0 -12
- data/ext/ffi_c/StructByReference.c +0 -158
- 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/libffi/Makefile.vc +0 -141
- data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
- data/ext/ffi_c/libffi/README +0 -342
- data/ext/ffi_c/libffi/aclocal.m4 +0 -1873
- data/ext/ffi_c/libffi/build-ios.sh +0 -67
- data/ext/ffi_c/libffi/compile +0 -143
- data/ext/ffi_c/libffi/depcomp +0 -630
- data/ext/ffi_c/libffi/doc/libffi.info +0 -593
- data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
- data/ext/ffi_c/libffi/include/ffi.h.vc +0 -427
- data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +0 -76
- data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7831
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -369
- data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -123
- data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
- data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -98
- data/ext/ffi_c/libffi/mdate-sh +0 -201
- data/ext/ffi_c/libffi/src/arm/gentramp.sh +0 -118
- data/ext/ffi_c/libffi/src/arm/trampoline.S +0 -4450
- data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
- data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
- data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
- data/ext/ffi_c/libffi/src/x86/win32.S +0 -1065
- data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +0 -96
- data/ext/ffi_c/libffi/texinfo.tex +0 -7210
- data/ext/ffi_c/win32/stdint.h +0 -199
- data/gen/Rakefile +0 -30
- data/gen/log +0 -1
- data/lib/Lib.iml +0 -13
- data/spec/ffi/Ffi.iml +0 -12
- data/spec/ffi/async_callback_spec.rb +0 -46
- data/spec/ffi/bool_spec.rb +0 -40
- data/spec/ffi/buffer_spec.rb +0 -215
- data/spec/ffi/callback_spec.rb +0 -668
- data/spec/ffi/custom_param_type.rb +0 -47
- data/spec/ffi/custom_type_spec.rb +0 -85
- data/spec/ffi/dup_spec.rb +0 -65
- data/spec/ffi/enum_spec.rb +0 -227
- data/spec/ffi/errno_spec.rb +0 -29
- data/spec/ffi/ffi_spec.rb +0 -40
- data/spec/ffi/function_spec.rb +0 -87
- data/spec/ffi/library_spec.rb +0 -208
- data/spec/ffi/long_double.rb +0 -41
- data/spec/ffi/managed_struct_spec.rb +0 -72
- data/spec/ffi/number_spec.rb +0 -247
- data/spec/ffi/pointer_spec.rb +0 -214
- data/spec/ffi/rbx/attach_function_spec.rb +0 -28
- data/spec/ffi/rbx/memory_pointer_spec.rb +0 -115
- data/spec/ffi/rbx/spec_helper.rb +0 -1
- data/spec/ffi/rbx/struct_spec.rb +0 -13
- data/spec/ffi/spec_helper.rb +0 -35
- data/spec/ffi/string_spec.rb +0 -119
- data/spec/ffi/strptr_spec.rb +0 -61
- data/spec/ffi/struct_callback_spec.rb +0 -80
- data/spec/ffi/struct_initialize_spec.rb +0 -46
- data/spec/ffi/struct_packed_spec.rb +0 -62
- data/spec/ffi/struct_spec.rb +0 -719
- data/spec/ffi/typedef_spec.rb +0 -89
- data/spec/ffi/union_spec.rb +0 -76
- data/spec/ffi/variadic_spec.rb +0 -103
- data/spec/spec.opts +0 -4
- data/tasks/ann.rake +0 -80
- data/tasks/extension.rake +0 -32
- data/tasks/gem.rake +0 -199
- data/tasks/git.rake +0 -41
- data/tasks/notes.rake +0 -27
- data/tasks/post_load.rake +0 -34
- data/tasks/rdoc.rake +0 -50
- data/tasks/rubyforge.rake +0 -55
- data/tasks/setup.rb +0 -301
- data/tasks/spec.rake +0 -54
- data/tasks/svn.rake +0 -47
- data/tasks/test.rake +0 -40
- data/tasks/yard.rake +0 -11
@@ -0,0 +1,97 @@
|
|
1
|
+
/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
``Software''), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
21
|
+
|
22
|
+
#ifndef LIBFFI_TARGET_H
|
23
|
+
#define LIBFFI_TARGET_H
|
24
|
+
|
25
|
+
#ifndef LIBFFI_H
|
26
|
+
#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
|
27
|
+
#endif
|
28
|
+
|
29
|
+
#ifndef LIBFFI_ASM
|
30
|
+
#ifdef __ILP32__
|
31
|
+
#define FFI_SIZEOF_ARG 8
|
32
|
+
#define FFI_SIZEOF_JAVA_RAW 4
|
33
|
+
typedef unsigned long long ffi_arg;
|
34
|
+
typedef signed long long ffi_sarg;
|
35
|
+
#elif defined(_WIN32)
|
36
|
+
#define FFI_SIZEOF_ARG 8
|
37
|
+
typedef unsigned long long ffi_arg;
|
38
|
+
typedef signed long long ffi_sarg;
|
39
|
+
#else
|
40
|
+
typedef unsigned long ffi_arg;
|
41
|
+
typedef signed long ffi_sarg;
|
42
|
+
#endif
|
43
|
+
|
44
|
+
typedef enum ffi_abi
|
45
|
+
{
|
46
|
+
FFI_FIRST_ABI = 0,
|
47
|
+
FFI_SYSV,
|
48
|
+
FFI_WIN64,
|
49
|
+
FFI_LAST_ABI,
|
50
|
+
#if defined(_WIN32)
|
51
|
+
FFI_DEFAULT_ABI = FFI_WIN64
|
52
|
+
#else
|
53
|
+
FFI_DEFAULT_ABI = FFI_SYSV
|
54
|
+
#endif
|
55
|
+
} ffi_abi;
|
56
|
+
#endif
|
57
|
+
|
58
|
+
/* ---- Definitions for closures ----------------------------------------- */
|
59
|
+
|
60
|
+
#define FFI_CLOSURES 1
|
61
|
+
#define FFI_NATIVE_RAW_API 0
|
62
|
+
|
63
|
+
#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE
|
64
|
+
|
65
|
+
#ifdef __MACH__
|
66
|
+
#define FFI_TRAMPOLINE_SIZE 16
|
67
|
+
#define FFI_TRAMPOLINE_CLOSURE_OFFSET 16
|
68
|
+
#else
|
69
|
+
#error "No trampoline table implementation"
|
70
|
+
#endif
|
71
|
+
|
72
|
+
#else
|
73
|
+
#define FFI_TRAMPOLINE_SIZE 24
|
74
|
+
#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
|
75
|
+
#endif
|
76
|
+
|
77
|
+
#ifdef _WIN32
|
78
|
+
#define FFI_EXTRA_CIF_FIELDS unsigned is_variadic
|
79
|
+
#endif
|
80
|
+
#define FFI_TARGET_SPECIFIC_VARIADIC
|
81
|
+
|
82
|
+
/* ---- Internal ---- */
|
83
|
+
|
84
|
+
#if defined (__APPLE__)
|
85
|
+
#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs
|
86
|
+
#elif !defined(_WIN32)
|
87
|
+
/* iOS and Windows reserve x18 for the system. Disable Go closures until
|
88
|
+
a new static chain is chosen. */
|
89
|
+
#define FFI_GO_CLOSURES 1
|
90
|
+
#endif
|
91
|
+
|
92
|
+
#ifndef _WIN32
|
93
|
+
/* No complex type on Windows */
|
94
|
+
#define FFI_TARGET_HAS_COMPLEX_TYPE
|
95
|
+
#endif
|
96
|
+
|
97
|
+
#endif
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/*
|
2
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
3
|
+
a copy of this software and associated documentation files (the
|
4
|
+
``Software''), to deal in the Software without restriction, including
|
5
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
6
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
7
|
+
permit persons to whom the Software is furnished to do so, subject to
|
8
|
+
the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be
|
11
|
+
included in all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
14
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
15
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
16
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
17
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
18
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
19
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
20
|
+
|
21
|
+
#define AARCH64_RET_VOID 0
|
22
|
+
#define AARCH64_RET_INT64 1
|
23
|
+
#define AARCH64_RET_INT128 2
|
24
|
+
|
25
|
+
#define AARCH64_RET_UNUSED3 3
|
26
|
+
#define AARCH64_RET_UNUSED4 4
|
27
|
+
#define AARCH64_RET_UNUSED5 5
|
28
|
+
#define AARCH64_RET_UNUSED6 6
|
29
|
+
#define AARCH64_RET_UNUSED7 7
|
30
|
+
|
31
|
+
/* Note that FFI_TYPE_FLOAT == 2, _DOUBLE == 3, _LONGDOUBLE == 4,
|
32
|
+
so _S4 through _Q1 are layed out as (TYPE * 4) + (4 - COUNT). */
|
33
|
+
#define AARCH64_RET_S4 8
|
34
|
+
#define AARCH64_RET_S3 9
|
35
|
+
#define AARCH64_RET_S2 10
|
36
|
+
#define AARCH64_RET_S1 11
|
37
|
+
|
38
|
+
#define AARCH64_RET_D4 12
|
39
|
+
#define AARCH64_RET_D3 13
|
40
|
+
#define AARCH64_RET_D2 14
|
41
|
+
#define AARCH64_RET_D1 15
|
42
|
+
|
43
|
+
#define AARCH64_RET_Q4 16
|
44
|
+
#define AARCH64_RET_Q3 17
|
45
|
+
#define AARCH64_RET_Q2 18
|
46
|
+
#define AARCH64_RET_Q1 19
|
47
|
+
|
48
|
+
/* Note that each of the sub-64-bit integers gets two entries. */
|
49
|
+
#define AARCH64_RET_UINT8 20
|
50
|
+
#define AARCH64_RET_UINT16 22
|
51
|
+
#define AARCH64_RET_UINT32 24
|
52
|
+
|
53
|
+
#define AARCH64_RET_SINT8 26
|
54
|
+
#define AARCH64_RET_SINT16 28
|
55
|
+
#define AARCH64_RET_SINT32 30
|
56
|
+
|
57
|
+
#define AARCH64_RET_MASK 31
|
58
|
+
|
59
|
+
#define AARCH64_RET_IN_MEM (1 << 5)
|
60
|
+
#define AARCH64_RET_NEED_COPY (1 << 6)
|
61
|
+
|
62
|
+
#define AARCH64_FLAG_ARG_V_BIT 7
|
63
|
+
#define AARCH64_FLAG_ARG_V (1 << AARCH64_FLAG_ARG_V_BIT)
|
64
|
+
#define AARCH64_FLAG_VARARG (1 << 8)
|
65
|
+
|
66
|
+
#define N_X_ARG_REG 8
|
67
|
+
#define N_V_ARG_REG 8
|
68
|
+
#define CALL_CONTEXT_SIZE (N_V_ARG_REG * 16 + N_X_ARG_REG * 8)
|
@@ -0,0 +1,451 @@
|
|
1
|
+
/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
``Software''), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
21
|
+
|
22
|
+
#if defined(__aarch64__) || defined(__arm64__)
|
23
|
+
#define LIBFFI_ASM
|
24
|
+
#include <fficonfig.h>
|
25
|
+
#include <ffi.h>
|
26
|
+
#include <ffi_cfi.h>
|
27
|
+
#include "internal.h"
|
28
|
+
|
29
|
+
#ifdef HAVE_MACHINE_ASM_H
|
30
|
+
#include <machine/asm.h>
|
31
|
+
#else
|
32
|
+
#ifdef __USER_LABEL_PREFIX__
|
33
|
+
#define CONCAT1(a, b) CONCAT2(a, b)
|
34
|
+
#define CONCAT2(a, b) a ## b
|
35
|
+
|
36
|
+
/* Use the right prefix for global labels. */
|
37
|
+
#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
|
38
|
+
#else
|
39
|
+
#define CNAME(x) x
|
40
|
+
#endif
|
41
|
+
#endif
|
42
|
+
|
43
|
+
#ifdef __AARCH64EB__
|
44
|
+
# define BE(X) X
|
45
|
+
#else
|
46
|
+
# define BE(X) 0
|
47
|
+
#endif
|
48
|
+
|
49
|
+
#ifdef __ILP32__
|
50
|
+
#define PTR_REG(n) w##n
|
51
|
+
#else
|
52
|
+
#define PTR_REG(n) x##n
|
53
|
+
#endif
|
54
|
+
|
55
|
+
#ifdef __ILP32__
|
56
|
+
#define PTR_SIZE 4
|
57
|
+
#else
|
58
|
+
#define PTR_SIZE 8
|
59
|
+
#endif
|
60
|
+
|
61
|
+
#if FFI_EXEC_TRAMPOLINE_TABLE && defined(__MACH__) && defined(HAVE_PTRAUTH)
|
62
|
+
# define BR(r) braaz r
|
63
|
+
# define BLR(r) blraaz r
|
64
|
+
#else
|
65
|
+
# define BR(r) br r
|
66
|
+
# define BLR(r) blr r
|
67
|
+
#endif
|
68
|
+
|
69
|
+
.text
|
70
|
+
.align 4
|
71
|
+
|
72
|
+
/* ffi_call_SYSV
|
73
|
+
extern void ffi_call_SYSV (void *stack, void *frame,
|
74
|
+
void (*fn)(void), void *rvalue,
|
75
|
+
int flags, void *closure);
|
76
|
+
|
77
|
+
Therefore on entry we have:
|
78
|
+
|
79
|
+
x0 stack
|
80
|
+
x1 frame
|
81
|
+
x2 fn
|
82
|
+
x3 rvalue
|
83
|
+
x4 flags
|
84
|
+
x5 closure
|
85
|
+
*/
|
86
|
+
|
87
|
+
cfi_startproc
|
88
|
+
CNAME(ffi_call_SYSV):
|
89
|
+
/* Use a stack frame allocated by our caller. */
|
90
|
+
cfi_def_cfa(x1, 32);
|
91
|
+
stp x29, x30, [x1]
|
92
|
+
mov x29, x1
|
93
|
+
mov sp, x0
|
94
|
+
cfi_def_cfa_register(x29)
|
95
|
+
cfi_rel_offset (x29, 0)
|
96
|
+
cfi_rel_offset (x30, 8)
|
97
|
+
|
98
|
+
mov x9, x2 /* save fn */
|
99
|
+
mov x8, x3 /* install structure return */
|
100
|
+
#ifdef FFI_GO_CLOSURES
|
101
|
+
mov x18, x5 /* install static chain */
|
102
|
+
#endif
|
103
|
+
stp x3, x4, [x29, #16] /* save rvalue and flags */
|
104
|
+
|
105
|
+
/* Load the vector argument passing registers, if necessary. */
|
106
|
+
tbz w4, #AARCH64_FLAG_ARG_V_BIT, 1f
|
107
|
+
ldp q0, q1, [sp, #0]
|
108
|
+
ldp q2, q3, [sp, #32]
|
109
|
+
ldp q4, q5, [sp, #64]
|
110
|
+
ldp q6, q7, [sp, #96]
|
111
|
+
1:
|
112
|
+
/* Load the core argument passing registers, including
|
113
|
+
the structure return pointer. */
|
114
|
+
ldp x0, x1, [sp, #16*N_V_ARG_REG + 0]
|
115
|
+
ldp x2, x3, [sp, #16*N_V_ARG_REG + 16]
|
116
|
+
ldp x4, x5, [sp, #16*N_V_ARG_REG + 32]
|
117
|
+
ldp x6, x7, [sp, #16*N_V_ARG_REG + 48]
|
118
|
+
|
119
|
+
/* Deallocate the context, leaving the stacked arguments. */
|
120
|
+
add sp, sp, #CALL_CONTEXT_SIZE
|
121
|
+
|
122
|
+
BLR(x9) /* call fn */
|
123
|
+
|
124
|
+
ldp x3, x4, [x29, #16] /* reload rvalue and flags */
|
125
|
+
|
126
|
+
/* Partially deconstruct the stack frame. */
|
127
|
+
mov sp, x29
|
128
|
+
cfi_def_cfa_register (sp)
|
129
|
+
ldp x29, x30, [x29]
|
130
|
+
|
131
|
+
/* Save the return value as directed. */
|
132
|
+
adr x5, 0f
|
133
|
+
and w4, w4, #AARCH64_RET_MASK
|
134
|
+
add x5, x5, x4, lsl #3
|
135
|
+
br x5
|
136
|
+
|
137
|
+
/* Note that each table entry is 2 insns, and thus 8 bytes.
|
138
|
+
For integer data, note that we're storing into ffi_arg
|
139
|
+
and therefore we want to extend to 64 bits; these types
|
140
|
+
have two consecutive entries allocated for them. */
|
141
|
+
.align 4
|
142
|
+
0: ret /* VOID */
|
143
|
+
nop
|
144
|
+
1: str x0, [x3] /* INT64 */
|
145
|
+
ret
|
146
|
+
2: stp x0, x1, [x3] /* INT128 */
|
147
|
+
ret
|
148
|
+
3: brk #1000 /* UNUSED */
|
149
|
+
ret
|
150
|
+
4: brk #1000 /* UNUSED */
|
151
|
+
ret
|
152
|
+
5: brk #1000 /* UNUSED */
|
153
|
+
ret
|
154
|
+
6: brk #1000 /* UNUSED */
|
155
|
+
ret
|
156
|
+
7: brk #1000 /* UNUSED */
|
157
|
+
ret
|
158
|
+
8: st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] /* S4 */
|
159
|
+
ret
|
160
|
+
9: st3 { v0.s, v1.s, v2.s }[0], [x3] /* S3 */
|
161
|
+
ret
|
162
|
+
10: stp s0, s1, [x3] /* S2 */
|
163
|
+
ret
|
164
|
+
11: str s0, [x3] /* S1 */
|
165
|
+
ret
|
166
|
+
12: st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] /* D4 */
|
167
|
+
ret
|
168
|
+
13: st3 { v0.d, v1.d, v2.d }[0], [x3] /* D3 */
|
169
|
+
ret
|
170
|
+
14: stp d0, d1, [x3] /* D2 */
|
171
|
+
ret
|
172
|
+
15: str d0, [x3] /* D1 */
|
173
|
+
ret
|
174
|
+
16: str q3, [x3, #48] /* Q4 */
|
175
|
+
nop
|
176
|
+
17: str q2, [x3, #32] /* Q3 */
|
177
|
+
nop
|
178
|
+
18: stp q0, q1, [x3] /* Q2 */
|
179
|
+
ret
|
180
|
+
19: str q0, [x3] /* Q1 */
|
181
|
+
ret
|
182
|
+
20: uxtb w0, w0 /* UINT8 */
|
183
|
+
str x0, [x3]
|
184
|
+
21: ret /* reserved */
|
185
|
+
nop
|
186
|
+
22: uxth w0, w0 /* UINT16 */
|
187
|
+
str x0, [x3]
|
188
|
+
23: ret /* reserved */
|
189
|
+
nop
|
190
|
+
24: mov w0, w0 /* UINT32 */
|
191
|
+
str x0, [x3]
|
192
|
+
25: ret /* reserved */
|
193
|
+
nop
|
194
|
+
26: sxtb x0, w0 /* SINT8 */
|
195
|
+
str x0, [x3]
|
196
|
+
27: ret /* reserved */
|
197
|
+
nop
|
198
|
+
28: sxth x0, w0 /* SINT16 */
|
199
|
+
str x0, [x3]
|
200
|
+
29: ret /* reserved */
|
201
|
+
nop
|
202
|
+
30: sxtw x0, w0 /* SINT32 */
|
203
|
+
str x0, [x3]
|
204
|
+
31: ret /* reserved */
|
205
|
+
nop
|
206
|
+
|
207
|
+
cfi_endproc
|
208
|
+
|
209
|
+
.globl CNAME(ffi_call_SYSV)
|
210
|
+
FFI_HIDDEN(CNAME(ffi_call_SYSV))
|
211
|
+
#ifdef __ELF__
|
212
|
+
.type CNAME(ffi_call_SYSV), #function
|
213
|
+
.size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
|
214
|
+
#endif
|
215
|
+
|
216
|
+
/* ffi_closure_SYSV
|
217
|
+
|
218
|
+
Closure invocation glue. This is the low level code invoked directly by
|
219
|
+
the closure trampoline to setup and call a closure.
|
220
|
+
|
221
|
+
On entry x17 points to a struct ffi_closure, x16 has been clobbered
|
222
|
+
all other registers are preserved.
|
223
|
+
|
224
|
+
We allocate a call context and save the argument passing registers,
|
225
|
+
then invoked the generic C ffi_closure_SYSV_inner() function to do all
|
226
|
+
the real work, on return we load the result passing registers back from
|
227
|
+
the call context.
|
228
|
+
*/
|
229
|
+
|
230
|
+
#define ffi_closure_SYSV_FS (8*2 + CALL_CONTEXT_SIZE + 64)
|
231
|
+
|
232
|
+
.align 4
|
233
|
+
CNAME(ffi_closure_SYSV_V):
|
234
|
+
cfi_startproc
|
235
|
+
stp x29, x30, [sp, #-ffi_closure_SYSV_FS]!
|
236
|
+
cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
|
237
|
+
cfi_rel_offset (x29, 0)
|
238
|
+
cfi_rel_offset (x30, 8)
|
239
|
+
|
240
|
+
/* Save the argument passing vector registers. */
|
241
|
+
stp q0, q1, [sp, #16 + 0]
|
242
|
+
stp q2, q3, [sp, #16 + 32]
|
243
|
+
stp q4, q5, [sp, #16 + 64]
|
244
|
+
stp q6, q7, [sp, #16 + 96]
|
245
|
+
b 0f
|
246
|
+
cfi_endproc
|
247
|
+
|
248
|
+
.globl CNAME(ffi_closure_SYSV_V)
|
249
|
+
FFI_HIDDEN(CNAME(ffi_closure_SYSV_V))
|
250
|
+
#ifdef __ELF__
|
251
|
+
.type CNAME(ffi_closure_SYSV_V), #function
|
252
|
+
.size CNAME(ffi_closure_SYSV_V), . - CNAME(ffi_closure_SYSV_V)
|
253
|
+
#endif
|
254
|
+
|
255
|
+
.align 4
|
256
|
+
cfi_startproc
|
257
|
+
CNAME(ffi_closure_SYSV):
|
258
|
+
stp x29, x30, [sp, #-ffi_closure_SYSV_FS]!
|
259
|
+
cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
|
260
|
+
cfi_rel_offset (x29, 0)
|
261
|
+
cfi_rel_offset (x30, 8)
|
262
|
+
0:
|
263
|
+
mov x29, sp
|
264
|
+
|
265
|
+
/* Save the argument passing core registers. */
|
266
|
+
stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0]
|
267
|
+
stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16]
|
268
|
+
stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32]
|
269
|
+
stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48]
|
270
|
+
|
271
|
+
/* Load ffi_closure_inner arguments. */
|
272
|
+
ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */
|
273
|
+
ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */
|
274
|
+
.Ldo_closure:
|
275
|
+
add x3, sp, #16 /* load context */
|
276
|
+
add x4, sp, #ffi_closure_SYSV_FS /* load stack */
|
277
|
+
add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */
|
278
|
+
mov x6, x8 /* load struct_rval */
|
279
|
+
bl CNAME(ffi_closure_SYSV_inner)
|
280
|
+
|
281
|
+
/* Load the return value as directed. */
|
282
|
+
#if FFI_EXEC_TRAMPOLINE_TABLE && defined(__MACH__) && defined(HAVE_PTRAUTH)
|
283
|
+
autiza x1
|
284
|
+
#endif
|
285
|
+
adr x1, 0f
|
286
|
+
and w0, w0, #AARCH64_RET_MASK
|
287
|
+
add x1, x1, x0, lsl #3
|
288
|
+
add x3, sp, #16+CALL_CONTEXT_SIZE
|
289
|
+
br x1
|
290
|
+
|
291
|
+
/* Note that each table entry is 2 insns, and thus 8 bytes. */
|
292
|
+
.align 4
|
293
|
+
0: b 99f /* VOID */
|
294
|
+
nop
|
295
|
+
1: ldr x0, [x3] /* INT64 */
|
296
|
+
b 99f
|
297
|
+
2: ldp x0, x1, [x3] /* INT128 */
|
298
|
+
b 99f
|
299
|
+
3: brk #1000 /* UNUSED */
|
300
|
+
nop
|
301
|
+
4: brk #1000 /* UNUSED */
|
302
|
+
nop
|
303
|
+
5: brk #1000 /* UNUSED */
|
304
|
+
nop
|
305
|
+
6: brk #1000 /* UNUSED */
|
306
|
+
nop
|
307
|
+
7: brk #1000 /* UNUSED */
|
308
|
+
nop
|
309
|
+
8: ldr s3, [x3, #12] /* S4 */
|
310
|
+
nop
|
311
|
+
9: ldr s2, [x3, #8] /* S3 */
|
312
|
+
nop
|
313
|
+
10: ldp s0, s1, [x3] /* S2 */
|
314
|
+
b 99f
|
315
|
+
11: ldr s0, [x3] /* S1 */
|
316
|
+
b 99f
|
317
|
+
12: ldr d3, [x3, #24] /* D4 */
|
318
|
+
nop
|
319
|
+
13: ldr d2, [x3, #16] /* D3 */
|
320
|
+
nop
|
321
|
+
14: ldp d0, d1, [x3] /* D2 */
|
322
|
+
b 99f
|
323
|
+
15: ldr d0, [x3] /* D1 */
|
324
|
+
b 99f
|
325
|
+
16: ldr q3, [x3, #48] /* Q4 */
|
326
|
+
nop
|
327
|
+
17: ldr q2, [x3, #32] /* Q3 */
|
328
|
+
nop
|
329
|
+
18: ldp q0, q1, [x3] /* Q2 */
|
330
|
+
b 99f
|
331
|
+
19: ldr q0, [x3] /* Q1 */
|
332
|
+
b 99f
|
333
|
+
20: ldrb w0, [x3, #BE(7)] /* UINT8 */
|
334
|
+
b 99f
|
335
|
+
21: brk #1000 /* reserved */
|
336
|
+
nop
|
337
|
+
22: ldrh w0, [x3, #BE(6)] /* UINT16 */
|
338
|
+
b 99f
|
339
|
+
23: brk #1000 /* reserved */
|
340
|
+
nop
|
341
|
+
24: ldr w0, [x3, #BE(4)] /* UINT32 */
|
342
|
+
b 99f
|
343
|
+
25: brk #1000 /* reserved */
|
344
|
+
nop
|
345
|
+
26: ldrsb x0, [x3, #BE(7)] /* SINT8 */
|
346
|
+
b 99f
|
347
|
+
27: brk #1000 /* reserved */
|
348
|
+
nop
|
349
|
+
28: ldrsh x0, [x3, #BE(6)] /* SINT16 */
|
350
|
+
b 99f
|
351
|
+
29: brk #1000 /* reserved */
|
352
|
+
nop
|
353
|
+
30: ldrsw x0, [x3, #BE(4)] /* SINT32 */
|
354
|
+
nop
|
355
|
+
31: /* reserved */
|
356
|
+
99: ldp x29, x30, [sp], #ffi_closure_SYSV_FS
|
357
|
+
cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS)
|
358
|
+
cfi_restore (x29)
|
359
|
+
cfi_restore (x30)
|
360
|
+
ret
|
361
|
+
cfi_endproc
|
362
|
+
|
363
|
+
.globl CNAME(ffi_closure_SYSV)
|
364
|
+
FFI_HIDDEN(CNAME(ffi_closure_SYSV))
|
365
|
+
#ifdef __ELF__
|
366
|
+
.type CNAME(ffi_closure_SYSV), #function
|
367
|
+
.size CNAME(ffi_closure_SYSV), . - CNAME(ffi_closure_SYSV)
|
368
|
+
#endif
|
369
|
+
|
370
|
+
#if FFI_EXEC_TRAMPOLINE_TABLE
|
371
|
+
|
372
|
+
#ifdef __MACH__
|
373
|
+
#include <mach/machine/vm_param.h>
|
374
|
+
.align PAGE_MAX_SHIFT
|
375
|
+
CNAME(ffi_closure_trampoline_table_page):
|
376
|
+
.rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE
|
377
|
+
adr x16, -PAGE_MAX_SIZE
|
378
|
+
ldp x17, x16, [x16]
|
379
|
+
BR(x16)
|
380
|
+
nop /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller than 16 bytes */
|
381
|
+
.endr
|
382
|
+
|
383
|
+
.globl CNAME(ffi_closure_trampoline_table_page)
|
384
|
+
FFI_HIDDEN(CNAME(ffi_closure_trampoline_table_page))
|
385
|
+
#ifdef __ELF__
|
386
|
+
.type CNAME(ffi_closure_trampoline_table_page), #function
|
387
|
+
.size CNAME(ffi_closure_trampoline_table_page), . - CNAME(ffi_closure_trampoline_table_page)
|
388
|
+
#endif
|
389
|
+
#endif
|
390
|
+
|
391
|
+
#endif /* FFI_EXEC_TRAMPOLINE_TABLE */
|
392
|
+
|
393
|
+
#ifdef FFI_GO_CLOSURES
|
394
|
+
.align 4
|
395
|
+
CNAME(ffi_go_closure_SYSV_V):
|
396
|
+
cfi_startproc
|
397
|
+
stp x29, x30, [sp, #-ffi_closure_SYSV_FS]!
|
398
|
+
cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
|
399
|
+
cfi_rel_offset (x29, 0)
|
400
|
+
cfi_rel_offset (x30, 8)
|
401
|
+
|
402
|
+
/* Save the argument passing vector registers. */
|
403
|
+
stp q0, q1, [sp, #16 + 0]
|
404
|
+
stp q2, q3, [sp, #16 + 32]
|
405
|
+
stp q4, q5, [sp, #16 + 64]
|
406
|
+
stp q6, q7, [sp, #16 + 96]
|
407
|
+
b 0f
|
408
|
+
cfi_endproc
|
409
|
+
|
410
|
+
.globl CNAME(ffi_go_closure_SYSV_V)
|
411
|
+
FFI_HIDDEN(CNAME(ffi_go_closure_SYSV_V))
|
412
|
+
#ifdef __ELF__
|
413
|
+
.type CNAME(ffi_go_closure_SYSV_V), #function
|
414
|
+
.size CNAME(ffi_go_closure_SYSV_V), . - CNAME(ffi_go_closure_SYSV_V)
|
415
|
+
#endif
|
416
|
+
|
417
|
+
.align 4
|
418
|
+
cfi_startproc
|
419
|
+
CNAME(ffi_go_closure_SYSV):
|
420
|
+
stp x29, x30, [sp, #-ffi_closure_SYSV_FS]!
|
421
|
+
cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
|
422
|
+
cfi_rel_offset (x29, 0)
|
423
|
+
cfi_rel_offset (x30, 8)
|
424
|
+
0:
|
425
|
+
mov x29, sp
|
426
|
+
|
427
|
+
/* Save the argument passing core registers. */
|
428
|
+
stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0]
|
429
|
+
stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16]
|
430
|
+
stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32]
|
431
|
+
stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48]
|
432
|
+
|
433
|
+
/* Load ffi_closure_inner arguments. */
|
434
|
+
ldp PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */
|
435
|
+
mov x2, x18 /* load user_data */
|
436
|
+
b .Ldo_closure
|
437
|
+
cfi_endproc
|
438
|
+
|
439
|
+
.globl CNAME(ffi_go_closure_SYSV)
|
440
|
+
FFI_HIDDEN(CNAME(ffi_go_closure_SYSV))
|
441
|
+
#ifdef __ELF__
|
442
|
+
.type CNAME(ffi_go_closure_SYSV), #function
|
443
|
+
.size CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV)
|
444
|
+
#endif
|
445
|
+
#endif /* FFI_GO_CLOSURES */
|
446
|
+
#endif /* __arm64__ */
|
447
|
+
|
448
|
+
#if defined __ELF__ && defined __linux__
|
449
|
+
.section .note.GNU-stack,"",%progbits
|
450
|
+
#endif
|
451
|
+
|