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
@@ -37,35 +37,43 @@
|
|
37
37
|
#define flags a3
|
38
38
|
#define raddr a4
|
39
39
|
#define fn a5
|
40
|
+
#define closure a6
|
40
41
|
|
41
|
-
|
42
|
+
/* Note: to keep stack 16 byte aligned we need even number slots
|
43
|
+
used 9 slots here
|
44
|
+
*/
|
45
|
+
#define SIZEOF_FRAME ( 10 * FFI_SIZEOF_ARG )
|
42
46
|
|
43
47
|
#ifdef __GNUC__
|
44
48
|
.abicalls
|
49
|
+
#endif
|
50
|
+
#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
|
51
|
+
.set mips4
|
45
52
|
#endif
|
46
53
|
.text
|
47
54
|
.align 2
|
48
55
|
.globl ffi_call_N32
|
49
56
|
.ent ffi_call_N32
|
50
57
|
ffi_call_N32:
|
51
|
-
.
|
58
|
+
.LFB0:
|
52
59
|
.frame $fp, SIZEOF_FRAME, ra
|
53
60
|
.mask 0xc0000000,-FFI_SIZEOF_ARG
|
54
61
|
.fmask 0x00000000,0
|
55
62
|
|
56
63
|
# Prologue
|
57
64
|
SUBU $sp, SIZEOF_FRAME # Frame size
|
58
|
-
.
|
65
|
+
.LCFI00:
|
59
66
|
REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer
|
60
67
|
REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address
|
61
|
-
.
|
68
|
+
.LCFI01:
|
62
69
|
move $fp, $sp
|
63
|
-
.
|
70
|
+
.LCFI02:
|
64
71
|
move t9, callback # callback function pointer
|
65
72
|
REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes
|
66
73
|
REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags
|
67
74
|
REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr
|
68
75
|
REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn
|
76
|
+
REG_S closure, 6*FFI_SIZEOF_ARG($fp) # closure
|
69
77
|
|
70
78
|
# Allocate at least 4 words in the argstack
|
71
79
|
move v0, bytes
|
@@ -106,11 +114,19 @@ loadregs:
|
|
106
114
|
|
107
115
|
REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6.
|
108
116
|
|
117
|
+
#ifdef __mips_soft_float
|
118
|
+
REG_L a0, 0*FFI_SIZEOF_ARG(t9)
|
119
|
+
REG_L a1, 1*FFI_SIZEOF_ARG(t9)
|
120
|
+
REG_L a2, 2*FFI_SIZEOF_ARG(t9)
|
121
|
+
REG_L a3, 3*FFI_SIZEOF_ARG(t9)
|
122
|
+
REG_L a4, 4*FFI_SIZEOF_ARG(t9)
|
123
|
+
REG_L a5, 5*FFI_SIZEOF_ARG(t9)
|
124
|
+
REG_L a6, 6*FFI_SIZEOF_ARG(t9)
|
125
|
+
REG_L a7, 7*FFI_SIZEOF_ARG(t9)
|
126
|
+
#else
|
109
127
|
and t4, t6, ((1<<FFI_FLAG_BITS)-1)
|
110
|
-
bnez t4, arg1_floatp
|
111
128
|
REG_L a0, 0*FFI_SIZEOF_ARG(t9)
|
112
|
-
|
113
|
-
arg1_floatp:
|
129
|
+
beqz t4, arg1_next
|
114
130
|
bne t4, FFI_TYPE_FLOAT, arg1_doublep
|
115
131
|
l.s $f12, 0*FFI_SIZEOF_ARG(t9)
|
116
132
|
b arg1_next
|
@@ -120,10 +136,8 @@ arg1_next:
|
|
120
136
|
|
121
137
|
SRL t4, t6, 1*FFI_FLAG_BITS
|
122
138
|
and t4, ((1<<FFI_FLAG_BITS)-1)
|
123
|
-
bnez t4, arg2_floatp
|
124
139
|
REG_L a1, 1*FFI_SIZEOF_ARG(t9)
|
125
|
-
|
126
|
-
arg2_floatp:
|
140
|
+
beqz t4, arg2_next
|
127
141
|
bne t4, FFI_TYPE_FLOAT, arg2_doublep
|
128
142
|
l.s $f13, 1*FFI_SIZEOF_ARG(t9)
|
129
143
|
b arg2_next
|
@@ -133,10 +147,8 @@ arg2_next:
|
|
133
147
|
|
134
148
|
SRL t4, t6, 2*FFI_FLAG_BITS
|
135
149
|
and t4, ((1<<FFI_FLAG_BITS)-1)
|
136
|
-
bnez t4, arg3_floatp
|
137
150
|
REG_L a2, 2*FFI_SIZEOF_ARG(t9)
|
138
|
-
|
139
|
-
arg3_floatp:
|
151
|
+
beqz t4, arg3_next
|
140
152
|
bne t4, FFI_TYPE_FLOAT, arg3_doublep
|
141
153
|
l.s $f14, 2*FFI_SIZEOF_ARG(t9)
|
142
154
|
b arg3_next
|
@@ -146,10 +158,8 @@ arg3_next:
|
|
146
158
|
|
147
159
|
SRL t4, t6, 3*FFI_FLAG_BITS
|
148
160
|
and t4, ((1<<FFI_FLAG_BITS)-1)
|
149
|
-
bnez t4, arg4_floatp
|
150
161
|
REG_L a3, 3*FFI_SIZEOF_ARG(t9)
|
151
|
-
|
152
|
-
arg4_floatp:
|
162
|
+
beqz t4, arg4_next
|
153
163
|
bne t4, FFI_TYPE_FLOAT, arg4_doublep
|
154
164
|
l.s $f15, 3*FFI_SIZEOF_ARG(t9)
|
155
165
|
b arg4_next
|
@@ -159,10 +169,8 @@ arg4_next:
|
|
159
169
|
|
160
170
|
SRL t4, t6, 4*FFI_FLAG_BITS
|
161
171
|
and t4, ((1<<FFI_FLAG_BITS)-1)
|
162
|
-
bnez t4, arg5_floatp
|
163
172
|
REG_L a4, 4*FFI_SIZEOF_ARG(t9)
|
164
|
-
|
165
|
-
arg5_floatp:
|
173
|
+
beqz t4, arg5_next
|
166
174
|
bne t4, FFI_TYPE_FLOAT, arg5_doublep
|
167
175
|
l.s $f16, 4*FFI_SIZEOF_ARG(t9)
|
168
176
|
b arg5_next
|
@@ -172,10 +180,8 @@ arg5_next:
|
|
172
180
|
|
173
181
|
SRL t4, t6, 5*FFI_FLAG_BITS
|
174
182
|
and t4, ((1<<FFI_FLAG_BITS)-1)
|
175
|
-
bnez t4, arg6_floatp
|
176
183
|
REG_L a5, 5*FFI_SIZEOF_ARG(t9)
|
177
|
-
|
178
|
-
arg6_floatp:
|
184
|
+
beqz t4, arg6_next
|
179
185
|
bne t4, FFI_TYPE_FLOAT, arg6_doublep
|
180
186
|
l.s $f17, 5*FFI_SIZEOF_ARG(t9)
|
181
187
|
b arg6_next
|
@@ -185,10 +191,8 @@ arg6_next:
|
|
185
191
|
|
186
192
|
SRL t4, t6, 6*FFI_FLAG_BITS
|
187
193
|
and t4, ((1<<FFI_FLAG_BITS)-1)
|
188
|
-
bnez t4, arg7_floatp
|
189
194
|
REG_L a6, 6*FFI_SIZEOF_ARG(t9)
|
190
|
-
|
191
|
-
arg7_floatp:
|
195
|
+
beqz t4, arg7_next
|
192
196
|
bne t4, FFI_TYPE_FLOAT, arg7_doublep
|
193
197
|
l.s $f18, 6*FFI_SIZEOF_ARG(t9)
|
194
198
|
b arg7_next
|
@@ -198,21 +202,23 @@ arg7_next:
|
|
198
202
|
|
199
203
|
SRL t4, t6, 7*FFI_FLAG_BITS
|
200
204
|
and t4, ((1<<FFI_FLAG_BITS)-1)
|
201
|
-
bnez t4, arg8_floatp
|
202
205
|
REG_L a7, 7*FFI_SIZEOF_ARG(t9)
|
203
|
-
|
204
|
-
arg8_floatp:
|
206
|
+
beqz t4, arg8_next
|
205
207
|
bne t4, FFI_TYPE_FLOAT, arg8_doublep
|
206
208
|
l.s $f19, 7*FFI_SIZEOF_ARG(t9)
|
207
209
|
b arg8_next
|
208
210
|
arg8_doublep:
|
209
211
|
l.d $f19, 7*FFI_SIZEOF_ARG(t9)
|
210
212
|
arg8_next:
|
213
|
+
#endif
|
211
214
|
|
212
215
|
callit:
|
213
216
|
# Load the function pointer
|
214
217
|
REG_L t9, 5*FFI_SIZEOF_ARG($fp)
|
215
218
|
|
219
|
+
# install the static chain(t7=$15)
|
220
|
+
REG_L t7, 6*FFI_SIZEOF_ARG($fp)
|
221
|
+
|
216
222
|
# If the return value pointer is NULL, assume no return value.
|
217
223
|
REG_L t5, 4*FFI_SIZEOF_ARG($fp)
|
218
224
|
beqz t5, noretval
|
@@ -229,6 +235,7 @@ retint:
|
|
229
235
|
b epilogue
|
230
236
|
|
231
237
|
retfloat:
|
238
|
+
#ifndef __mips_soft_float
|
232
239
|
bne t6, FFI_TYPE_FLOAT, retdouble
|
233
240
|
jal t9
|
234
241
|
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
@@ -287,6 +294,7 @@ retstruct_f_d:
|
|
287
294
|
s.s $f0, 0(t4)
|
288
295
|
s.d $f2, 8(t4)
|
289
296
|
b epilogue
|
297
|
+
#endif
|
290
298
|
|
291
299
|
retstruct_d_soft:
|
292
300
|
bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
|
@@ -361,7 +369,7 @@ epilogue:
|
|
361
369
|
ADDU $sp, SIZEOF_FRAME # Fix stack pointer
|
362
370
|
j ra
|
363
371
|
|
364
|
-
.
|
372
|
+
.LFE0:
|
365
373
|
.end ffi_call_N32
|
366
374
|
|
367
375
|
/* ffi_closure_N32. Expects address of the passed-in ffi_closure in t0
|
@@ -420,6 +428,41 @@ epilogue:
|
|
420
428
|
#define RA_OFF2 (1 * FFI_SIZEOF_ARG)
|
421
429
|
#define GP_OFF2 (0 * FFI_SIZEOF_ARG)
|
422
430
|
|
431
|
+
.align 2
|
432
|
+
.globl ffi_go_closure_N32
|
433
|
+
.ent ffi_go_closure_N32
|
434
|
+
ffi_go_closure_N32:
|
435
|
+
.LFB1:
|
436
|
+
.frame $sp, SIZEOF_FRAME2, ra
|
437
|
+
.mask 0x90000000,-(SIZEOF_FRAME2 - RA_OFF2)
|
438
|
+
.fmask 0x00000000,0
|
439
|
+
SUBU $sp, SIZEOF_FRAME2
|
440
|
+
.LCFI10:
|
441
|
+
.cpsetup t9, GP_OFF2, ffi_go_closure_N32
|
442
|
+
REG_S ra, RA_OFF2($sp) # Save return address
|
443
|
+
.LCFI11:
|
444
|
+
|
445
|
+
REG_S a0, A0_OFF2($sp)
|
446
|
+
REG_S a1, A1_OFF2($sp)
|
447
|
+
REG_S a2, A2_OFF2($sp)
|
448
|
+
REG_S a3, A3_OFF2($sp)
|
449
|
+
REG_S a4, A4_OFF2($sp)
|
450
|
+
REG_S a5, A5_OFF2($sp)
|
451
|
+
|
452
|
+
# Call ffi_closure_mips_inner_N32 to do the real work.
|
453
|
+
LA t9, ffi_closure_mips_inner_N32
|
454
|
+
REG_L a0, 8($15) # cif
|
455
|
+
REG_L a1, 16($15) # fun
|
456
|
+
move a2, t7 # userdata=closure
|
457
|
+
ADDU a3, $sp, V0_OFF2 # rvalue
|
458
|
+
ADDU a4, $sp, A0_OFF2 # ar
|
459
|
+
ADDU a5, $sp, F12_OFF2 # fpr
|
460
|
+
|
461
|
+
b $do_closure
|
462
|
+
|
463
|
+
.LFE1:
|
464
|
+
.end ffi_go_closure_N32
|
465
|
+
|
423
466
|
.align 2
|
424
467
|
.globl ffi_closure_N32
|
425
468
|
.ent ffi_closure_N32
|
@@ -429,21 +472,33 @@ ffi_closure_N32:
|
|
429
472
|
.mask 0x90000000,-(SIZEOF_FRAME2 - RA_OFF2)
|
430
473
|
.fmask 0x00000000,0
|
431
474
|
SUBU $sp, SIZEOF_FRAME2
|
432
|
-
.
|
475
|
+
.LCFI20:
|
433
476
|
.cpsetup t9, GP_OFF2, ffi_closure_N32
|
434
477
|
REG_S ra, RA_OFF2($sp) # Save return address
|
435
|
-
.
|
436
|
-
# Store all possible argument registers. If there are more than
|
437
|
-
# fit in registers, then they were stored on the stack.
|
478
|
+
.LCFI21:
|
438
479
|
REG_S a0, A0_OFF2($sp)
|
439
480
|
REG_S a1, A1_OFF2($sp)
|
440
481
|
REG_S a2, A2_OFF2($sp)
|
441
482
|
REG_S a3, A3_OFF2($sp)
|
442
483
|
REG_S a4, A4_OFF2($sp)
|
443
484
|
REG_S a5, A5_OFF2($sp)
|
485
|
+
|
486
|
+
# Call ffi_closure_mips_inner_N32 to do the real work.
|
487
|
+
LA t9, ffi_closure_mips_inner_N32
|
488
|
+
REG_L a0, 56($12) # cif
|
489
|
+
REG_L a1, 64($12) # fun
|
490
|
+
REG_L a2, 72($12) # user_data
|
491
|
+
ADDU a3, $sp, V0_OFF2
|
492
|
+
ADDU a4, $sp, A0_OFF2
|
493
|
+
ADDU a5, $sp, F12_OFF2
|
494
|
+
|
495
|
+
$do_closure:
|
496
|
+
# Store all possible argument registers. If there are more than
|
497
|
+
# fit in registers, then they were stored on the stack.
|
444
498
|
REG_S a6, A6_OFF2($sp)
|
445
499
|
REG_S a7, A7_OFF2($sp)
|
446
500
|
|
501
|
+
#ifndef __mips_soft_float
|
447
502
|
# Store all possible float/double registers.
|
448
503
|
s.d $f12, F12_OFF2($sp)
|
449
504
|
s.d $f13, F13_OFF2($sp)
|
@@ -453,13 +508,8 @@ ffi_closure_N32:
|
|
453
508
|
s.d $f17, F17_OFF2($sp)
|
454
509
|
s.d $f18, F18_OFF2($sp)
|
455
510
|
s.d $f19, F19_OFF2($sp)
|
511
|
+
#endif
|
456
512
|
|
457
|
-
# Call ffi_closure_mips_inner_N32 to do the real work.
|
458
|
-
LA t9, ffi_closure_mips_inner_N32
|
459
|
-
move a0, $12 # Pointer to the ffi_closure
|
460
|
-
ADDU a1, $sp, V0_OFF2
|
461
|
-
ADDU a2, $sp, A0_OFF2
|
462
|
-
ADDU a3, $sp, F12_OFF2
|
463
513
|
jalr t9
|
464
514
|
|
465
515
|
# Return flags are in v0
|
@@ -473,6 +523,7 @@ cls_retint:
|
|
473
523
|
b cls_epilogue
|
474
524
|
|
475
525
|
cls_retfloat:
|
526
|
+
#ifndef __mips_soft_float
|
476
527
|
bne v0, FFI_TYPE_FLOAT, cls_retdouble
|
477
528
|
l.s $f0, V0_OFF2($sp)
|
478
529
|
b cls_epilogue
|
@@ -515,6 +566,7 @@ cls_retstruct_f_d:
|
|
515
566
|
l.s $f0, V0_OFF2($sp)
|
516
567
|
l.d $f2, V1_OFF2($sp)
|
517
568
|
b cls_epilogue
|
569
|
+
#endif
|
518
570
|
|
519
571
|
cls_retstruct_small2:
|
520
572
|
REG_L v0, V0_OFF2($sp)
|
@@ -546,46 +598,66 @@ cls_epilogue:
|
|
546
598
|
.align EH_FRAME_ALIGN
|
547
599
|
.LECIE1:
|
548
600
|
|
549
|
-
.
|
550
|
-
.4byte .
|
551
|
-
.
|
552
|
-
.4byte .
|
553
|
-
FDE_ADDR_BYTES .
|
554
|
-
FDE_ADDR_BYTES .
|
601
|
+
.LSFDE0:
|
602
|
+
.4byte .LEFDE0-.LASFDE0 # length.
|
603
|
+
.LASFDE0:
|
604
|
+
.4byte .LASFDE0-.Lframe1 # CIE_pointer.
|
605
|
+
FDE_ADDR_BYTES .LFB0 # initial_location.
|
606
|
+
FDE_ADDR_BYTES .LFE0-.LFB0 # address_range.
|
555
607
|
.byte 0x4 # DW_CFA_advance_loc4
|
556
|
-
.4byte .
|
608
|
+
.4byte .LCFI00-.LFB0 # to .LCFI00
|
557
609
|
.byte 0xe # DW_CFA_def_cfa_offset
|
558
610
|
.uleb128 SIZEOF_FRAME # adjust stack.by SIZEOF_FRAME
|
559
611
|
.byte 0x4 # DW_CFA_advance_loc4
|
560
|
-
.4byte .
|
612
|
+
.4byte .LCFI01-.LCFI00 # to .LCFI01
|
561
613
|
.byte 0x9e # DW_CFA_offset of $fp
|
562
614
|
.uleb128 2*FFI_SIZEOF_ARG/4 #
|
563
615
|
.byte 0x9f # DW_CFA_offset of ra
|
564
616
|
.uleb128 1*FFI_SIZEOF_ARG/4 #
|
565
617
|
.byte 0x4 # DW_CFA_advance_loc4
|
566
|
-
.4byte .
|
618
|
+
.4byte .LCFI02-.LCFI01 # to .LCFI02
|
567
619
|
.byte 0xd # DW_CFA_def_cfa_register
|
568
620
|
.uleb128 0x1e # in $fp
|
569
621
|
.align EH_FRAME_ALIGN
|
622
|
+
.LEFDE0:
|
623
|
+
|
624
|
+
.LSFDE1:
|
625
|
+
.4byte .LEFDE1-.LASFDE1 # length
|
626
|
+
.LASFDE1:
|
627
|
+
.4byte .LASFDE1-.Lframe1 # CIE_pointer.
|
628
|
+
FDE_ADDR_BYTES .LFB1 # initial_location.
|
629
|
+
FDE_ADDR_BYTES .LFE1-.LFB1 # address_range.
|
630
|
+
.byte 0x4 # DW_CFA_advance_loc4
|
631
|
+
.4byte .LCFI10-.LFB1 # to .LCFI10
|
632
|
+
.byte 0xe # DW_CFA_def_cfa_offset
|
633
|
+
.uleb128 SIZEOF_FRAME2 # adjust stack.by SIZEOF_FRAME
|
634
|
+
.byte 0x4 # DW_CFA_advance_loc4
|
635
|
+
.4byte .LCFI11-.LCFI10 # to .LCFI11
|
636
|
+
.byte 0x9c # DW_CFA_offset of $gp ($28)
|
637
|
+
.uleb128 (SIZEOF_FRAME2 - GP_OFF2)/4
|
638
|
+
.byte 0x9f # DW_CFA_offset of ra ($31)
|
639
|
+
.uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
|
640
|
+
.align EH_FRAME_ALIGN
|
570
641
|
.LEFDE1:
|
571
|
-
|
572
|
-
|
573
|
-
.
|
574
|
-
|
642
|
+
|
643
|
+
.LSFDE2:
|
644
|
+
.4byte .LEFDE2-.LASFDE2 # length
|
645
|
+
.LASFDE2:
|
646
|
+
.4byte .LASFDE2-.Lframe1 # CIE_pointer.
|
575
647
|
FDE_ADDR_BYTES .LFB2 # initial_location.
|
576
648
|
FDE_ADDR_BYTES .LFE2-.LFB2 # address_range.
|
577
649
|
.byte 0x4 # DW_CFA_advance_loc4
|
578
|
-
.4byte .
|
650
|
+
.4byte .LCFI20-.LFB2 # to .LCFI20
|
579
651
|
.byte 0xe # DW_CFA_def_cfa_offset
|
580
652
|
.uleb128 SIZEOF_FRAME2 # adjust stack.by SIZEOF_FRAME
|
581
653
|
.byte 0x4 # DW_CFA_advance_loc4
|
582
|
-
.4byte .
|
654
|
+
.4byte .LCFI21-.LCFI20 # to .LCFI21
|
583
655
|
.byte 0x9c # DW_CFA_offset of $gp ($28)
|
584
656
|
.uleb128 (SIZEOF_FRAME2 - GP_OFF2)/4
|
585
657
|
.byte 0x9f # DW_CFA_offset of ra ($31)
|
586
658
|
.uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
|
587
659
|
.align EH_FRAME_ALIGN
|
588
|
-
.
|
660
|
+
.LEFDE2:
|
589
661
|
#endif /* __GNUC__ */
|
590
662
|
|
591
663
|
#endif
|
@@ -50,14 +50,14 @@ ffi_call_O32:
|
|
50
50
|
$LFB0:
|
51
51
|
# Prologue
|
52
52
|
SUBU $sp, SIZEOF_FRAME # Frame size
|
53
|
-
$
|
53
|
+
$LCFI00:
|
54
54
|
REG_S $fp, FP_OFF($sp) # Save frame pointer
|
55
|
-
$
|
55
|
+
$LCFI01:
|
56
56
|
REG_S ra, RA_OFF($sp) # Save return address
|
57
|
-
$
|
57
|
+
$LCFI02:
|
58
58
|
move $fp, $sp
|
59
59
|
|
60
|
-
$
|
60
|
+
$LCFI03:
|
61
61
|
move t9, callback # callback function pointer
|
62
62
|
REG_S flags, A3_OFF($fp) # flags
|
63
63
|
|
@@ -82,13 +82,16 @@ sixteen:
|
|
82
82
|
|
83
83
|
ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args
|
84
84
|
|
85
|
+
#ifndef __mips_soft_float
|
85
86
|
bnez t0, pass_d # make it quick for int
|
87
|
+
#endif
|
86
88
|
REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the
|
87
89
|
REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs.
|
88
90
|
REG_L a2, 2*FFI_SIZEOF_ARG($sp)
|
89
91
|
REG_L a3, 3*FFI_SIZEOF_ARG($sp)
|
90
92
|
b call_it
|
91
93
|
|
94
|
+
#ifndef __mips_soft_float
|
92
95
|
pass_d:
|
93
96
|
bne t0, FFI_ARGS_D, pass_f
|
94
97
|
l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
|
@@ -130,8 +133,12 @@ pass_f_d:
|
|
130
133
|
# bne t0, FFI_ARGS_F_D, call_it
|
131
134
|
l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
|
132
135
|
l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
|
136
|
+
#endif
|
133
137
|
|
134
138
|
call_it:
|
139
|
+
# Load the static chain pointer
|
140
|
+
REG_L t7, SIZEOF_FRAME + 6*FFI_SIZEOF_ARG($fp)
|
141
|
+
|
135
142
|
# Load the function pointer
|
136
143
|
REG_L t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp)
|
137
144
|
|
@@ -158,14 +165,23 @@ retfloat:
|
|
158
165
|
bne t2, FFI_TYPE_FLOAT, retdouble
|
159
166
|
jalr t9
|
160
167
|
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
|
168
|
+
#ifndef __mips_soft_float
|
161
169
|
s.s $f0, 0(t0)
|
170
|
+
#else
|
171
|
+
REG_S v0, 0(t0)
|
172
|
+
#endif
|
162
173
|
b epilogue
|
163
174
|
|
164
175
|
retdouble:
|
165
176
|
bne t2, FFI_TYPE_DOUBLE, noretval
|
166
177
|
jalr t9
|
167
178
|
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
|
179
|
+
#ifndef __mips_soft_float
|
168
180
|
s.d $f0, 0(t0)
|
181
|
+
#else
|
182
|
+
REG_S v1, 4(t0)
|
183
|
+
REG_S v0, 0(t0)
|
184
|
+
#endif
|
169
185
|
b epilogue
|
170
186
|
|
171
187
|
noretval:
|
@@ -204,13 +220,15 @@ $LFE0:
|
|
204
220
|
-8 - f14 (le low, be high)
|
205
221
|
-9 - f12 (le high, be low)
|
206
222
|
-10 - f12 (le low, be high)
|
207
|
-
-11 - Called function
|
208
|
-
-12 - Called function
|
209
|
-
-13 - Called function
|
210
|
-
-14 - Called function
|
223
|
+
-11 - Called function a5 save
|
224
|
+
-12 - Called function a4 save
|
225
|
+
-13 - Called function a3 save
|
226
|
+
-14 - Called function a2 save
|
227
|
+
-15 - Called function a1 save
|
228
|
+
-16 - Called function a0 save, our sp and fp point here
|
211
229
|
*/
|
212
230
|
|
213
|
-
#define SIZEOF_FRAME2 (
|
231
|
+
#define SIZEOF_FRAME2 (16 * FFI_SIZEOF_ARG)
|
214
232
|
#define A3_OFF2 (SIZEOF_FRAME2 + 3 * FFI_SIZEOF_ARG)
|
215
233
|
#define A2_OFF2 (SIZEOF_FRAME2 + 2 * FFI_SIZEOF_ARG)
|
216
234
|
#define A1_OFF2 (SIZEOF_FRAME2 + 1 * FFI_SIZEOF_ARG)
|
@@ -225,13 +243,73 @@ $LFE0:
|
|
225
243
|
#define FA_1_0_OFF2 (SIZEOF_FRAME2 - 8 * FFI_SIZEOF_ARG)
|
226
244
|
#define FA_0_1_OFF2 (SIZEOF_FRAME2 - 9 * FFI_SIZEOF_ARG)
|
227
245
|
#define FA_0_0_OFF2 (SIZEOF_FRAME2 - 10 * FFI_SIZEOF_ARG)
|
246
|
+
#define CALLED_A5_OFF2 (SIZEOF_FRAME2 - 11 * FFI_SIZEOF_ARG)
|
247
|
+
#define CALLED_A4_OFF2 (SIZEOF_FRAME2 - 12 * FFI_SIZEOF_ARG)
|
228
248
|
|
229
249
|
.text
|
250
|
+
|
251
|
+
.align 2
|
252
|
+
.globl ffi_go_closure_O32
|
253
|
+
.ent ffi_go_closure_O32
|
254
|
+
ffi_go_closure_O32:
|
255
|
+
$LFB1:
|
256
|
+
# Prologue
|
257
|
+
.frame $fp, SIZEOF_FRAME2, ra
|
258
|
+
.set noreorder
|
259
|
+
.cpload t9
|
260
|
+
.set reorder
|
261
|
+
SUBU $sp, SIZEOF_FRAME2
|
262
|
+
.cprestore GP_OFF2
|
263
|
+
$LCFI10:
|
264
|
+
|
265
|
+
REG_S $16, S0_OFF2($sp) # Save s0
|
266
|
+
REG_S $fp, FP_OFF2($sp) # Save frame pointer
|
267
|
+
REG_S ra, RA_OFF2($sp) # Save return address
|
268
|
+
$LCFI11:
|
269
|
+
|
270
|
+
move $fp, $sp
|
271
|
+
$LCFI12:
|
272
|
+
|
273
|
+
REG_S a0, A0_OFF2($fp)
|
274
|
+
REG_S a1, A1_OFF2($fp)
|
275
|
+
REG_S a2, A2_OFF2($fp)
|
276
|
+
REG_S a3, A3_OFF2($fp)
|
277
|
+
|
278
|
+
# Load ABI enum to s0
|
279
|
+
REG_L $16, 4($15) # cif
|
280
|
+
REG_L $16, 0($16) # abi is first member.
|
281
|
+
|
282
|
+
li $13, 1 # FFI_O32
|
283
|
+
bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
|
284
|
+
|
285
|
+
#ifndef __mips_soft_float
|
286
|
+
# Store all possible float/double registers.
|
287
|
+
s.d $f12, FA_0_0_OFF2($fp)
|
288
|
+
s.d $f14, FA_1_0_OFF2($fp)
|
289
|
+
#endif
|
290
|
+
1:
|
291
|
+
# prepare arguments for ffi_closure_mips_inner_O32
|
292
|
+
REG_L a0, 4($15) # cif
|
293
|
+
REG_L a1, 8($15) # fun
|
294
|
+
move a2, $15 # user_data = go closure
|
295
|
+
addu a3, $fp, V0_OFF2 # rvalue
|
296
|
+
|
297
|
+
addu t9, $fp, A0_OFF2 # ar
|
298
|
+
REG_S t9, CALLED_A4_OFF2($fp)
|
299
|
+
|
300
|
+
addu t9, $fp, FA_0_0_OFF2 #fpr
|
301
|
+
REG_S t9, CALLED_A5_OFF2($fp)
|
302
|
+
|
303
|
+
b $do_closure
|
304
|
+
|
305
|
+
$LFE1:
|
306
|
+
.end ffi_go_closure_O32
|
307
|
+
|
230
308
|
.align 2
|
231
309
|
.globl ffi_closure_O32
|
232
310
|
.ent ffi_closure_O32
|
233
311
|
ffi_closure_O32:
|
234
|
-
$
|
312
|
+
$LFB2:
|
235
313
|
# Prologue
|
236
314
|
.frame $fp, SIZEOF_FRAME2, ra
|
237
315
|
.set noreorder
|
@@ -239,14 +317,14 @@ $LFB1:
|
|
239
317
|
.set reorder
|
240
318
|
SUBU $sp, SIZEOF_FRAME2
|
241
319
|
.cprestore GP_OFF2
|
242
|
-
$
|
320
|
+
$LCFI20:
|
243
321
|
REG_S $16, S0_OFF2($sp) # Save s0
|
244
322
|
REG_S $fp, FP_OFF2($sp) # Save frame pointer
|
245
323
|
REG_S ra, RA_OFF2($sp) # Save return address
|
246
|
-
$
|
324
|
+
$LCFI21:
|
247
325
|
move $fp, $sp
|
248
326
|
|
249
|
-
$
|
327
|
+
$LCFI22:
|
250
328
|
# Store all possible argument registers. If there are more than
|
251
329
|
# four arguments, then they are stored above where we put a3.
|
252
330
|
REG_S a0, A0_OFF2($fp)
|
@@ -261,16 +339,27 @@ $LCFI7:
|
|
261
339
|
li $13, 1 # FFI_O32
|
262
340
|
bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
|
263
341
|
|
342
|
+
#ifndef __mips_soft_float
|
264
343
|
# Store all possible float/double registers.
|
265
344
|
s.d $f12, FA_0_0_OFF2($fp)
|
266
345
|
s.d $f14, FA_1_0_OFF2($fp)
|
346
|
+
#endif
|
267
347
|
1:
|
268
|
-
#
|
348
|
+
# prepare arguments for ffi_closure_mips_inner_O32
|
349
|
+
REG_L a0, 20($12) # cif pointer follows tramp.
|
350
|
+
REG_L a1, 24($12) # fun
|
351
|
+
REG_L a2, 28($12) # user_data
|
352
|
+
addu a3, $fp, V0_OFF2 # rvalue
|
353
|
+
|
354
|
+
addu t9, $fp, A0_OFF2 # ar
|
355
|
+
REG_S t9, CALLED_A4_OFF2($fp)
|
356
|
+
|
357
|
+
addu t9, $fp, FA_0_0_OFF2 #fpr
|
358
|
+
REG_S t9, CALLED_A5_OFF2($fp)
|
359
|
+
|
360
|
+
$do_closure:
|
269
361
|
la t9, ffi_closure_mips_inner_O32
|
270
|
-
|
271
|
-
addu a1, $fp, V0_OFF2
|
272
|
-
addu a2, $fp, A0_OFF2
|
273
|
-
addu a3, $fp, FA_0_0_OFF2
|
362
|
+
# Call ffi_closure_mips_inner_O32 to do the work.
|
274
363
|
jalr t9
|
275
364
|
|
276
365
|
# Load the return value into the appropriate register.
|
@@ -281,6 +370,7 @@ $LCFI7:
|
|
281
370
|
li $13, 1 # FFI_O32
|
282
371
|
bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT
|
283
372
|
|
373
|
+
#ifndef __mips_soft_float
|
284
374
|
li $9, FFI_TYPE_FLOAT
|
285
375
|
l.s $f0, V0_OFF2($fp)
|
286
376
|
beq $8, $9, closure_done
|
@@ -288,6 +378,7 @@ $LCFI7:
|
|
288
378
|
li $9, FFI_TYPE_DOUBLE
|
289
379
|
l.d $f0, V0_OFF2($fp)
|
290
380
|
beq $8, $9, closure_done
|
381
|
+
#endif
|
291
382
|
1:
|
292
383
|
REG_L $3, V1_OFF2($fp)
|
293
384
|
REG_L $2, V0_OFF2($fp)
|
@@ -300,7 +391,7 @@ closure_done:
|
|
300
391
|
REG_L ra, RA_OFF2($sp) # Restore return address
|
301
392
|
ADDU $sp, SIZEOF_FRAME2
|
302
393
|
j ra
|
303
|
-
$
|
394
|
+
$LFE2:
|
304
395
|
.end ffi_closure_O32
|
305
396
|
|
306
397
|
/* DWARF-2 unwind info. */
|
@@ -322,6 +413,7 @@ $LSCIE0:
|
|
322
413
|
.uleb128 0x0
|
323
414
|
.align 2
|
324
415
|
$LECIE0:
|
416
|
+
|
325
417
|
$LSFDE0:
|
326
418
|
.4byte $LEFDE0-$LASFDE0 # FDE Length
|
327
419
|
$LASFDE0:
|
@@ -330,11 +422,11 @@ $LASFDE0:
|
|
330
422
|
.4byte $LFE0-$LFB0 # FDE address range
|
331
423
|
.uleb128 0x0 # Augmentation size
|
332
424
|
.byte 0x4 # DW_CFA_advance_loc4
|
333
|
-
.4byte $
|
425
|
+
.4byte $LCFI00-$LFB0
|
334
426
|
.byte 0xe # DW_CFA_def_cfa_offset
|
335
427
|
.uleb128 0x18
|
336
428
|
.byte 0x4 # DW_CFA_advance_loc4
|
337
|
-
.4byte $
|
429
|
+
.4byte $LCFI01-$LCFI00
|
338
430
|
.byte 0x11 # DW_CFA_offset_extended_sf
|
339
431
|
.uleb128 0x1e # $fp
|
340
432
|
.sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp)
|
@@ -342,12 +434,13 @@ $LASFDE0:
|
|
342
434
|
.uleb128 0x1f # $ra
|
343
435
|
.sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
|
344
436
|
.byte 0x4 # DW_CFA_advance_loc4
|
345
|
-
.4byte $
|
437
|
+
.4byte $LCFI02-$LCFI01
|
346
438
|
.byte 0xc # DW_CFA_def_cfa
|
347
439
|
.uleb128 0x1e
|
348
440
|
.uleb128 0x18
|
349
441
|
.align 2
|
350
442
|
$LEFDE0:
|
443
|
+
|
351
444
|
$LSFDE1:
|
352
445
|
.4byte $LEFDE1-$LASFDE1 # FDE Length
|
353
446
|
$LASFDE1:
|
@@ -356,11 +449,11 @@ $LASFDE1:
|
|
356
449
|
.4byte $LFE1-$LFB1 # FDE address range
|
357
450
|
.uleb128 0x0 # Augmentation size
|
358
451
|
.byte 0x4 # DW_CFA_advance_loc4
|
359
|
-
.4byte $
|
452
|
+
.4byte $LCFI10-$LFB1
|
360
453
|
.byte 0xe # DW_CFA_def_cfa_offset
|
361
|
-
.uleb128
|
454
|
+
.uleb128 SIZEOF_FRAME2
|
362
455
|
.byte 0x4 # DW_CFA_advance_loc4
|
363
|
-
.4byte $
|
456
|
+
.4byte $LCFI11-$LCFI10
|
364
457
|
.byte 0x11 # DW_CFA_offset_extended_sf
|
365
458
|
.uleb128 0x10 # $16
|
366
459
|
.sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp)
|
@@ -371,11 +464,41 @@ $LASFDE1:
|
|
371
464
|
.uleb128 0x1f # $ra
|
372
465
|
.sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
|
373
466
|
.byte 0x4 # DW_CFA_advance_loc4
|
374
|
-
.4byte $
|
467
|
+
.4byte $LCFI12-$LCFI11
|
375
468
|
.byte 0xc # DW_CFA_def_cfa
|
376
469
|
.uleb128 0x1e
|
377
|
-
.uleb128
|
470
|
+
.uleb128 SIZEOF_FRAME2
|
378
471
|
.align 2
|
379
472
|
$LEFDE1:
|
380
473
|
|
474
|
+
$LSFDE2:
|
475
|
+
.4byte $LEFDE2-$LASFDE2 # FDE Length
|
476
|
+
$LASFDE2:
|
477
|
+
.4byte $LASFDE2-$Lframe0 # FDE CIE offset
|
478
|
+
.4byte $LFB2 # FDE initial location
|
479
|
+
.4byte $LFE2-$LFB2 # FDE address range
|
480
|
+
.uleb128 0x0 # Augmentation size
|
481
|
+
.byte 0x4 # DW_CFA_advance_loc4
|
482
|
+
.4byte $LCFI20-$LFB2
|
483
|
+
.byte 0xe # DW_CFA_def_cfa_offset
|
484
|
+
.uleb128 SIZEOF_FRAME2
|
485
|
+
.byte 0x4 # DW_CFA_advance_loc4
|
486
|
+
.4byte $LCFI21-$LCFI20
|
487
|
+
.byte 0x11 # DW_CFA_offset_extended_sf
|
488
|
+
.uleb128 0x10 # $16
|
489
|
+
.sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp)
|
490
|
+
.byte 0x11 # DW_CFA_offset_extended_sf
|
491
|
+
.uleb128 0x1e # $fp
|
492
|
+
.sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp)
|
493
|
+
.byte 0x11 # DW_CFA_offset_extended_sf
|
494
|
+
.uleb128 0x1f # $ra
|
495
|
+
.sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
|
496
|
+
.byte 0x4 # DW_CFA_advance_loc4
|
497
|
+
.4byte $LCFI22-$LCFI21
|
498
|
+
.byte 0xc # DW_CFA_def_cfa
|
499
|
+
.uleb128 0x1e
|
500
|
+
.uleb128 SIZEOF_FRAME2
|
501
|
+
.align 2
|
502
|
+
$LEFDE2:
|
503
|
+
|
381
504
|
#endif
|