ffi 1.15.4 → 1.16.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +90 -0
- data/Gemfile +1 -1
- data/README.md +3 -2
- data/Rakefile +28 -11
- data/ext/ffi_c/AbstractMemory.c +60 -36
- data/ext/ffi_c/AbstractMemory.h +3 -2
- data/ext/ffi_c/ArrayType.c +49 -13
- data/ext/ffi_c/ArrayType.h +1 -0
- data/ext/ffi_c/Buffer.c +86 -29
- data/ext/ffi_c/Call.c +18 -7
- data/ext/ffi_c/DynamicLibrary.c +89 -26
- data/ext/ffi_c/Function.c +244 -98
- data/ext/ffi_c/Function.h +1 -0
- data/ext/ffi_c/FunctionInfo.c +80 -24
- data/ext/ffi_c/LastError.c +25 -7
- data/ext/ffi_c/MappedType.c +66 -23
- data/ext/ffi_c/MappedType.h +0 -2
- data/ext/ffi_c/MemoryPointer.c +34 -7
- data/ext/ffi_c/MethodHandle.c +3 -1
- data/ext/ffi_c/Pointer.c +68 -29
- data/ext/ffi_c/Pointer.h +1 -0
- data/ext/ffi_c/Struct.c +155 -80
- data/ext/ffi_c/Struct.h +7 -4
- data/ext/ffi_c/StructByValue.c +48 -16
- data/ext/ffi_c/StructLayout.c +117 -48
- data/ext/ffi_c/Type.c +104 -36
- data/ext/ffi_c/Type.h +3 -1
- data/ext/ffi_c/Types.c +1 -1
- data/ext/ffi_c/Variadic.c +65 -23
- data/ext/ffi_c/compat.h +22 -22
- data/ext/ffi_c/extconf.rb +19 -2
- data/ext/ffi_c/ffi.c +4 -0
- data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
- data/ext/ffi_c/libffi/.appveyor.yml +27 -9
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/build-in-container.sh +4 -6
- data/ext/ffi_c/libffi/.ci/build.sh +124 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/install.sh +14 -7
- data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/site.exp +5 -3
- data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
- data/ext/ffi_c/libffi/.github/workflows/build.yml +460 -0
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +171 -0
- data/ext/ffi_c/libffi/.gitignore +10 -2
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/Makefile.am +12 -5
- data/ext/ffi_c/libffi/Makefile.in +92 -34
- data/ext/ffi_c/libffi/README.md +144 -104
- data/ext/ffi_c/libffi/acinclude.m4 +10 -112
- data/ext/ffi_c/libffi/compile +348 -0
- data/ext/ffi_c/libffi/config.guess +623 -556
- data/ext/ffi_c/libffi/config.sub +75 -34
- data/ext/ffi_c/libffi/configure +4567 -3822
- data/ext/ffi_c/libffi/configure.ac +64 -28
- data/ext/ffi_c/libffi/configure.host +25 -6
- data/ext/ffi_c/libffi/doc/Makefile.in +9 -6
- data/ext/ffi_c/libffi/doc/libffi.texi +82 -33
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +12 -47
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +163 -52
- data/ext/ffi_c/libffi/include/Makefile.am +1 -1
- data/ext/ffi_c/libffi/include/Makefile.in +10 -9
- data/ext/ffi_c/libffi/include/ffi.h.in +54 -50
- data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +29 -0
- data/ext/ffi_c/libffi/include/tramp.h +45 -0
- data/ext/ffi_c/libffi/libtool-version +2 -2
- data/ext/ffi_c/libffi/ltmain.sh +512 -315
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -45
- data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
- data/ext/ffi_c/libffi/man/Makefile.in +9 -6
- data/ext/ffi_c/libffi/missing +1 -1
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +1 -1
- data/ext/ffi_c/libffi/msvcc.sh +1 -1
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +146 -42
- data/ext/ffi_c/libffi/src/aarch64/internal.h +32 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +134 -42
- data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
- data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +62 -17
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +3 -3
- data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +113 -42
- data/ext/ffi_c/libffi/src/closures.c +133 -47
- data/ext/ffi_c/libffi/src/dlmalloc.c +5 -0
- data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +621 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
- data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
- data/ext/ffi_c/libffi/src/mips/ffi.c +240 -65
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +7 -0
- data/ext/ffi_c/libffi/src/mips/n32.S +137 -28
- data/ext/ffi_c/libffi/src/mips/o32.S +61 -4
- data/ext/ffi_c/libffi/src/moxie/ffi.c +47 -22
- data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
- data/ext/ffi_c/libffi/src/pa/ffi.c +32 -33
- data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +22 -8
- data/ext/ffi_c/libffi/src/pa/hpux32.S +83 -36
- data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +82 -35
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1 -1
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +2 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +2 -0
- data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +22 -2
- data/ext/ffi_c/libffi/src/riscv/ffi.c +37 -4
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +16 -0
- data/ext/ffi_c/libffi/src/tramp.c +716 -0
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +934 -0
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +99 -37
- data/ext/ffi_c/libffi/src/x86/ffi64.c +67 -12
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +9 -5
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +43 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +172 -38
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +91 -88
- data/ext/ffi_c/libffi/src/x86/unix64.S +96 -6
- data/ext/ffi_c/libffi/src/x86/win64.S +20 -7
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
- data/ext/ffi_c/libffi/testsuite/Makefile.am +127 -114
- data/ext/ffi_c/libffi/testsuite/Makefile.in +136 -120
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +80 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +43 -21
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +3 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +21 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +6 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +18 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +29 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +21 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +35 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +19 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +18 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +29 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +28 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +24 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +39 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +25 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +14 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +14 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +14 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +20 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +40 -25
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +40 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +18 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +18 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +3 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +11 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +22 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +5 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +6 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +6 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +5 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -138
- data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +21 -21
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +32 -9
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +12 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +21 -5
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +10 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +10 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +9 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +9 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +9 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +6 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +2 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +1 -0
- data/ext/ffi_c/libffi.bsd.mk +2 -2
- data/ext/ffi_c/libffi.gnu.mk +2 -2
- data/ext/ffi_c/rbffi.h +1 -1
- data/ffi.gemspec +3 -3
- data/lib/ffi/autopointer.rb +7 -22
- data/lib/ffi/compat.rb +43 -0
- data/lib/ffi/data_converter.rb +2 -2
- data/lib/ffi/dynamic_library.rb +89 -0
- data/lib/ffi/enum.rb +18 -11
- data/lib/ffi/ffi.rb +3 -0
- data/lib/ffi/function.rb +71 -0
- data/lib/ffi/library.rb +55 -71
- data/lib/ffi/library_path.rb +109 -0
- data/lib/ffi/managedstruct.rb +1 -1
- data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
- data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
- data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
- data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- data/lib/ffi/platform.rb +15 -13
- data/lib/ffi/struct.rb +2 -1
- data/lib/ffi/struct_layout.rb +1 -1
- data/lib/ffi/struct_layout_builder.rb +1 -1
- data/lib/ffi/tools/const_generator.rb +5 -4
- data/lib/ffi/types.rb +32 -6
- data/lib/ffi/variadic.rb +19 -8
- data/lib/ffi/version.rb +1 -1
- data/rakelib/ffi_gem_helper.rb +1 -1
- data/samples/hello_ractor.rb +11 -0
- data/samples/qsort_ractor.rb +28 -0
- data.tar.gz.sig +0 -0
- metadata +103 -28
- metadata.gz.sig +0 -0
- data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +0 -14
- data/ext/ffi_c/libffi/.travis/build.sh +0 -142
- data/ext/ffi_c/libffi/.travis.yml +0 -83
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +0 -44
- /data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/bfin-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/m32r-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/or1k-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/powerpc-eabisim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/wine-sim.exp +0 -0
- /data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
- /data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +0 -0
@@ -40,6 +40,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
40
40
|
#endif
|
41
41
|
#endif
|
42
42
|
|
43
|
+
#ifdef __APPLE__
|
44
|
+
# define L(X) CONCAT1(L, X)
|
45
|
+
#else
|
46
|
+
# define L(X) CONCAT1(.L, X)
|
47
|
+
#endif
|
48
|
+
|
43
49
|
#ifdef __AARCH64EB__
|
44
50
|
# define BE(X) X
|
45
51
|
#else
|
@@ -56,14 +62,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
56
62
|
#define PTR_SIZE 4
|
57
63
|
#else
|
58
64
|
#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
65
|
#endif
|
68
66
|
|
69
67
|
.text
|
@@ -86,9 +84,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
86
84
|
|
87
85
|
cfi_startproc
|
88
86
|
CNAME(ffi_call_SYSV):
|
87
|
+
/* Sign the lr with x1 since that is where it will be stored */
|
88
|
+
SIGN_LR_WITH_REG(x1)
|
89
|
+
|
89
90
|
/* Use a stack frame allocated by our caller. */
|
90
|
-
|
91
|
+
#if defined(HAVE_PTRAUTH) && defined(__APPLE__)
|
92
|
+
/* darwin's libunwind assumes that the cfa is the sp and that's the data
|
93
|
+
* used to sign the lr. In order to allow unwinding through this
|
94
|
+
* function it is necessary to point the cfa at the signing register.
|
95
|
+
*/
|
96
|
+
cfi_def_cfa(x1, 0);
|
97
|
+
#else
|
98
|
+
cfi_def_cfa(x1, 40);
|
99
|
+
#endif
|
91
100
|
stp x29, x30, [x1]
|
101
|
+
mov x9, sp
|
102
|
+
str x9, [x1, #32]
|
92
103
|
mov x29, x1
|
93
104
|
mov sp, x0
|
94
105
|
cfi_def_cfa_register(x29)
|
@@ -119,13 +130,15 @@ CNAME(ffi_call_SYSV):
|
|
119
130
|
/* Deallocate the context, leaving the stacked arguments. */
|
120
131
|
add sp, sp, #CALL_CONTEXT_SIZE
|
121
132
|
|
122
|
-
|
133
|
+
BRANCH_AND_LINK_TO_REG x9 /* call fn */
|
123
134
|
|
124
135
|
ldp x3, x4, [x29, #16] /* reload rvalue and flags */
|
125
136
|
|
126
137
|
/* Partially deconstruct the stack frame. */
|
127
|
-
|
138
|
+
ldr x9, [x29, #32]
|
139
|
+
mov sp, x9
|
128
140
|
cfi_def_cfa_register (sp)
|
141
|
+
mov x2, x29 /* Preserve for auth */
|
129
142
|
ldp x29, x30, [x29]
|
130
143
|
|
131
144
|
/* Save the return value as directed. */
|
@@ -139,71 +152,76 @@ CNAME(ffi_call_SYSV):
|
|
139
152
|
and therefore we want to extend to 64 bits; these types
|
140
153
|
have two consecutive entries allocated for them. */
|
141
154
|
.align 4
|
142
|
-
0:
|
155
|
+
0: b 99f /* VOID */
|
143
156
|
nop
|
144
157
|
1: str x0, [x3] /* INT64 */
|
145
|
-
|
158
|
+
b 99f
|
146
159
|
2: stp x0, x1, [x3] /* INT128 */
|
147
|
-
|
160
|
+
b 99f
|
148
161
|
3: brk #1000 /* UNUSED */
|
149
|
-
|
162
|
+
b 99f
|
150
163
|
4: brk #1000 /* UNUSED */
|
151
|
-
|
164
|
+
b 99f
|
152
165
|
5: brk #1000 /* UNUSED */
|
153
|
-
|
166
|
+
b 99f
|
154
167
|
6: brk #1000 /* UNUSED */
|
155
|
-
|
168
|
+
b 99f
|
156
169
|
7: brk #1000 /* UNUSED */
|
157
|
-
|
170
|
+
b 99f
|
158
171
|
8: st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] /* S4 */
|
159
|
-
|
172
|
+
b 99f
|
160
173
|
9: st3 { v0.s, v1.s, v2.s }[0], [x3] /* S3 */
|
161
|
-
|
174
|
+
b 99f
|
162
175
|
10: stp s0, s1, [x3] /* S2 */
|
163
|
-
|
176
|
+
b 99f
|
164
177
|
11: str s0, [x3] /* S1 */
|
165
|
-
|
178
|
+
b 99f
|
166
179
|
12: st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] /* D4 */
|
167
|
-
|
180
|
+
b 99f
|
168
181
|
13: st3 { v0.d, v1.d, v2.d }[0], [x3] /* D3 */
|
169
|
-
|
182
|
+
b 99f
|
170
183
|
14: stp d0, d1, [x3] /* D2 */
|
171
|
-
|
184
|
+
b 99f
|
172
185
|
15: str d0, [x3] /* D1 */
|
173
|
-
|
186
|
+
b 99f
|
174
187
|
16: str q3, [x3, #48] /* Q4 */
|
175
188
|
nop
|
176
189
|
17: str q2, [x3, #32] /* Q3 */
|
177
190
|
nop
|
178
191
|
18: stp q0, q1, [x3] /* Q2 */
|
179
|
-
|
192
|
+
b 99f
|
180
193
|
19: str q0, [x3] /* Q1 */
|
181
|
-
|
194
|
+
b 99f
|
182
195
|
20: uxtb w0, w0 /* UINT8 */
|
183
196
|
str x0, [x3]
|
184
|
-
21:
|
197
|
+
21: b 99f /* reserved */
|
185
198
|
nop
|
186
199
|
22: uxth w0, w0 /* UINT16 */
|
187
200
|
str x0, [x3]
|
188
|
-
23:
|
201
|
+
23: b 99f /* reserved */
|
189
202
|
nop
|
190
203
|
24: mov w0, w0 /* UINT32 */
|
191
204
|
str x0, [x3]
|
192
|
-
25:
|
205
|
+
25: b 99f /* reserved */
|
193
206
|
nop
|
194
207
|
26: sxtb x0, w0 /* SINT8 */
|
195
208
|
str x0, [x3]
|
196
|
-
27:
|
209
|
+
27: b 99f /* reserved */
|
197
210
|
nop
|
198
211
|
28: sxth x0, w0 /* SINT16 */
|
199
212
|
str x0, [x3]
|
200
|
-
29:
|
213
|
+
29: b 99f /* reserved */
|
201
214
|
nop
|
202
215
|
30: sxtw x0, w0 /* SINT32 */
|
203
216
|
str x0, [x3]
|
204
|
-
31:
|
217
|
+
31: b 99f /* reserved */
|
205
218
|
nop
|
206
219
|
|
220
|
+
/* Return now that result has been populated. */
|
221
|
+
99:
|
222
|
+
AUTH_LR_WITH_REG(x2)
|
223
|
+
ret
|
224
|
+
|
207
225
|
cfi_endproc
|
208
226
|
|
209
227
|
.globl CNAME(ffi_call_SYSV)
|
@@ -213,6 +231,8 @@ CNAME(ffi_call_SYSV):
|
|
213
231
|
.size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
|
214
232
|
#endif
|
215
233
|
|
234
|
+
#if FFI_CLOSURES
|
235
|
+
|
216
236
|
/* ffi_closure_SYSV
|
217
237
|
|
218
238
|
Closure invocation glue. This is the low level code invoked directly by
|
@@ -232,6 +252,7 @@ CNAME(ffi_call_SYSV):
|
|
232
252
|
.align 4
|
233
253
|
CNAME(ffi_closure_SYSV_V):
|
234
254
|
cfi_startproc
|
255
|
+
SIGN_LR
|
235
256
|
stp x29, x30, [sp, #-ffi_closure_SYSV_FS]!
|
236
257
|
cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
|
237
258
|
cfi_rel_offset (x29, 0)
|
@@ -255,6 +276,7 @@ CNAME(ffi_closure_SYSV_V):
|
|
255
276
|
.align 4
|
256
277
|
cfi_startproc
|
257
278
|
CNAME(ffi_closure_SYSV):
|
279
|
+
SIGN_LR
|
258
280
|
stp x29, x30, [sp, #-ffi_closure_SYSV_FS]!
|
259
281
|
cfi_adjust_cfa_offset (ffi_closure_SYSV_FS)
|
260
282
|
cfi_rel_offset (x29, 0)
|
@@ -271,7 +293,9 @@ CNAME(ffi_closure_SYSV):
|
|
271
293
|
/* Load ffi_closure_inner arguments. */
|
272
294
|
ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */
|
273
295
|
ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */
|
274
|
-
|
296
|
+
#ifdef FFI_GO_CLOSURES
|
297
|
+
L(do_closure):
|
298
|
+
#endif
|
275
299
|
add x3, sp, #16 /* load context */
|
276
300
|
add x4, sp, #ffi_closure_SYSV_FS /* load stack */
|
277
301
|
add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */
|
@@ -279,9 +303,6 @@ CNAME(ffi_closure_SYSV):
|
|
279
303
|
bl CNAME(ffi_closure_SYSV_inner)
|
280
304
|
|
281
305
|
/* Load the return value as directed. */
|
282
|
-
#if FFI_EXEC_TRAMPOLINE_TABLE && defined(__MACH__) && defined(HAVE_PTRAUTH)
|
283
|
-
autiza x1
|
284
|
-
#endif
|
285
306
|
adr x1, 0f
|
286
307
|
and w0, w0, #AARCH64_RET_MASK
|
287
308
|
add x1, x1, x0, lsl #3
|
@@ -357,7 +378,7 @@ CNAME(ffi_closure_SYSV):
|
|
357
378
|
cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS)
|
358
379
|
cfi_restore (x29)
|
359
380
|
cfi_restore (x30)
|
360
|
-
|
381
|
+
AUTH_LR_AND_RET
|
361
382
|
cfi_endproc
|
362
383
|
|
363
384
|
.globl CNAME(ffi_closure_SYSV)
|
@@ -367,6 +388,76 @@ CNAME(ffi_closure_SYSV):
|
|
367
388
|
.size CNAME(ffi_closure_SYSV), . - CNAME(ffi_closure_SYSV)
|
368
389
|
#endif
|
369
390
|
|
391
|
+
#if defined(FFI_EXEC_STATIC_TRAMP)
|
392
|
+
.align 4
|
393
|
+
CNAME(ffi_closure_SYSV_V_alt):
|
394
|
+
/* See the comments above trampoline_code_table. */
|
395
|
+
ldr x17, [sp, #8] /* Load closure in x17 */
|
396
|
+
add sp, sp, #16 /* Restore the stack */
|
397
|
+
b CNAME(ffi_closure_SYSV_V)
|
398
|
+
|
399
|
+
.globl CNAME(ffi_closure_SYSV_V_alt)
|
400
|
+
FFI_HIDDEN(CNAME(ffi_closure_SYSV_V_alt))
|
401
|
+
#ifdef __ELF__
|
402
|
+
.type CNAME(ffi_closure_SYSV_V_alt), #function
|
403
|
+
.size CNAME(ffi_closure_SYSV_V_alt), . - CNAME(ffi_closure_SYSV_V_alt)
|
404
|
+
#endif
|
405
|
+
|
406
|
+
.align 4
|
407
|
+
CNAME(ffi_closure_SYSV_alt):
|
408
|
+
/* See the comments above trampoline_code_table. */
|
409
|
+
ldr x17, [sp, #8] /* Load closure in x17 */
|
410
|
+
add sp, sp, #16 /* Restore the stack */
|
411
|
+
b CNAME(ffi_closure_SYSV)
|
412
|
+
|
413
|
+
.globl CNAME(ffi_closure_SYSV_alt)
|
414
|
+
FFI_HIDDEN(CNAME(ffi_closure_SYSV_alt))
|
415
|
+
#ifdef __ELF__
|
416
|
+
.type CNAME(ffi_closure_SYSV_alt), #function
|
417
|
+
.size CNAME(ffi_closure_SYSV_alt), . - CNAME(ffi_closure_SYSV_alt)
|
418
|
+
#endif
|
419
|
+
|
420
|
+
/*
|
421
|
+
* Below is the definition of the trampoline code table. Each element in
|
422
|
+
* the code table is a trampoline.
|
423
|
+
*/
|
424
|
+
/*
|
425
|
+
* The trampoline uses register x17. It saves the original value of x17 on
|
426
|
+
* the stack.
|
427
|
+
*
|
428
|
+
* The trampoline has two parameters - target code to jump to and data for
|
429
|
+
* the target code. The trampoline extracts the parameters from its parameter
|
430
|
+
* block (see tramp_table_map()). The trampoline saves the data address on
|
431
|
+
* the stack. Finally, it jumps to the target code.
|
432
|
+
*
|
433
|
+
* The target code can choose to:
|
434
|
+
*
|
435
|
+
* - restore the value of x17
|
436
|
+
* - load the data address in a register
|
437
|
+
* - restore the stack pointer to what it was when the trampoline was invoked.
|
438
|
+
*/
|
439
|
+
.align AARCH64_TRAMP_MAP_SHIFT
|
440
|
+
CNAME(trampoline_code_table):
|
441
|
+
.rept AARCH64_TRAMP_MAP_SIZE / AARCH64_TRAMP_SIZE
|
442
|
+
sub sp, sp, #16 /* Make space on the stack */
|
443
|
+
str x17, [sp] /* Save x17 on stack */
|
444
|
+
adr x17, #16376 /* Get data address */
|
445
|
+
ldr x17, [x17] /* Copy data into x17 */
|
446
|
+
str x17, [sp, #8] /* Save data on stack */
|
447
|
+
adr x17, #16372 /* Get code address */
|
448
|
+
ldr x17, [x17] /* Load code address into x17 */
|
449
|
+
br x17 /* Jump to code */
|
450
|
+
.endr
|
451
|
+
|
452
|
+
.globl CNAME(trampoline_code_table)
|
453
|
+
FFI_HIDDEN(CNAME(trampoline_code_table))
|
454
|
+
#ifdef __ELF__
|
455
|
+
.type CNAME(trampoline_code_table), #function
|
456
|
+
.size CNAME(trampoline_code_table), . - CNAME(trampoline_code_table)
|
457
|
+
#endif
|
458
|
+
.align AARCH64_TRAMP_MAP_SHIFT
|
459
|
+
#endif /* FFI_EXEC_STATIC_TRAMP */
|
460
|
+
|
370
461
|
#if FFI_EXEC_TRAMPOLINE_TABLE
|
371
462
|
|
372
463
|
#ifdef __MACH__
|
@@ -376,7 +467,7 @@ CNAME(ffi_closure_trampoline_table_page):
|
|
376
467
|
.rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE
|
377
468
|
adr x16, -PAGE_MAX_SIZE
|
378
469
|
ldp x17, x16, [x16]
|
379
|
-
|
470
|
+
br x16
|
380
471
|
nop /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller than 16 bytes */
|
381
472
|
.endr
|
382
473
|
|
@@ -433,7 +524,7 @@ CNAME(ffi_go_closure_SYSV):
|
|
433
524
|
/* Load ffi_closure_inner arguments. */
|
434
525
|
ldp PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */
|
435
526
|
mov x2, x18 /* load user_data */
|
436
|
-
b
|
527
|
+
b L(do_closure)
|
437
528
|
cfi_endproc
|
438
529
|
|
439
530
|
.globl CNAME(ffi_go_closure_SYSV)
|
@@ -443,6 +534,7 @@ CNAME(ffi_go_closure_SYSV):
|
|
443
534
|
.size CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV)
|
444
535
|
#endif
|
445
536
|
#endif /* FFI_GO_CLOSURES */
|
537
|
+
#endif /* FFI_CLOSURES */
|
446
538
|
#endif /* __arm64__ */
|
447
539
|
|
448
540
|
#if defined __ELF__ && defined __linux__
|
@@ -33,103 +33,178 @@
|
|
33
33
|
#define ENTRY(x) .globl CNAME(x)` .type CNAME(x),%function` CNAME(x):
|
34
34
|
#endif
|
35
35
|
|
36
|
+
#if __SIZEOF_POINTER__ == 8
|
37
|
+
#define PTRS 8
|
38
|
+
#define FLTS 8
|
39
|
+
#define LARG ldl
|
40
|
+
#define SARG stl
|
41
|
+
#define ADDPTR addl
|
42
|
+
#define MOVPTR movl_s
|
43
|
+
#else
|
44
|
+
#define PTRS 4
|
45
|
+
#define FLTS 4
|
46
|
+
#define LARG ld
|
47
|
+
#define SARG st
|
48
|
+
#define ADDPTR add
|
49
|
+
#define MOVPTR mov_s
|
50
|
+
#endif
|
51
|
+
|
52
|
+
#define FRAME_LEN (8 * PTRS + 16)
|
53
|
+
|
36
54
|
.text
|
37
55
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
/* R3: fig->flags */
|
42
|
-
/* R4: ecif.rvalue */
|
43
|
-
/* R5: fn */
|
44
|
-
ENTRY(ffi_call_ARCompact)
|
56
|
+
ENTRY(ffi_call_asm)
|
57
|
+
.cfi_startproc
|
58
|
+
|
45
59
|
/* Save registers. */
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
/*
|
58
|
-
|
59
|
-
/*
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
/* Move first 8 parameters in registers... */
|
69
|
-
ld_s r0, [sp]
|
70
|
-
ld_s r1, [sp, 4]
|
71
|
-
ld_s r2, [sp, 8]
|
72
|
-
ld_s r3, [sp, 12]
|
73
|
-
ld r4, [sp, 16]
|
74
|
-
ld r5, [sp, 20]
|
75
|
-
ld r6, [sp, 24]
|
76
|
-
ld r7, [sp, 28]
|
77
|
-
|
78
|
-
/* ...and adjust the stack. */
|
79
|
-
min r12, r12, 32
|
60
|
+
.cfi_def_cfa r1, FRAME_LEN
|
61
|
+
SARG fp, [r1, FRAME_LEN - 2*PTRS]
|
62
|
+
.cfi_offset fp, -2*PTRS
|
63
|
+
SARG blink, [r1, FRAME_LEN - 1*PTRS]
|
64
|
+
.cfi_offset blink, -1*PTRS
|
65
|
+
ADDPTR fp, r1, FRAME_LEN
|
66
|
+
MOVPTR sp, r0
|
67
|
+
.cfi_def_cfa fp, 0
|
68
|
+
|
69
|
+
/* Load arguments. */
|
70
|
+
MOVPTR r11, r2 /* fn */
|
71
|
+
MOVPTR r12, r3 /* closure */
|
72
|
+
|
73
|
+
/* Save arguments. */
|
74
|
+
LARG r0, [fp, -FRAME_LEN+0*PTRS]
|
75
|
+
LARG r1, [fp, -FRAME_LEN+1*PTRS]
|
76
|
+
LARG r2, [fp, -FRAME_LEN+2*PTRS]
|
77
|
+
LARG r3, [fp, -FRAME_LEN+3*PTRS]
|
78
|
+
LARG r4, [fp, -FRAME_LEN+4*PTRS]
|
79
|
+
LARG r5, [fp, -FRAME_LEN+5*PTRS]
|
80
|
+
LARG r6, [fp, -FRAME_LEN+6*PTRS]
|
81
|
+
LARG r7, [fp, -FRAME_LEN+7*PTRS]
|
80
82
|
|
81
83
|
/* Call the function. */
|
82
|
-
jl
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
ENTRY(
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
/*
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
84
|
+
jl [r11]
|
85
|
+
|
86
|
+
/* Save return value (r0/r1) */
|
87
|
+
SARG r0, [fp, -FRAME_LEN+0*PTRS]
|
88
|
+
SARG r1, [fp, -FRAME_LEN+1*PTRS]
|
89
|
+
|
90
|
+
/* Restore and return. */
|
91
|
+
add sp, fp, -FRAME_LEN
|
92
|
+
.cfi_def_cfa sp, FRAME_LEN
|
93
|
+
LARG blink, [fp, -1*PTRS]
|
94
|
+
.cfi_restore blink
|
95
|
+
LARG fp, [fp, -2*PTRS]
|
96
|
+
.cfi_restore fp
|
97
|
+
j_s [blink]
|
98
|
+
.cfi_endproc
|
99
|
+
.size ffi_call_asm, .-ffi_call_asm
|
100
|
+
|
101
|
+
/*
|
102
|
+
ffi_closure_asm. Expects address of the passed-in ffi_closure in r8.
|
103
|
+
void ffi_closure_inner (ffi_cif *cif,
|
104
|
+
void (*fun) (ffi_cif *, void *, void **, void *),
|
105
|
+
void *user_data,
|
106
|
+
size_t *stackargs, struct call_context *regargs)
|
107
|
+
*/
|
108
|
+
|
109
|
+
ENTRY(ffi_closure_asm)
|
110
|
+
.cfi_startproc
|
111
|
+
|
112
|
+
ADDPTR sp, sp, -FRAME_LEN
|
113
|
+
.cfi_def_cfa_offset FRAME_LEN
|
114
|
+
|
115
|
+
/* Make a frame. */
|
116
|
+
SARG fp, [sp, FRAME_LEN-2*PTRS]
|
117
|
+
.cfi_offset fp, -2*PTRS
|
118
|
+
SARG blink, [sp, FRAME_LEN-1*PTRS]
|
119
|
+
.cfi_offset blink, -1*PTRS
|
120
|
+
ADDPTR fp, sp, FRAME_LEN
|
121
|
+
|
122
|
+
/* Save arguments. */
|
123
|
+
SARG r0, [sp, 0*PTRS]
|
124
|
+
SARG r1, [sp, 1*PTRS]
|
125
|
+
SARG r2, [sp, 2*PTRS]
|
126
|
+
SARG r3, [sp, 3*PTRS]
|
127
|
+
SARG r4, [sp, 4*PTRS]
|
128
|
+
SARG r5, [sp, 5*PTRS]
|
129
|
+
SARG r6, [sp, 6*PTRS]
|
130
|
+
SARG r7, [sp, 7*PTRS]
|
131
|
+
|
132
|
+
/* Enter C. */
|
133
|
+
LARG r0, [r8, FFI_TRAMPOLINE_SIZE+0*PTRS]
|
134
|
+
LARG r1, [r8, FFI_TRAMPOLINE_SIZE+1*PTRS]
|
135
|
+
LARG r2, [r8, FFI_TRAMPOLINE_SIZE+2*PTRS]
|
136
|
+
ADDPTR r3, sp, FRAME_LEN
|
137
|
+
MOVPTR r4, sp
|
138
|
+
|
139
|
+
/* Call the C code. */
|
140
|
+
bl ffi_closure_inner
|
125
141
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
142
|
+
/* Return values. */
|
143
|
+
LARG r0, [sp, 0*PTRS]
|
144
|
+
LARG r1, [sp, 1*PTRS]
|
145
|
+
|
146
|
+
/* Restore and return. */
|
147
|
+
LARG blink, [sp, FRAME_LEN-1*PTRS]
|
148
|
+
.cfi_restore blink
|
149
|
+
LARG fp, [sp, FRAME_LEN-2*PTRS]
|
150
|
+
.cfi_restore fp
|
151
|
+
ADDPTR sp, sp, FRAME_LEN
|
152
|
+
.cfi_def_cfa_offset 0
|
153
|
+
j_s [blink]
|
154
|
+
.cfi_endproc
|
155
|
+
.size ffi_closure_asm, .-ffi_closure_asm
|
156
|
+
|
157
|
+
/*
|
158
|
+
ffi_go_closure_asm. Expects address of the passed-in ffi_go_closure in r12.
|
159
|
+
void ffi_closure_inner (ffi_cif *cif,
|
160
|
+
void (*fun) (ffi_cif *, void *, void **, void *),
|
161
|
+
void *user_data,
|
162
|
+
size_t *stackargs, struct call_context *regargs)
|
163
|
+
*/
|
164
|
+
|
165
|
+
ENTRY(ffi_go_closure_asm)
|
166
|
+
.cfi_startproc
|
167
|
+
|
168
|
+
ADDPTR sp, sp, -FRAME_LEN
|
169
|
+
.cfi_def_cfa_offset FRAME_LEN
|
170
|
+
|
171
|
+
/* make a frame */
|
172
|
+
SARG fp, [sp, FRAME_LEN-2*PTRS]
|
173
|
+
.cfi_offset fp, -2*PTRS
|
174
|
+
SARG blink, [sp, FRAME_LEN-1*PTRS]
|
175
|
+
.cfi_offset blink, -1*PTRS
|
176
|
+
ADDPTR fp, sp, FRAME_LEN
|
177
|
+
|
178
|
+
/* save arguments */
|
179
|
+
SARG r0, [sp, 0*PTRS]
|
180
|
+
SARG r1, [sp, 1*PTRS]
|
181
|
+
SARG r2, [sp, 2*PTRS]
|
182
|
+
SARG r3, [sp, 3*PTRS]
|
183
|
+
SARG r4, [sp, 4*PTRS]
|
184
|
+
SARG r5, [sp, 5*PTRS]
|
185
|
+
SARG r6, [sp, 6*PTRS]
|
186
|
+
SARG r7, [sp, 7*PTRS]
|
187
|
+
|
188
|
+
/* enter C */
|
189
|
+
LARG r0, [r12, 1*PTRS]
|
190
|
+
LARG r1, [r12, 2*PTRS]
|
191
|
+
MOVPTR r2, r12
|
192
|
+
ADDPTR r3, sp, FRAME_LEN
|
193
|
+
MOVPTR r4, sp
|
194
|
+
|
195
|
+
bl ffi_closure_inner
|
196
|
+
|
197
|
+
/* Return values. */
|
198
|
+
LARG r0, [sp, 0*PTRS]
|
199
|
+
LARG r1, [sp, 1*PTRS]
|
200
|
+
|
201
|
+
|
202
|
+
LARG blink, [sp, FRAME_LEN-1*PTRS]
|
203
|
+
.cfi_restore blink
|
204
|
+
LARG fp, [sp, FRAME_LEN-2*PTRS]
|
205
|
+
.cfi_restore fp
|
206
|
+
ADDPTR sp, sp, FRAME_LEN
|
207
|
+
.cfi_def_cfa_offset 0
|
208
|
+
j_s [blink]
|
209
|
+
.cfi_endproc
|
210
|
+
.size ffi_go_closure_asm, .-ffi_go_closure_asm
|