ffi 1.16.3 → 1.17.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +42 -0
- data/Gemfile +9 -2
- data/README.md +1 -1
- data/Rakefile +17 -5
- data/lib/ffi/autopointer.rb +1 -9
- data/lib/ffi/dynamic_library.rb +34 -5
- data/lib/ffi/enum.rb +0 -1
- data/lib/ffi/function.rb +1 -1
- data/lib/ffi/io.rb +2 -2
- data/lib/ffi/library.rb +23 -23
- data/lib/ffi/platform/aarch64-linux/types.conf +74 -3
- data/lib/ffi/pointer.rb +6 -6
- data/lib/ffi/struct.rb +4 -4
- data/lib/ffi/struct_layout.rb +2 -2
- data/lib/ffi/struct_layout_builder.rb +8 -8
- data/lib/ffi/types.rb +51 -49
- data/lib/ffi/version.rb +1 -1
- data/sig/ffi/abstract_memory.rbs +165 -0
- data/sig/ffi/auto_pointer.rbs +27 -0
- data/sig/ffi/buffer.rbs +18 -0
- data/sig/ffi/data_converter.rbs +10 -0
- data/sig/ffi/dynamic_library.rbs +9 -0
- data/sig/ffi/enum.rbs +38 -0
- data/sig/ffi/function.rbs +39 -0
- data/sig/ffi/library.rbs +42 -0
- data/sig/ffi/native_type.rbs +86 -0
- data/sig/ffi/pointer.rbs +42 -0
- data/sig/ffi/struct.rbs +76 -0
- data/sig/ffi/struct_by_reference.rbs +11 -0
- data/sig/ffi/struct_by_value.rbs +7 -0
- data/sig/ffi/struct_layout.rbs +9 -0
- data/sig/ffi/struct_layout_builder.rbs +5 -0
- data/sig/ffi/type.rbs +39 -0
- data/sig/ffi.rbs +26 -0
- data.tar.gz.sig +0 -0
- metadata +34 -532
- metadata.gz.sig +0 -0
- data/ext/ffi_c/AbstractMemory.c +0 -1128
- data/ext/ffi_c/AbstractMemory.h +0 -176
- data/ext/ffi_c/ArrayType.c +0 -198
- data/ext/ffi_c/ArrayType.h +0 -60
- data/ext/ffi_c/Buffer.c +0 -417
- data/ext/ffi_c/Call.c +0 -498
- data/ext/ffi_c/Call.h +0 -107
- data/ext/ffi_c/ClosurePool.c +0 -333
- data/ext/ffi_c/ClosurePool.h +0 -59
- data/ext/ffi_c/DynamicLibrary.c +0 -397
- data/ext/ffi_c/DynamicLibrary.h +0 -98
- data/ext/ffi_c/Function.c +0 -1063
- data/ext/ffi_c/Function.h +0 -84
- data/ext/ffi_c/FunctionInfo.c +0 -322
- data/ext/ffi_c/LastError.c +0 -243
- data/ext/ffi_c/LastError.h +0 -47
- data/ext/ffi_c/LongDouble.c +0 -65
- data/ext/ffi_c/LongDouble.h +0 -47
- data/ext/ffi_c/MappedType.c +0 -211
- data/ext/ffi_c/MappedType.h +0 -57
- data/ext/ffi_c/MemoryPointer.c +0 -219
- data/ext/ffi_c/MemoryPointer.h +0 -49
- data/ext/ffi_c/MethodHandle.c +0 -350
- data/ext/ffi_c/MethodHandle.h +0 -56
- data/ext/ffi_c/Platform.c +0 -78
- data/ext/ffi_c/Platform.h +0 -45
- data/ext/ffi_c/Pointer.c +0 -546
- data/ext/ffi_c/Pointer.h +0 -60
- data/ext/ffi_c/Struct.c +0 -897
- data/ext/ffi_c/Struct.h +0 -115
- data/ext/ffi_c/StructByValue.c +0 -177
- data/ext/ffi_c/StructByValue.h +0 -55
- data/ext/ffi_c/StructLayout.c +0 -769
- data/ext/ffi_c/Thread.c +0 -129
- data/ext/ffi_c/Thread.h +0 -76
- data/ext/ffi_c/Type.c +0 -447
- data/ext/ffi_c/Type.h +0 -63
- data/ext/ffi_c/Types.c +0 -138
- data/ext/ffi_c/Types.h +0 -88
- data/ext/ffi_c/Variadic.c +0 -345
- data/ext/ffi_c/compat.h +0 -82
- data/ext/ffi_c/extconf.rb +0 -115
- data/ext/ffi_c/ffi.c +0 -97
- data/ext/ffi_c/libffi/.appveyor/site.exp +0 -16
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +0 -7
- data/ext/ffi_c/libffi/.appveyor.yml +0 -84
- data/ext/ffi_c/libffi/.ci/ar-lib +0 -270
- data/ext/ffi_c/libffi/.ci/bfin-sim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +0 -18
- data/ext/ffi_c/libffi/.ci/build-in-container.sh +0 -10
- data/ext/ffi_c/libffi/.ci/build.sh +0 -124
- data/ext/ffi_c/libffi/.ci/compile +0 -351
- data/ext/ffi_c/libffi/.ci/install.sh +0 -78
- data/ext/ffi_c/libffi/.ci/m32r-sim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/moxie-sim.exp +0 -60
- data/ext/ffi_c/libffi/.ci/msvs-detect +0 -1103
- data/ext/ffi_c/libffi/.ci/or1k-sim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +0 -58
- data/ext/ffi_c/libffi/.ci/site.exp +0 -29
- data/ext/ffi_c/libffi/.ci/wine-sim.exp +0 -55
- data/ext/ffi_c/libffi/.circleci/config.yml +0 -156
- data/ext/ffi_c/libffi/.gitattributes +0 -4
- data/ext/ffi_c/libffi/.github/issue_template.md +0 -10
- data/ext/ffi_c/libffi/.github/workflows/build.yml +0 -460
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +0 -171
- data/ext/ffi_c/libffi/.gitignore +0 -46
- data/ext/ffi_c/libffi/ChangeLog.old +0 -7407
- data/ext/ffi_c/libffi/LICENSE +0 -21
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +0 -353
- data/ext/ffi_c/libffi/Makefile.am +0 -157
- data/ext/ffi_c/libffi/Makefile.in +0 -2127
- data/ext/ffi_c/libffi/README.md +0 -526
- data/ext/ffi_c/libffi/acinclude.m4 +0 -377
- data/ext/ffi_c/libffi/autogen.sh +0 -2
- data/ext/ffi_c/libffi/compile +0 -348
- data/ext/ffi_c/libffi/config.guess +0 -1754
- data/ext/ffi_c/libffi/config.sub +0 -1892
- data/ext/ffi_c/libffi/configure +0 -22791
- data/ext/ffi_c/libffi/configure.ac +0 -451
- data/ext/ffi_c/libffi/configure.host +0 -337
- data/ext/ffi_c/libffi/doc/Makefile.am +0 -3
- data/ext/ffi_c/libffi/doc/Makefile.in +0 -818
- data/ext/ffi_c/libffi/doc/libffi.texi +0 -1046
- data/ext/ffi_c/libffi/doc/version.texi +0 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +0 -188
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +0 -312
- data/ext/ffi_c/libffi/include/Makefile.am +0 -9
- data/ext/ffi_c/libffi/include/Makefile.in +0 -609
- data/ext/ffi_c/libffi/include/ffi.h.in +0 -527
- data/ext/ffi_c/libffi/include/ffi_cfi.h +0 -76
- data/ext/ffi_c/libffi/include/ffi_common.h +0 -182
- data/ext/ffi_c/libffi/include/tramp.h +0 -45
- data/ext/ffi_c/libffi/install-sh +0 -541
- data/ext/ffi_c/libffi/libffi.map.in +0 -76
- data/ext/ffi_c/libffi/libffi.pc.in +0 -11
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +0 -997
- data/ext/ffi_c/libffi/libtool-ldflags +0 -106
- data/ext/ffi_c/libffi/libtool-version +0 -29
- data/ext/ffi_c/libffi/ltmain.sh +0 -11448
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +0 -13
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +0 -50
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +0 -198
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +0 -158
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +0 -53
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +0 -119
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +0 -49
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +0 -302
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +0 -267
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +0 -89
- data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +0 -51
- data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +0 -37
- data/ext/ffi_c/libffi/make_sunver.pl +0 -333
- data/ext/ffi_c/libffi/man/Makefile.am +0 -8
- data/ext/ffi_c/libffi/man/Makefile.in +0 -565
- data/ext/ffi_c/libffi/man/ffi.3 +0 -41
- data/ext/ffi_c/libffi/man/ffi_call.3 +0 -103
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +0 -68
- data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +0 -73
- data/ext/ffi_c/libffi/missing +0 -215
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +0 -33
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +0 -130
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +0 -57
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +0 -4
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +0 -511
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +0 -219
- data/ext/ffi_c/libffi/msvcc.sh +0 -353
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +0 -1129
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +0 -97
- data/ext/ffi_c/libffi/src/aarch64/internal.h +0 -100
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +0 -543
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +0 -506
- data/ext/ffi_c/libffi/src/alpha/ffi.c +0 -521
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +0 -57
- data/ext/ffi_c/libffi/src/alpha/internal.h +0 -23
- data/ext/ffi_c/libffi/src/alpha/osf.S +0 -282
- data/ext/ffi_c/libffi/src/arc/arcompact.S +0 -210
- data/ext/ffi_c/libffi/src/arc/ffi.c +0 -443
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +0 -67
- data/ext/ffi_c/libffi/src/arm/ffi.c +0 -921
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +0 -89
- data/ext/ffi_c/libffi/src/arm/internal.h +0 -17
- data/ext/ffi_c/libffi/src/arm/sysv.S +0 -456
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +0 -311
- data/ext/ffi_c/libffi/src/avr32/ffi.c +0 -423
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +0 -55
- data/ext/ffi_c/libffi/src/avr32/sysv.S +0 -208
- data/ext/ffi_c/libffi/src/bfin/ffi.c +0 -196
- data/ext/ffi_c/libffi/src/bfin/ffitarget.h +0 -43
- data/ext/ffi_c/libffi/src/bfin/sysv.S +0 -179
- data/ext/ffi_c/libffi/src/closures.c +0 -1107
- data/ext/ffi_c/libffi/src/cris/ffi.c +0 -386
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +0 -56
- data/ext/ffi_c/libffi/src/cris/sysv.S +0 -215
- data/ext/ffi_c/libffi/src/csky/ffi.c +0 -395
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +0 -63
- data/ext/ffi_c/libffi/src/csky/sysv.S +0 -371
- data/ext/ffi_c/libffi/src/debug.c +0 -64
- data/ext/ffi_c/libffi/src/dlmalloc.c +0 -5171
- data/ext/ffi_c/libffi/src/frv/eabi.S +0 -128
- data/ext/ffi_c/libffi/src/frv/ffi.c +0 -292
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +0 -62
- data/ext/ffi_c/libffi/src/ia64/ffi.c +0 -616
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +0 -56
- data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +0 -40
- data/ext/ffi_c/libffi/src/ia64/unix.S +0 -585
- data/ext/ffi_c/libffi/src/java_raw_api.c +0 -374
- data/ext/ffi_c/libffi/src/kvx/asm.h +0 -5
- data/ext/ffi_c/libffi/src/kvx/ffi.c +0 -273
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +0 -75
- data/ext/ffi_c/libffi/src/kvx/sysv.S +0 -127
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +0 -621
- data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +0 -82
- data/ext/ffi_c/libffi/src/loongarch64/sysv.S +0 -327
- data/ext/ffi_c/libffi/src/m32r/ffi.c +0 -249
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +0 -53
- data/ext/ffi_c/libffi/src/m32r/sysv.S +0 -121
- data/ext/ffi_c/libffi/src/m68k/ffi.c +0 -362
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +0 -54
- data/ext/ffi_c/libffi/src/m68k/sysv.S +0 -357
- data/ext/ffi_c/libffi/src/m88k/ffi.c +0 -400
- data/ext/ffi_c/libffi/src/m88k/ffitarget.h +0 -49
- data/ext/ffi_c/libffi/src/m88k/obsd.S +0 -209
- data/ext/ffi_c/libffi/src/metag/ffi.c +0 -330
- data/ext/ffi_c/libffi/src/metag/ffitarget.h +0 -53
- data/ext/ffi_c/libffi/src/metag/sysv.S +0 -311
- data/ext/ffi_c/libffi/src/microblaze/ffi.c +0 -321
- data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +0 -53
- data/ext/ffi_c/libffi/src/microblaze/sysv.S +0 -302
- data/ext/ffi_c/libffi/src/mips/ffi.c +0 -1309
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +0 -251
- data/ext/ffi_c/libffi/src/mips/n32.S +0 -772
- data/ext/ffi_c/libffi/src/mips/o32.S +0 -561
- data/ext/ffi_c/libffi/src/moxie/eabi.S +0 -101
- data/ext/ffi_c/libffi/src/moxie/ffi.c +0 -310
- data/ext/ffi_c/libffi/src/moxie/ffitarget.h +0 -52
- data/ext/ffi_c/libffi/src/nios2/ffi.c +0 -304
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +0 -52
- data/ext/ffi_c/libffi/src/nios2/sysv.S +0 -136
- data/ext/ffi_c/libffi/src/or1k/ffi.c +0 -341
- data/ext/ffi_c/libffi/src/or1k/ffitarget.h +0 -58
- data/ext/ffi_c/libffi/src/or1k/sysv.S +0 -107
- data/ext/ffi_c/libffi/src/pa/ffi.c +0 -673
- data/ext/ffi_c/libffi/src/pa/ffi64.c +0 -614
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +0 -94
- data/ext/ffi_c/libffi/src/pa/hpux32.S +0 -417
- data/ext/ffi_c/libffi/src/pa/hpux64.S +0 -681
- data/ext/ffi_c/libffi/src/pa/linux.S +0 -427
- data/ext/ffi_c/libffi/src/powerpc/aix.S +0 -566
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +0 -694
- data/ext/ffi_c/libffi/src/powerpc/asm.h +0 -125
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +0 -378
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +0 -571
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +0 -175
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +0 -1452
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +0 -1153
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +0 -105
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +0 -923
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +0 -204
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +0 -293
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +0 -566
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +0 -397
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +0 -173
- data/ext/ffi_c/libffi/src/powerpc/t-aix +0 -5
- data/ext/ffi_c/libffi/src/prep_cif.c +0 -283
- data/ext/ffi_c/libffi/src/raw_api.c +0 -267
- data/ext/ffi_c/libffi/src/riscv/ffi.c +0 -514
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +0 -69
- data/ext/ffi_c/libffi/src/riscv/sysv.S +0 -293
- data/ext/ffi_c/libffi/src/s390/ffi.c +0 -756
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +0 -70
- data/ext/ffi_c/libffi/src/s390/internal.h +0 -11
- data/ext/ffi_c/libffi/src/s390/sysv.S +0 -325
- data/ext/ffi_c/libffi/src/sh/ffi.c +0 -717
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +0 -54
- data/ext/ffi_c/libffi/src/sh/sysv.S +0 -850
- data/ext/ffi_c/libffi/src/sh64/ffi.c +0 -469
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +0 -58
- data/ext/ffi_c/libffi/src/sh64/sysv.S +0 -539
- data/ext/ffi_c/libffi/src/sparc/ffi.c +0 -468
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +0 -624
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +0 -81
- data/ext/ffi_c/libffi/src/sparc/internal.h +0 -26
- data/ext/ffi_c/libffi/src/sparc/v8.S +0 -443
- data/ext/ffi_c/libffi/src/sparc/v9.S +0 -440
- data/ext/ffi_c/libffi/src/tile/ffi.c +0 -355
- data/ext/ffi_c/libffi/src/tile/ffitarget.h +0 -65
- data/ext/ffi_c/libffi/src/tile/tile.S +0 -360
- data/ext/ffi_c/libffi/src/tramp.c +0 -716
- data/ext/ffi_c/libffi/src/types.c +0 -108
- data/ext/ffi_c/libffi/src/vax/elfbsd.S +0 -195
- data/ext/ffi_c/libffi/src/vax/ffi.c +0 -276
- data/ext/ffi_c/libffi/src/vax/ffitarget.h +0 -49
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +0 -934
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +0 -62
- data/ext/ffi_c/libffi/src/x86/asmnames.h +0 -30
- data/ext/ffi_c/libffi/src/x86/ffi.c +0 -832
- data/ext/ffi_c/libffi/src/x86/ffi64.c +0 -950
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +0 -164
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +0 -361
- data/ext/ffi_c/libffi/src/x86/internal.h +0 -43
- data/ext/ffi_c/libffi/src/x86/internal64.h +0 -36
- data/ext/ffi_c/libffi/src/x86/sysv.S +0 -1272
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +0 -998
- data/ext/ffi_c/libffi/src/x86/unix64.S +0 -711
- data/ext/ffi_c/libffi/src/x86/win64.S +0 -254
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +0 -238
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +0 -306
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +0 -57
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +0 -268
- data/ext/ffi_c/libffi/stamp-h.in +0 -1
- data/ext/ffi_c/libffi/testsuite/Makefile.am +0 -135
- data/ext/ffi_c/libffi/testsuite/Makefile.in +0 -664
- data/ext/ffi_c/libffi/testsuite/config/default.exp +0 -1
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +0 -54
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +0 -63
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +0 -80
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +0 -48
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +0 -7
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +0 -51
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +0 -682
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +0 -283
- data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +0 -45
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +0 -28
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +0 -50
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +0 -1746
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +0 -2885
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +0 -747
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +0 -41
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +0 -54
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +0 -26
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +0 -163
- data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +0 -59
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +0 -60
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +0 -74
- data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +0 -62
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +0 -110
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +0 -59
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +0 -57
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +0 -70
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -52
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +0 -127
- data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +0 -59
- data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc_tc.c +0 -114
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +0 -43
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +0 -35
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +0 -34
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +0 -41
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +0 -48
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +0 -38
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +0 -60
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +0 -43
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +0 -55
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +0 -57
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +0 -60
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +0 -64
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +0 -66
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +0 -64
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +0 -74
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +0 -81
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +0 -68
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +0 -65
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +0 -65
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +0 -93
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +0 -90
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +0 -220
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +0 -154
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +0 -134
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +0 -134
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +0 -140
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +0 -67
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +0 -90
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +0 -83
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +0 -83
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +0 -102
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +0 -91
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +0 -94
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +0 -92
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +0 -96
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +0 -61
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +0 -112
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +0 -117
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +0 -131
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +0 -93
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +0 -113
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +0 -145
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +0 -114
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +0 -113
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +0 -137
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +0 -116
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +0 -148
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +0 -140
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +0 -121
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +0 -155
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +0 -121
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +0 -102
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +0 -103
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +0 -111
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +0 -111
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +0 -147
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +0 -152
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +0 -113
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +0 -108
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +0 -106
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +0 -108
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +0 -109
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +0 -111
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +0 -68
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double.c +0 -43
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +0 -69
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +0 -115
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +0 -80
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +0 -70
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +0 -55
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +0 -79
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +0 -94
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +0 -99
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +0 -94
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +0 -79
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +0 -152
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +0 -47
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +0 -45
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +0 -125
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +0 -45
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +0 -47
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +0 -49
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +0 -46
- data/ext/ffi_c/libffi/testsuite/libffi.closures/err_bad_abi.c +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +0 -343
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +0 -175
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +0 -161
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +0 -146
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +0 -137
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +0 -86
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +0 -115
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +0 -119
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +0 -121
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +0 -142
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +0 -120
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +0 -142
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +0 -142
- data/ext/ffi_c/libffi/testsuite/libffi.closures/problem1.c +0 -90
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +0 -86
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +0 -102
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +0 -101
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large.c +0 -145
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_large2.c +0 -148
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +0 -124
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +0 -125
- data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +0 -75
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +0 -118
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +0 -55
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +0 -91
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +0 -42
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +0 -71
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +0 -80
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +0 -16
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +0 -51
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +0 -7
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +0 -7
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +0 -7
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +0 -86
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +0 -78
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +0 -37
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +0 -41
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +0 -10
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +0 -34
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +0 -28
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +0 -36
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +0 -19
- data/ext/ffi_c/libffi.bsd.mk +0 -40
- data/ext/ffi_c/libffi.darwin.mk +0 -105
- data/ext/ffi_c/libffi.gnu.mk +0 -32
- data/ext/ffi_c/libffi.mk +0 -18
- data/ext/ffi_c/libffi.vc.mk +0 -26
- data/ext/ffi_c/libffi.vc64.mk +0 -26
- data/ext/ffi_c/rbffi.h +0 -55
- data/ext/ffi_c/rbffi_endian.h +0 -59
|
@@ -1,772 +0,0 @@
|
|
|
1
|
-
/* -----------------------------------------------------------------------
|
|
2
|
-
n32.S - Copyright (c) 1996, 1998, 2005, 2007, 2009, 2010 Red Hat, Inc.
|
|
3
|
-
|
|
4
|
-
MIPS Foreign Function Interface
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
-
a copy of this software and associated documentation files (the
|
|
8
|
-
``Software''), to deal in the Software without restriction, including
|
|
9
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
-
the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included
|
|
15
|
-
in all copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
24
|
-
DEALINGS IN THE SOFTWARE.
|
|
25
|
-
----------------------------------------------------------------------- */
|
|
26
|
-
|
|
27
|
-
#define LIBFFI_ASM
|
|
28
|
-
#include <fficonfig.h>
|
|
29
|
-
#include <ffi.h>
|
|
30
|
-
|
|
31
|
-
/* Only build this code if we are compiling for n32 */
|
|
32
|
-
|
|
33
|
-
#if defined(FFI_MIPS_N32)
|
|
34
|
-
|
|
35
|
-
#define callback a0
|
|
36
|
-
#define bytes a2
|
|
37
|
-
#define flags a3
|
|
38
|
-
#define raddr a4
|
|
39
|
-
#define fn a5
|
|
40
|
-
#define closure a6
|
|
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 )
|
|
46
|
-
|
|
47
|
-
#ifdef __GNUC__
|
|
48
|
-
.abicalls
|
|
49
|
-
#endif
|
|
50
|
-
#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
|
|
51
|
-
.set mips4
|
|
52
|
-
#endif
|
|
53
|
-
.text
|
|
54
|
-
.align 2
|
|
55
|
-
.globl ffi_call_N32
|
|
56
|
-
.ent ffi_call_N32
|
|
57
|
-
ffi_call_N32:
|
|
58
|
-
.LFB0:
|
|
59
|
-
.frame $fp, SIZEOF_FRAME, ra
|
|
60
|
-
.mask 0xc0000000,-FFI_SIZEOF_ARG
|
|
61
|
-
.fmask 0x00000000,0
|
|
62
|
-
|
|
63
|
-
# Prologue
|
|
64
|
-
SUBU $sp, SIZEOF_FRAME # Frame size
|
|
65
|
-
.LCFI00:
|
|
66
|
-
REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer
|
|
67
|
-
REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address
|
|
68
|
-
.LCFI01:
|
|
69
|
-
move $fp, $sp
|
|
70
|
-
.LCFI02:
|
|
71
|
-
move t9, callback # callback function pointer
|
|
72
|
-
REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes
|
|
73
|
-
REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags
|
|
74
|
-
REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr
|
|
75
|
-
REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn
|
|
76
|
-
REG_S closure, 6*FFI_SIZEOF_ARG($fp) # closure
|
|
77
|
-
|
|
78
|
-
# Allocate at least 4 words in the argstack
|
|
79
|
-
move v0, bytes
|
|
80
|
-
bge bytes, 4 * FFI_SIZEOF_ARG, bigger
|
|
81
|
-
LI v0, 4 * FFI_SIZEOF_ARG
|
|
82
|
-
b sixteen
|
|
83
|
-
|
|
84
|
-
bigger:
|
|
85
|
-
ADDU t4, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned
|
|
86
|
-
and v0, t4, -2 * FFI_SIZEOF_ARG # to a proper boundry.
|
|
87
|
-
|
|
88
|
-
sixteen:
|
|
89
|
-
SUBU $sp, $sp, v0 # move the stack pointer to reflect the
|
|
90
|
-
# arg space
|
|
91
|
-
|
|
92
|
-
move a0, $sp # 4 * FFI_SIZEOF_ARG
|
|
93
|
-
ADDU a3, $fp, 3 * FFI_SIZEOF_ARG
|
|
94
|
-
|
|
95
|
-
# Call ffi_prep_args
|
|
96
|
-
jal t9
|
|
97
|
-
|
|
98
|
-
# Copy the stack pointer to t9
|
|
99
|
-
move t9, $sp
|
|
100
|
-
|
|
101
|
-
# Fix the stack if there are more than 8 64bit slots worth
|
|
102
|
-
# of arguments.
|
|
103
|
-
|
|
104
|
-
# Load the number of bytes
|
|
105
|
-
REG_L t6, 2*FFI_SIZEOF_ARG($fp)
|
|
106
|
-
|
|
107
|
-
# Is it bigger than 8 * FFI_SIZEOF_ARG?
|
|
108
|
-
daddiu t8, t6, -(8 * FFI_SIZEOF_ARG)
|
|
109
|
-
bltz t8, loadregs
|
|
110
|
-
|
|
111
|
-
ADDU t9, t9, t8
|
|
112
|
-
|
|
113
|
-
loadregs:
|
|
114
|
-
|
|
115
|
-
REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6.
|
|
116
|
-
|
|
117
|
-
# when retval is _Complex long double, $f12/$a0, $f13/$a1 will be skipped
|
|
118
|
-
# no idea why, but gcc does it.
|
|
119
|
-
SRL t4, t6, 8*FFI_FLAG_BITS
|
|
120
|
-
move t8, t6
|
|
121
|
-
bne t4, FFI_TYPE_COMPLEX_LDLD, loadregs1
|
|
122
|
-
|
|
123
|
-
SLL t8, t6, 2*FFI_FLAG_BITS
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
loadregs1:
|
|
127
|
-
#ifdef __mips_soft_float
|
|
128
|
-
REG_L a0, 0*FFI_SIZEOF_ARG(t9)
|
|
129
|
-
REG_L a1, 1*FFI_SIZEOF_ARG(t9)
|
|
130
|
-
REG_L a2, 2*FFI_SIZEOF_ARG(t9)
|
|
131
|
-
REG_L a3, 3*FFI_SIZEOF_ARG(t9)
|
|
132
|
-
REG_L a4, 4*FFI_SIZEOF_ARG(t9)
|
|
133
|
-
REG_L a5, 5*FFI_SIZEOF_ARG(t9)
|
|
134
|
-
REG_L a6, 6*FFI_SIZEOF_ARG(t9)
|
|
135
|
-
REG_L a7, 7*FFI_SIZEOF_ARG(t9)
|
|
136
|
-
#else
|
|
137
|
-
and t4, t8, ((1<<FFI_FLAG_BITS)-1)
|
|
138
|
-
REG_L a0, 0*FFI_SIZEOF_ARG(t9)
|
|
139
|
-
beqz t4, arg1_next
|
|
140
|
-
bne t4, FFI_TYPE_FLOAT, arg1_doublep
|
|
141
|
-
l.s $f12, 0*FFI_SIZEOF_ARG(t9)
|
|
142
|
-
b arg1_next
|
|
143
|
-
arg1_doublep:
|
|
144
|
-
l.d $f12, 0*FFI_SIZEOF_ARG(t9)
|
|
145
|
-
arg1_next:
|
|
146
|
-
|
|
147
|
-
SRL t4, t8, 1*FFI_FLAG_BITS
|
|
148
|
-
and t4, ((1<<FFI_FLAG_BITS)-1)
|
|
149
|
-
REG_L a1, 1*FFI_SIZEOF_ARG(t9)
|
|
150
|
-
beqz t4, arg2_next
|
|
151
|
-
bne t4, FFI_TYPE_FLOAT, arg2_doublep
|
|
152
|
-
l.s $f13, 1*FFI_SIZEOF_ARG(t9)
|
|
153
|
-
b arg2_next
|
|
154
|
-
arg2_doublep:
|
|
155
|
-
l.d $f13, 1*FFI_SIZEOF_ARG(t9)
|
|
156
|
-
arg2_next:
|
|
157
|
-
|
|
158
|
-
SRL t4, t8, 2*FFI_FLAG_BITS
|
|
159
|
-
and t4, ((1<<FFI_FLAG_BITS)-1)
|
|
160
|
-
REG_L a2, 2*FFI_SIZEOF_ARG(t9)
|
|
161
|
-
beqz t4, arg3_next
|
|
162
|
-
bne t4, FFI_TYPE_FLOAT, arg3_doublep
|
|
163
|
-
l.s $f14, 2*FFI_SIZEOF_ARG(t9)
|
|
164
|
-
b arg3_next
|
|
165
|
-
arg3_doublep:
|
|
166
|
-
l.d $f14, 2*FFI_SIZEOF_ARG(t9)
|
|
167
|
-
arg3_next:
|
|
168
|
-
|
|
169
|
-
SRL t4, t8, 3*FFI_FLAG_BITS
|
|
170
|
-
and t4, ((1<<FFI_FLAG_BITS)-1)
|
|
171
|
-
REG_L a3, 3*FFI_SIZEOF_ARG(t9)
|
|
172
|
-
beqz t4, arg4_next
|
|
173
|
-
bne t4, FFI_TYPE_FLOAT, arg4_doublep
|
|
174
|
-
l.s $f15, 3*FFI_SIZEOF_ARG(t9)
|
|
175
|
-
b arg4_next
|
|
176
|
-
arg4_doublep:
|
|
177
|
-
l.d $f15, 3*FFI_SIZEOF_ARG(t9)
|
|
178
|
-
arg4_next:
|
|
179
|
-
|
|
180
|
-
SRL t4, t8, 4*FFI_FLAG_BITS
|
|
181
|
-
and t4, ((1<<FFI_FLAG_BITS)-1)
|
|
182
|
-
REG_L a4, 4*FFI_SIZEOF_ARG(t9)
|
|
183
|
-
beqz t4, arg5_next
|
|
184
|
-
bne t4, FFI_TYPE_FLOAT, arg5_doublep
|
|
185
|
-
l.s $f16, 4*FFI_SIZEOF_ARG(t9)
|
|
186
|
-
b arg5_next
|
|
187
|
-
arg5_doublep:
|
|
188
|
-
l.d $f16, 4*FFI_SIZEOF_ARG(t9)
|
|
189
|
-
arg5_next:
|
|
190
|
-
|
|
191
|
-
SRL t4, t8, 5*FFI_FLAG_BITS
|
|
192
|
-
and t4, ((1<<FFI_FLAG_BITS)-1)
|
|
193
|
-
REG_L a5, 5*FFI_SIZEOF_ARG(t9)
|
|
194
|
-
beqz t4, arg6_next
|
|
195
|
-
bne t4, FFI_TYPE_FLOAT, arg6_doublep
|
|
196
|
-
l.s $f17, 5*FFI_SIZEOF_ARG(t9)
|
|
197
|
-
b arg6_next
|
|
198
|
-
arg6_doublep:
|
|
199
|
-
l.d $f17, 5*FFI_SIZEOF_ARG(t9)
|
|
200
|
-
arg6_next:
|
|
201
|
-
|
|
202
|
-
SRL t4, t8, 6*FFI_FLAG_BITS
|
|
203
|
-
and t4, ((1<<FFI_FLAG_BITS)-1)
|
|
204
|
-
REG_L a6, 6*FFI_SIZEOF_ARG(t9)
|
|
205
|
-
beqz t4, arg7_next
|
|
206
|
-
bne t4, FFI_TYPE_FLOAT, arg7_doublep
|
|
207
|
-
l.s $f18, 6*FFI_SIZEOF_ARG(t9)
|
|
208
|
-
b arg7_next
|
|
209
|
-
arg7_doublep:
|
|
210
|
-
l.d $f18, 6*FFI_SIZEOF_ARG(t9)
|
|
211
|
-
arg7_next:
|
|
212
|
-
|
|
213
|
-
SRL t4, t8, 7*FFI_FLAG_BITS
|
|
214
|
-
and t4, ((1<<FFI_FLAG_BITS)-1)
|
|
215
|
-
REG_L a7, 7*FFI_SIZEOF_ARG(t9)
|
|
216
|
-
beqz t4, arg8_next
|
|
217
|
-
bne t4, FFI_TYPE_FLOAT, arg8_doublep
|
|
218
|
-
l.s $f19, 7*FFI_SIZEOF_ARG(t9)
|
|
219
|
-
b arg8_next
|
|
220
|
-
arg8_doublep:
|
|
221
|
-
l.d $f19, 7*FFI_SIZEOF_ARG(t9)
|
|
222
|
-
arg8_next:
|
|
223
|
-
#endif
|
|
224
|
-
|
|
225
|
-
callit:
|
|
226
|
-
# Load the function pointer
|
|
227
|
-
REG_L t9, 5*FFI_SIZEOF_ARG($fp)
|
|
228
|
-
|
|
229
|
-
# install the static chain(t7=$15)
|
|
230
|
-
REG_L t7, 6*FFI_SIZEOF_ARG($fp)
|
|
231
|
-
|
|
232
|
-
# If the return value pointer is NULL, assume no return value.
|
|
233
|
-
REG_L t5, 4*FFI_SIZEOF_ARG($fp)
|
|
234
|
-
beqz t5, noretval
|
|
235
|
-
|
|
236
|
-
# Shift the return type flag over
|
|
237
|
-
SRL t6, 8*FFI_FLAG_BITS
|
|
238
|
-
|
|
239
|
-
beq t6, FFI_TYPE_SINT32, retint
|
|
240
|
-
bne t6, FFI_TYPE_INT, retuint32
|
|
241
|
-
retint:
|
|
242
|
-
jal t9
|
|
243
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
244
|
-
REG_S v0, 0(t4)
|
|
245
|
-
b epilogue
|
|
246
|
-
|
|
247
|
-
retuint32:
|
|
248
|
-
bne t6, FFI_TYPE_UINT32, retfloat
|
|
249
|
-
jal t9
|
|
250
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
251
|
-
sw v0, 0(t4)
|
|
252
|
-
b epilogue
|
|
253
|
-
|
|
254
|
-
retfloat:
|
|
255
|
-
#ifndef __mips_soft_float
|
|
256
|
-
bne t6, FFI_TYPE_FLOAT, retdouble
|
|
257
|
-
jal t9
|
|
258
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
259
|
-
s.s $f0, 0(t4)
|
|
260
|
-
b epilogue
|
|
261
|
-
|
|
262
|
-
retdouble:
|
|
263
|
-
bne t6, FFI_TYPE_DOUBLE, retstruct_d
|
|
264
|
-
jal t9
|
|
265
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
266
|
-
s.d $f0, 0(t4)
|
|
267
|
-
b epilogue
|
|
268
|
-
|
|
269
|
-
retstruct_d:
|
|
270
|
-
bne t6, FFI_TYPE_STRUCT_D, retstruct_f
|
|
271
|
-
jal t9
|
|
272
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
273
|
-
s.d $f0, 0(t4)
|
|
274
|
-
b epilogue
|
|
275
|
-
|
|
276
|
-
retstruct_f:
|
|
277
|
-
bne t6, FFI_TYPE_STRUCT_F, retstruct_d_d
|
|
278
|
-
jal t9
|
|
279
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
280
|
-
s.s $f0, 0(t4)
|
|
281
|
-
b epilogue
|
|
282
|
-
|
|
283
|
-
retstruct_d_d:
|
|
284
|
-
bne t6, FFI_TYPE_STRUCT_DD, retcomplex_d_d
|
|
285
|
-
jal t9
|
|
286
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
287
|
-
s.d $f0, 0(t4)
|
|
288
|
-
s.d $f2, 8(t4)
|
|
289
|
-
b epilogue
|
|
290
|
-
|
|
291
|
-
retcomplex_d_d:
|
|
292
|
-
bne t6, FFI_TYPE_COMPLEX_DD, retcomplex_ld_ld
|
|
293
|
-
jal t9
|
|
294
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
295
|
-
s.d $f0, 0(t4)
|
|
296
|
-
s.d $f2, 8(t4)
|
|
297
|
-
b epilogue
|
|
298
|
-
|
|
299
|
-
retcomplex_ld_ld:
|
|
300
|
-
bne t6, FFI_TYPE_COMPLEX_LDLD, retstruct_f_f
|
|
301
|
-
jal t9
|
|
302
|
-
b epilogue
|
|
303
|
-
|
|
304
|
-
retstruct_f_f:
|
|
305
|
-
bne t6, FFI_TYPE_STRUCT_FF, retcomplex_f_f
|
|
306
|
-
jal t9
|
|
307
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
308
|
-
s.s $f0, 0(t4)
|
|
309
|
-
s.s $f2, 4(t4)
|
|
310
|
-
b epilogue
|
|
311
|
-
|
|
312
|
-
retcomplex_f_f:
|
|
313
|
-
bne t6, FFI_TYPE_COMPLEX_FF, retstruct_d_f
|
|
314
|
-
jal t9
|
|
315
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
316
|
-
s.s $f0, 0(t4)
|
|
317
|
-
s.s $f2, 4(t4)
|
|
318
|
-
b epilogue
|
|
319
|
-
|
|
320
|
-
retstruct_d_f:
|
|
321
|
-
bne t6, FFI_TYPE_STRUCT_DF, retstruct_f_d
|
|
322
|
-
jal t9
|
|
323
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
324
|
-
s.d $f0, 0(t4)
|
|
325
|
-
s.s $f2, 8(t4)
|
|
326
|
-
b epilogue
|
|
327
|
-
|
|
328
|
-
retstruct_f_d:
|
|
329
|
-
bne t6, FFI_TYPE_STRUCT_FD, retstruct_d_soft
|
|
330
|
-
jal t9
|
|
331
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
332
|
-
s.s $f0, 0(t4)
|
|
333
|
-
s.d $f2, 8(t4)
|
|
334
|
-
b epilogue
|
|
335
|
-
#endif
|
|
336
|
-
|
|
337
|
-
retstruct_d_soft:
|
|
338
|
-
bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
|
|
339
|
-
jal t9
|
|
340
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
341
|
-
sd v0, 0(t4)
|
|
342
|
-
b epilogue
|
|
343
|
-
|
|
344
|
-
retstruct_f_soft:
|
|
345
|
-
bne t6, FFI_TYPE_STRUCT_F_SOFT, retstruct_d_d_soft
|
|
346
|
-
jal t9
|
|
347
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
348
|
-
sw v0, 0(t4)
|
|
349
|
-
b epilogue
|
|
350
|
-
|
|
351
|
-
retstruct_d_d_soft:
|
|
352
|
-
bne t6, FFI_TYPE_STRUCT_DD_SOFT, retstruct_f_f_soft
|
|
353
|
-
jal t9
|
|
354
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
355
|
-
sd v0, 0(t4)
|
|
356
|
-
sd a0, 8(t4) # not typo, it is a0, I have no idea, gcc does do it
|
|
357
|
-
b epilogue
|
|
358
|
-
|
|
359
|
-
retstruct_f_f_soft:
|
|
360
|
-
bne t6, FFI_TYPE_STRUCT_FF_SOFT, retstruct_d_f_soft
|
|
361
|
-
jal t9
|
|
362
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
363
|
-
sw v0, 0(t4)
|
|
364
|
-
sw v1, 4(t4)
|
|
365
|
-
b epilogue
|
|
366
|
-
|
|
367
|
-
retstruct_d_f_soft:
|
|
368
|
-
bne t6, FFI_TYPE_STRUCT_DF_SOFT, retstruct_f_d_soft
|
|
369
|
-
jal t9
|
|
370
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
371
|
-
sd v0, 0(t4)
|
|
372
|
-
sw v1, 8(t4)
|
|
373
|
-
b epilogue
|
|
374
|
-
|
|
375
|
-
retstruct_f_d_soft:
|
|
376
|
-
bne t6, FFI_TYPE_STRUCT_FD_SOFT, retstruct_small
|
|
377
|
-
jal t9
|
|
378
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
379
|
-
sw v0, 0(t4)
|
|
380
|
-
sd a0, 8(t4) # not typo, it is a0, I have no idea, gcc does do it
|
|
381
|
-
b epilogue
|
|
382
|
-
|
|
383
|
-
retstruct_small:
|
|
384
|
-
bne t6, FFI_TYPE_STRUCT_SMALL, retstruct_small2
|
|
385
|
-
jal t9
|
|
386
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
387
|
-
REG_S v0, 0(t4)
|
|
388
|
-
b epilogue
|
|
389
|
-
|
|
390
|
-
retstruct_small2:
|
|
391
|
-
bne t6, FFI_TYPE_STRUCT_SMALL2, retlongdouble_soft
|
|
392
|
-
jal t9
|
|
393
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
394
|
-
REG_S v0, 0(t4)
|
|
395
|
-
REG_S v1, 8(t4)
|
|
396
|
-
b epilogue
|
|
397
|
-
|
|
398
|
-
retlongdouble_soft:
|
|
399
|
-
bne t6, FFI_TYPE_LONGDOUBLE, retcomplex_small
|
|
400
|
-
jal t9
|
|
401
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
402
|
-
REG_S v0, 0(t4)
|
|
403
|
-
REG_S a0, 8(t4) # not typo, it is a0, I have no idea, gcc does do it
|
|
404
|
-
b epilogue
|
|
405
|
-
|
|
406
|
-
retcomplex_small:
|
|
407
|
-
bne t6, FFI_TYPE_COMPLEX_SMALL, retcomplex_small2
|
|
408
|
-
jal t9
|
|
409
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
410
|
-
REG_S v0, 0(t4)
|
|
411
|
-
b epilogue
|
|
412
|
-
|
|
413
|
-
retcomplex_small2:
|
|
414
|
-
bne t6, FFI_TYPE_COMPLEX_SMALL2, retstruct
|
|
415
|
-
jal t9
|
|
416
|
-
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
|
|
417
|
-
REG_S v0, 0(t4)
|
|
418
|
-
REG_S v1, 8(t4)
|
|
419
|
-
b epilogue
|
|
420
|
-
|
|
421
|
-
retstruct:
|
|
422
|
-
noretval:
|
|
423
|
-
jal t9
|
|
424
|
-
|
|
425
|
-
# Epilogue
|
|
426
|
-
epilogue:
|
|
427
|
-
move $sp, $fp
|
|
428
|
-
REG_L $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Restore frame pointer
|
|
429
|
-
REG_L ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Restore return address
|
|
430
|
-
ADDU $sp, SIZEOF_FRAME # Fix stack pointer
|
|
431
|
-
j ra
|
|
432
|
-
|
|
433
|
-
.LFE0:
|
|
434
|
-
.end ffi_call_N32
|
|
435
|
-
|
|
436
|
-
/* ffi_closure_N32. Expects address of the passed-in ffi_closure in t0
|
|
437
|
-
($12). Stores any arguments passed in registers onto the stack,
|
|
438
|
-
then calls ffi_closure_mips_inner_N32, which then decodes
|
|
439
|
-
them.
|
|
440
|
-
|
|
441
|
-
Stack layout:
|
|
442
|
-
|
|
443
|
-
20 - Start of parameters, original sp
|
|
444
|
-
19 - Called function a7 save
|
|
445
|
-
18 - Called function a6 save
|
|
446
|
-
17 - Called function a5 save
|
|
447
|
-
16 - Called function a4 save
|
|
448
|
-
15 - Called function a3 save
|
|
449
|
-
14 - Called function a2 save
|
|
450
|
-
13 - Called function a1 save
|
|
451
|
-
12 - Called function a0 save
|
|
452
|
-
11 - Called function f19
|
|
453
|
-
10 - Called function f18
|
|
454
|
-
9 - Called function f17
|
|
455
|
-
8 - Called function f16
|
|
456
|
-
7 - Called function f15
|
|
457
|
-
6 - Called function f14
|
|
458
|
-
5 - Called function f13
|
|
459
|
-
4 - Called function f12
|
|
460
|
-
3 - return value high (v1 or $f2)
|
|
461
|
-
2 - return value low (v0 or $f0)
|
|
462
|
-
1 - ra save
|
|
463
|
-
0 - gp save our sp points here
|
|
464
|
-
*/
|
|
465
|
-
|
|
466
|
-
#define SIZEOF_FRAME2 (20 * FFI_SIZEOF_ARG)
|
|
467
|
-
|
|
468
|
-
#define A7_OFF2 (19 * FFI_SIZEOF_ARG)
|
|
469
|
-
#define A6_OFF2 (18 * FFI_SIZEOF_ARG)
|
|
470
|
-
#define A5_OFF2 (17 * FFI_SIZEOF_ARG)
|
|
471
|
-
#define A4_OFF2 (16 * FFI_SIZEOF_ARG)
|
|
472
|
-
#define A3_OFF2 (15 * FFI_SIZEOF_ARG)
|
|
473
|
-
#define A2_OFF2 (14 * FFI_SIZEOF_ARG)
|
|
474
|
-
#define A1_OFF2 (13 * FFI_SIZEOF_ARG)
|
|
475
|
-
#define A0_OFF2 (12 * FFI_SIZEOF_ARG)
|
|
476
|
-
|
|
477
|
-
#define F19_OFF2 (11 * FFI_SIZEOF_ARG)
|
|
478
|
-
#define F18_OFF2 (10 * FFI_SIZEOF_ARG)
|
|
479
|
-
#define F17_OFF2 (9 * FFI_SIZEOF_ARG)
|
|
480
|
-
#define F16_OFF2 (8 * FFI_SIZEOF_ARG)
|
|
481
|
-
#define F15_OFF2 (7 * FFI_SIZEOF_ARG)
|
|
482
|
-
#define F14_OFF2 (6 * FFI_SIZEOF_ARG)
|
|
483
|
-
#define F13_OFF2 (5 * FFI_SIZEOF_ARG)
|
|
484
|
-
#define F12_OFF2 (4 * FFI_SIZEOF_ARG)
|
|
485
|
-
|
|
486
|
-
#define V1_OFF2 (3 * FFI_SIZEOF_ARG)
|
|
487
|
-
#define V0_OFF2 (2 * FFI_SIZEOF_ARG)
|
|
488
|
-
|
|
489
|
-
#define RA_OFF2 (1 * FFI_SIZEOF_ARG)
|
|
490
|
-
#define GP_OFF2 (0 * FFI_SIZEOF_ARG)
|
|
491
|
-
|
|
492
|
-
.align 2
|
|
493
|
-
.globl ffi_go_closure_N32
|
|
494
|
-
.ent ffi_go_closure_N32
|
|
495
|
-
ffi_go_closure_N32:
|
|
496
|
-
.LFB1:
|
|
497
|
-
.frame $sp, SIZEOF_FRAME2, ra
|
|
498
|
-
.mask 0x90000000,-(SIZEOF_FRAME2 - RA_OFF2)
|
|
499
|
-
.fmask 0x00000000,0
|
|
500
|
-
SUBU $sp, SIZEOF_FRAME2
|
|
501
|
-
.LCFI10:
|
|
502
|
-
.cpsetup t9, GP_OFF2, ffi_go_closure_N32
|
|
503
|
-
REG_S ra, RA_OFF2($sp) # Save return address
|
|
504
|
-
.LCFI11:
|
|
505
|
-
|
|
506
|
-
REG_S a0, A0_OFF2($sp)
|
|
507
|
-
REG_S a1, A1_OFF2($sp)
|
|
508
|
-
REG_S a2, A2_OFF2($sp)
|
|
509
|
-
REG_S a3, A3_OFF2($sp)
|
|
510
|
-
REG_S a4, A4_OFF2($sp)
|
|
511
|
-
REG_S a5, A5_OFF2($sp)
|
|
512
|
-
|
|
513
|
-
# Call ffi_closure_mips_inner_N32 to do the real work.
|
|
514
|
-
LA t9, ffi_closure_mips_inner_N32
|
|
515
|
-
#if _MIPS_SIM==_ABIN32
|
|
516
|
-
lw a0, 4($15) # cif
|
|
517
|
-
lw a1, 8($15) # fun
|
|
518
|
-
#else
|
|
519
|
-
REG_L a0, 8($15) # cif
|
|
520
|
-
REG_L a1, 16($15) # fun
|
|
521
|
-
#endif
|
|
522
|
-
move a2, t7 # userdata=closure
|
|
523
|
-
ADDU a3, $sp, V0_OFF2 # rvalue
|
|
524
|
-
ADDU a4, $sp, A0_OFF2 # ar
|
|
525
|
-
ADDU a5, $sp, F12_OFF2 # fpr
|
|
526
|
-
|
|
527
|
-
b $do_closure
|
|
528
|
-
|
|
529
|
-
.LFE1:
|
|
530
|
-
.end ffi_go_closure_N32
|
|
531
|
-
|
|
532
|
-
.align 2
|
|
533
|
-
.globl ffi_closure_N32
|
|
534
|
-
.ent ffi_closure_N32
|
|
535
|
-
ffi_closure_N32:
|
|
536
|
-
.LFB2:
|
|
537
|
-
.frame $sp, SIZEOF_FRAME2, ra
|
|
538
|
-
.mask 0x90000000,-(SIZEOF_FRAME2 - RA_OFF2)
|
|
539
|
-
.fmask 0x00000000,0
|
|
540
|
-
SUBU $sp, SIZEOF_FRAME2
|
|
541
|
-
.LCFI20:
|
|
542
|
-
.cpsetup t9, GP_OFF2, ffi_closure_N32
|
|
543
|
-
REG_S ra, RA_OFF2($sp) # Save return address
|
|
544
|
-
.LCFI21:
|
|
545
|
-
REG_S a0, A0_OFF2($sp)
|
|
546
|
-
REG_S a1, A1_OFF2($sp)
|
|
547
|
-
REG_S a2, A2_OFF2($sp)
|
|
548
|
-
REG_S a3, A3_OFF2($sp)
|
|
549
|
-
REG_S a4, A4_OFF2($sp)
|
|
550
|
-
REG_S a5, A5_OFF2($sp)
|
|
551
|
-
|
|
552
|
-
# Call ffi_closure_mips_inner_N32 to do the real work.
|
|
553
|
-
LA t9, ffi_closure_mips_inner_N32
|
|
554
|
-
#if _MIPS_SIM==_ABIN32
|
|
555
|
-
lw a0, 20($12) # cif
|
|
556
|
-
lw a1, 24($12) # fun
|
|
557
|
-
lw a2, 28($12) # user_data
|
|
558
|
-
#else
|
|
559
|
-
REG_L a0, 56($12) # cif
|
|
560
|
-
REG_L a1, 64($12) # fun
|
|
561
|
-
REG_L a2, 72($12) # user_data
|
|
562
|
-
#endif
|
|
563
|
-
ADDU a3, $sp, V0_OFF2
|
|
564
|
-
# FIXME: a4 does work, while if ret is _Complex long double, it will overwrite Fn_OFF2
|
|
565
|
-
ADDU a4, $sp, A0_OFF2
|
|
566
|
-
ADDU a5, $sp, F12_OFF2
|
|
567
|
-
|
|
568
|
-
$do_closure:
|
|
569
|
-
# Store all possible argument registers. If there are more than
|
|
570
|
-
# fit in registers, then they were stored on the stack.
|
|
571
|
-
REG_S a6, A6_OFF2($sp)
|
|
572
|
-
REG_S a7, A7_OFF2($sp)
|
|
573
|
-
|
|
574
|
-
#ifndef __mips_soft_float
|
|
575
|
-
# Store all possible float/double registers.
|
|
576
|
-
s.d $f12, F12_OFF2($sp)
|
|
577
|
-
s.d $f13, F13_OFF2($sp)
|
|
578
|
-
s.d $f14, F14_OFF2($sp)
|
|
579
|
-
s.d $f15, F15_OFF2($sp)
|
|
580
|
-
s.d $f16, F16_OFF2($sp)
|
|
581
|
-
s.d $f17, F17_OFF2($sp)
|
|
582
|
-
s.d $f18, F18_OFF2($sp)
|
|
583
|
-
s.d $f19, F19_OFF2($sp)
|
|
584
|
-
#endif
|
|
585
|
-
|
|
586
|
-
jalr t9
|
|
587
|
-
|
|
588
|
-
# Return flags are in v0
|
|
589
|
-
bne v0, FFI_TYPE_SINT32, cls_retuint32
|
|
590
|
-
lw v0, V0_OFF2($sp)
|
|
591
|
-
b cls_epilogue
|
|
592
|
-
|
|
593
|
-
cls_retuint32:
|
|
594
|
-
bne v0, FFI_TYPE_UINT32, cls_retint
|
|
595
|
-
lwu v0, V0_OFF2($sp)
|
|
596
|
-
b cls_epilogue
|
|
597
|
-
|
|
598
|
-
cls_retint:
|
|
599
|
-
bne v0, FFI_TYPE_INT, cls_retfloat
|
|
600
|
-
REG_L v0, V0_OFF2($sp)
|
|
601
|
-
b cls_epilogue
|
|
602
|
-
|
|
603
|
-
cls_retfloat:
|
|
604
|
-
#ifndef __mips_soft_float
|
|
605
|
-
bne v0, FFI_TYPE_FLOAT, cls_retdouble
|
|
606
|
-
l.s $f0, V0_OFF2($sp)
|
|
607
|
-
b cls_epilogue
|
|
608
|
-
|
|
609
|
-
cls_retdouble:
|
|
610
|
-
bne v0, FFI_TYPE_DOUBLE, cls_retstruct_d
|
|
611
|
-
l.d $f0, V0_OFF2($sp)
|
|
612
|
-
b cls_epilogue
|
|
613
|
-
|
|
614
|
-
cls_retstruct_d:
|
|
615
|
-
bne v0, FFI_TYPE_STRUCT_D, cls_retstruct_f
|
|
616
|
-
l.d $f0, V0_OFF2($sp)
|
|
617
|
-
b cls_epilogue
|
|
618
|
-
|
|
619
|
-
cls_retstruct_f:
|
|
620
|
-
bne v0, FFI_TYPE_STRUCT_F, cls_retstruct_d_d
|
|
621
|
-
l.s $f0, V0_OFF2($sp)
|
|
622
|
-
b cls_epilogue
|
|
623
|
-
|
|
624
|
-
cls_retstruct_d_d:
|
|
625
|
-
bne v0, FFI_TYPE_STRUCT_DD, cls_retcomplex_d_d
|
|
626
|
-
l.d $f0, V0_OFF2($sp)
|
|
627
|
-
l.d $f2, V1_OFF2($sp)
|
|
628
|
-
b cls_epilogue
|
|
629
|
-
|
|
630
|
-
cls_retcomplex_d_d:
|
|
631
|
-
bne v0, FFI_TYPE_COMPLEX_DD, cls_retcomplex_f_f
|
|
632
|
-
l.d $f0, V0_OFF2($sp)
|
|
633
|
-
l.d $f2, V1_OFF2($sp)
|
|
634
|
-
b cls_epilogue
|
|
635
|
-
|
|
636
|
-
cls_retstruct_f_f:
|
|
637
|
-
bne v0, FFI_TYPE_STRUCT_FF, cls_retcomplex_f_f
|
|
638
|
-
l.s $f0, V0_OFF2($sp)
|
|
639
|
-
l.s $f2, V1_OFF2($sp)
|
|
640
|
-
b cls_epilogue
|
|
641
|
-
|
|
642
|
-
cls_retcomplex_f_f:
|
|
643
|
-
bne v0, FFI_TYPE_COMPLEX_FF, cls_retstruct_d_f
|
|
644
|
-
l.s $f0, V0_OFF2($sp)
|
|
645
|
-
l.s $f2, (V0_OFF2+4)($sp)
|
|
646
|
-
b cls_epilogue
|
|
647
|
-
|
|
648
|
-
cls_retstruct_d_f:
|
|
649
|
-
bne v0, FFI_TYPE_STRUCT_DF, cls_retstruct_f_d
|
|
650
|
-
l.d $f0, V0_OFF2($sp)
|
|
651
|
-
l.s $f2, V1_OFF2($sp)
|
|
652
|
-
b cls_epilogue
|
|
653
|
-
|
|
654
|
-
cls_retstruct_f_d:
|
|
655
|
-
bne v0, FFI_TYPE_STRUCT_FD, cls_retcomplex_ld_ld
|
|
656
|
-
l.s $f0, V0_OFF2($sp)
|
|
657
|
-
l.d $f2, V1_OFF2($sp)
|
|
658
|
-
b cls_epilogue
|
|
659
|
-
#else
|
|
660
|
-
cls_longdouble_soft:
|
|
661
|
-
bne v0, FFI_TYPE_LONGDOUBLE, cls_retcomplex_ld_ld
|
|
662
|
-
REG_L v0, V0_OFF2($sp)
|
|
663
|
-
REG_L a0, V1_OFF2($sp) # not typo, it is a0, I have no idea, gcc does do it
|
|
664
|
-
b cls_epilogue
|
|
665
|
-
#endif
|
|
666
|
-
|
|
667
|
-
cls_retcomplex_ld_ld:
|
|
668
|
-
bne v0, FFI_TYPE_COMPLEX_LDLD, cls_retstruct_small2
|
|
669
|
-
REG_L t8, A0_OFF2($sp)
|
|
670
|
-
REG_L t9, 16($sp)
|
|
671
|
-
REG_S t9, 0(t8)
|
|
672
|
-
REG_L t9, 24($sp)
|
|
673
|
-
REG_S t9, 8(t8)
|
|
674
|
-
REG_L t9, 32($sp)
|
|
675
|
-
REG_S t9, 16(t8)
|
|
676
|
-
REG_L t9, 40($sp)
|
|
677
|
-
REG_S t9, 24(t8)
|
|
678
|
-
b cls_epilogue
|
|
679
|
-
|
|
680
|
-
cls_retstruct_small2:
|
|
681
|
-
REG_L v0, V0_OFF2($sp)
|
|
682
|
-
REG_L v1, V1_OFF2($sp)
|
|
683
|
-
|
|
684
|
-
# Epilogue
|
|
685
|
-
cls_epilogue:
|
|
686
|
-
REG_L ra, RA_OFF2($sp) # Restore return address
|
|
687
|
-
.cpreturn
|
|
688
|
-
ADDU $sp, SIZEOF_FRAME2
|
|
689
|
-
j ra
|
|
690
|
-
.LFE2:
|
|
691
|
-
.end ffi_closure_N32
|
|
692
|
-
|
|
693
|
-
#ifdef __GNUC__
|
|
694
|
-
.section .eh_frame,EH_FRAME_FLAGS,@progbits
|
|
695
|
-
.Lframe1:
|
|
696
|
-
.4byte .LECIE1-.LSCIE1 # length
|
|
697
|
-
.LSCIE1:
|
|
698
|
-
.4byte 0x0 # CIE
|
|
699
|
-
.byte 0x1 # Version 1
|
|
700
|
-
.ascii "\000" # Augmentation
|
|
701
|
-
.uleb128 0x1 # Code alignment 1
|
|
702
|
-
.sleb128 -4 # Data alignment -4
|
|
703
|
-
.byte 0x1f # Return Address $31
|
|
704
|
-
.byte 0xc # DW_CFA_def_cfa
|
|
705
|
-
.uleb128 0x1d # in $sp
|
|
706
|
-
.uleb128 0x0 # offset 0
|
|
707
|
-
.align EH_FRAME_ALIGN
|
|
708
|
-
.LECIE1:
|
|
709
|
-
|
|
710
|
-
.LSFDE0:
|
|
711
|
-
.4byte .LEFDE0-.LASFDE0 # length.
|
|
712
|
-
.LASFDE0:
|
|
713
|
-
.4byte .LASFDE0-.Lframe1 # CIE_pointer.
|
|
714
|
-
FDE_ADDR_BYTES .LFB0 # initial_location.
|
|
715
|
-
FDE_ADDR_BYTES .LFE0-.LFB0 # address_range.
|
|
716
|
-
.byte 0x4 # DW_CFA_advance_loc4
|
|
717
|
-
.4byte .LCFI00-.LFB0 # to .LCFI00
|
|
718
|
-
.byte 0xe # DW_CFA_def_cfa_offset
|
|
719
|
-
.uleb128 SIZEOF_FRAME # adjust stack.by SIZEOF_FRAME
|
|
720
|
-
.byte 0x4 # DW_CFA_advance_loc4
|
|
721
|
-
.4byte .LCFI01-.LCFI00 # to .LCFI01
|
|
722
|
-
.byte 0x9e # DW_CFA_offset of $fp
|
|
723
|
-
.uleb128 2*FFI_SIZEOF_ARG/4 #
|
|
724
|
-
.byte 0x9f # DW_CFA_offset of ra
|
|
725
|
-
.uleb128 1*FFI_SIZEOF_ARG/4 #
|
|
726
|
-
.byte 0x4 # DW_CFA_advance_loc4
|
|
727
|
-
.4byte .LCFI02-.LCFI01 # to .LCFI02
|
|
728
|
-
.byte 0xd # DW_CFA_def_cfa_register
|
|
729
|
-
.uleb128 0x1e # in $fp
|
|
730
|
-
.align EH_FRAME_ALIGN
|
|
731
|
-
.LEFDE0:
|
|
732
|
-
|
|
733
|
-
.LSFDE1:
|
|
734
|
-
.4byte .LEFDE1-.LASFDE1 # length
|
|
735
|
-
.LASFDE1:
|
|
736
|
-
.4byte .LASFDE1-.Lframe1 # CIE_pointer.
|
|
737
|
-
FDE_ADDR_BYTES .LFB1 # initial_location.
|
|
738
|
-
FDE_ADDR_BYTES .LFE1-.LFB1 # address_range.
|
|
739
|
-
.byte 0x4 # DW_CFA_advance_loc4
|
|
740
|
-
.4byte .LCFI10-.LFB1 # to .LCFI10
|
|
741
|
-
.byte 0xe # DW_CFA_def_cfa_offset
|
|
742
|
-
.uleb128 SIZEOF_FRAME2 # adjust stack.by SIZEOF_FRAME
|
|
743
|
-
.byte 0x4 # DW_CFA_advance_loc4
|
|
744
|
-
.4byte .LCFI11-.LCFI10 # to .LCFI11
|
|
745
|
-
.byte 0x9c # DW_CFA_offset of $gp ($28)
|
|
746
|
-
.uleb128 (SIZEOF_FRAME2 - GP_OFF2)/4
|
|
747
|
-
.byte 0x9f # DW_CFA_offset of ra ($31)
|
|
748
|
-
.uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
|
|
749
|
-
.align EH_FRAME_ALIGN
|
|
750
|
-
.LEFDE1:
|
|
751
|
-
|
|
752
|
-
.LSFDE2:
|
|
753
|
-
.4byte .LEFDE2-.LASFDE2 # length
|
|
754
|
-
.LASFDE2:
|
|
755
|
-
.4byte .LASFDE2-.Lframe1 # CIE_pointer.
|
|
756
|
-
FDE_ADDR_BYTES .LFB2 # initial_location.
|
|
757
|
-
FDE_ADDR_BYTES .LFE2-.LFB2 # address_range.
|
|
758
|
-
.byte 0x4 # DW_CFA_advance_loc4
|
|
759
|
-
.4byte .LCFI20-.LFB2 # to .LCFI20
|
|
760
|
-
.byte 0xe # DW_CFA_def_cfa_offset
|
|
761
|
-
.uleb128 SIZEOF_FRAME2 # adjust stack.by SIZEOF_FRAME
|
|
762
|
-
.byte 0x4 # DW_CFA_advance_loc4
|
|
763
|
-
.4byte .LCFI21-.LCFI20 # to .LCFI21
|
|
764
|
-
.byte 0x9c # DW_CFA_offset of $gp ($28)
|
|
765
|
-
.uleb128 (SIZEOF_FRAME2 - GP_OFF2)/4
|
|
766
|
-
.byte 0x9f # DW_CFA_offset of ra ($31)
|
|
767
|
-
.uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
|
|
768
|
-
.align EH_FRAME_ALIGN
|
|
769
|
-
.LEFDE2:
|
|
770
|
-
#endif /* __GNUC__ */
|
|
771
|
-
|
|
772
|
-
#endif
|