ffi 0.5.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ffi might be problematic. Click here for more details.
- data/LICENSE +51 -0
- data/README.rdoc +69 -0
- data/Rakefile +191 -0
- data/ext/ffi_c/AbstractMemory.c +489 -0
- data/ext/ffi_c/AbstractMemory.h +160 -0
- data/ext/ffi_c/ArrayType.c +129 -0
- data/ext/ffi_c/ArrayType.h +58 -0
- data/ext/ffi_c/AutoPointer.c +61 -0
- data/ext/ffi_c/AutoPointer.h +18 -0
- data/ext/ffi_c/Buffer.c +187 -0
- data/ext/ffi_c/Call.c +853 -0
- data/ext/ffi_c/Call.h +86 -0
- data/ext/ffi_c/ClosurePool.c +302 -0
- data/ext/ffi_c/ClosurePool.h +29 -0
- data/ext/ffi_c/DynamicLibrary.c +216 -0
- data/ext/ffi_c/DynamicLibrary.h +22 -0
- data/ext/ffi_c/Function.c +478 -0
- data/ext/ffi_c/Function.h +80 -0
- data/ext/ffi_c/FunctionInfo.c +221 -0
- data/ext/ffi_c/LastError.c +159 -0
- data/ext/ffi_c/LastError.h +18 -0
- data/ext/ffi_c/MemoryPointer.c +178 -0
- data/ext/ffi_c/MemoryPointer.h +20 -0
- data/ext/ffi_c/MethodHandle.c +346 -0
- data/ext/ffi_c/MethodHandle.h +53 -0
- data/ext/ffi_c/Platform.c +59 -0
- data/ext/ffi_c/Platform.h +16 -0
- data/ext/ffi_c/Pointer.c +224 -0
- data/ext/ffi_c/Pointer.h +49 -0
- data/ext/ffi_c/Struct.c +770 -0
- data/ext/ffi_c/Struct.h +80 -0
- data/ext/ffi_c/StructByValue.c +140 -0
- data/ext/ffi_c/StructByValue.h +53 -0
- data/ext/ffi_c/StructLayout.c +450 -0
- data/ext/ffi_c/Type.c +329 -0
- data/ext/ffi_c/Type.h +57 -0
- data/ext/ffi_c/Types.c +103 -0
- data/ext/ffi_c/Types.h +85 -0
- data/ext/ffi_c/Variadic.c +260 -0
- data/ext/ffi_c/compat.h +72 -0
- data/ext/ffi_c/endian.h +40 -0
- data/ext/ffi_c/extconf.rb +30 -0
- data/ext/ffi_c/ffi.c +82 -0
- data/ext/ffi_c/libffi.bsd.mk +34 -0
- data/ext/ffi_c/libffi.darwin.mk +75 -0
- data/ext/ffi_c/libffi.gnu.mk +29 -0
- data/ext/ffi_c/libffi.mk +13 -0
- data/ext/ffi_c/libffi/ChangeLog +3243 -0
- data/ext/ffi_c/libffi/ChangeLog.libffi +347 -0
- data/ext/ffi_c/libffi/ChangeLog.libgcj +40 -0
- data/ext/ffi_c/libffi/ChangeLog.v1 +764 -0
- data/ext/ffi_c/libffi/LICENSE +21 -0
- data/ext/ffi_c/libffi/Makefile.am +177 -0
- data/ext/ffi_c/libffi/Makefile.in +1640 -0
- data/ext/ffi_c/libffi/README +328 -0
- data/ext/ffi_c/libffi/TODO +1 -0
- data/ext/ffi_c/libffi/acinclude.m4 +92 -0
- data/ext/ffi_c/libffi/aclocal.m4 +7516 -0
- data/ext/ffi_c/libffi/compile +142 -0
- data/ext/ffi_c/libffi/config.guess +1516 -0
- data/ext/ffi_c/libffi/config.sub +1626 -0
- data/ext/ffi_c/libffi/configure +24414 -0
- data/ext/ffi_c/libffi/configure.ac +365 -0
- data/ext/ffi_c/libffi/configure.host +11 -0
- data/ext/ffi_c/libffi/depcomp +584 -0
- data/ext/ffi_c/libffi/doc/libffi.info +533 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +541 -0
- data/ext/ffi_c/libffi/doc/stamp-vti +4 -0
- data/ext/ffi_c/libffi/doc/version.texi +4 -0
- data/ext/ffi_c/libffi/fficonfig.h.in +160 -0
- data/ext/ffi_c/libffi/include/Makefile.am +9 -0
- data/ext/ffi_c/libffi/include/Makefile.in +422 -0
- data/ext/ffi_c/libffi/include/ffi.h.in +393 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +98 -0
- data/ext/ffi_c/libffi/install-sh +323 -0
- data/ext/ffi_c/libffi/libffi.pc.in +10 -0
- data/ext/ffi_c/libffi/libtool-version +29 -0
- data/ext/ffi_c/libffi/ltcf-c.sh +861 -0
- data/ext/ffi_c/libffi/ltcf-cxx.sh +1069 -0
- data/ext/ffi_c/libffi/ltcf-gcj.sh +700 -0
- data/ext/ffi_c/libffi/ltconfig +2862 -0
- data/ext/ffi_c/libffi/ltmain.sh +6930 -0
- data/ext/ffi_c/libffi/man/Makefile.am +8 -0
- data/ext/ffi_c/libffi/man/Makefile.in +395 -0
- data/ext/ffi_c/libffi/man/ffi.3 +31 -0
- data/ext/ffi_c/libffi/man/ffi_call.3 +103 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +66 -0
- data/ext/ffi_c/libffi/mdate-sh +201 -0
- data/ext/ffi_c/libffi/missing +353 -0
- data/ext/ffi_c/libffi/mkinstalldirs +158 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +284 -0
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +48 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +366 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +309 -0
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +299 -0
- data/ext/ffi_c/libffi/src/closures.c +596 -0
- data/ext/ffi_c/libffi/src/cris/ffi.c +383 -0
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +51 -0
- data/ext/ffi_c/libffi/src/cris/sysv.S +215 -0
- data/ext/ffi_c/libffi/src/debug.c +59 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +5099 -0
- data/ext/ffi_c/libffi/src/frv/eabi.S +128 -0
- data/ext/ffi_c/libffi/src/frv/ffi.c +292 -0
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +61 -0
- data/ext/ffi_c/libffi/src/ia64/ffi.c +580 -0
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +50 -0
- data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +40 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +560 -0
- data/ext/ffi_c/libffi/src/java_raw_api.c +359 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +232 -0
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +48 -0
- data/ext/ffi_c/libffi/src/m32r/sysv.S +121 -0
- data/ext/ffi_c/libffi/src/m68k/ffi.c +278 -0
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m68k/sysv.S +234 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +926 -0
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +202 -0
- data/ext/ffi_c/libffi/src/mips/n32.S +534 -0
- data/ext/ffi_c/libffi/src/mips/o32.S +381 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +709 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +77 -0
- data/ext/ffi_c/libffi/src/pa/hpux32.S +368 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +357 -0
- data/ext/ffi_c/libffi/src/powerpc/aix.S +225 -0
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +247 -0
- data/ext/ffi_c/libffi/src/powerpc/asm.h +125 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +245 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +317 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +1429 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +800 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +118 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +187 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +236 -0
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +327 -0
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +230 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +174 -0
- data/ext/ffi_c/libffi/src/raw_api.c +254 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +780 -0
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +60 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +434 -0
- data/ext/ffi_c/libffi/src/sh/ffi.c +716 -0
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/sh/sysv.S +850 -0
- data/ext/ffi_c/libffi/src/sh64/ffi.c +453 -0
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/sh64/sysv.S +530 -0
- data/ext/ffi_c/libffi/src/sparc/ffi.c +610 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +66 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +272 -0
- data/ext/ffi_c/libffi/src/sparc/v9.S +307 -0
- data/ext/ffi_c/libffi/src/types.c +77 -0
- data/ext/ffi_c/libffi/src/x86/darwin.S +443 -0
- data/ext/ffi_c/libffi/src/x86/darwin64.S +416 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +475 -0
- data/ext/ffi_c/libffi/src/x86/ffi64.c +572 -0
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +90 -0
- data/ext/ffi_c/libffi/src/x86/freebsd.S +458 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +437 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +418 -0
- data/ext/ffi_c/libffi/src/x86/win32.S +391 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +71 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.in +447 -0
- data/ext/ffi_c/libffi/testsuite/config/default.exp +1 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +289 -0
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +263 -0
- data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +97 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +97 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_stdcall.c +72 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +103 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +104 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +110 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +97 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +101 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +103 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +106 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +117 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +106 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +132 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +107 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +125 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +105 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +96 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +101 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +100 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +101 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +100 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +82 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +82 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +94 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +82 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +94 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +52 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +54 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +58 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +72 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +62 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +69 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +53 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +160 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +169 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +141 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +118 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +119 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +119 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +120 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +139 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +119 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +139 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +139 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +35 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +35 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +64 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest.cc +123 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc +53 -0
- data/ext/ffi_c/libffi/texinfo.tex +7482 -0
- data/ext/ffi_c/rbffi.h +26 -0
- data/gen/Rakefile +12 -0
- data/lib/1.8/ffi_c.so +0 -0
- data/lib/1.9/ffi_c.so +0 -0
- data/lib/ffi.rb +11 -0
- data/lib/ffi/autopointer.rb +61 -0
- data/lib/ffi/buffer.rb +0 -0
- data/lib/ffi/callback.rb +10 -0
- data/lib/ffi/enum.rb +78 -0
- data/lib/ffi/errno.rb +8 -0
- data/lib/ffi/ffi.rb +99 -0
- data/lib/ffi/io.rb +21 -0
- data/lib/ffi/library.rb +218 -0
- data/lib/ffi/managedstruct.rb +55 -0
- data/lib/ffi/memorypointer.rb +73 -0
- data/lib/ffi/platform.rb +88 -0
- data/lib/ffi/pointer.rb +119 -0
- data/lib/ffi/struct.rb +183 -0
- data/lib/ffi/tools/const_generator.rb +177 -0
- data/lib/ffi/tools/generator.rb +58 -0
- data/lib/ffi/tools/generator_task.rb +35 -0
- data/lib/ffi/tools/struct_generator.rb +194 -0
- data/lib/ffi/tools/types_generator.rb +123 -0
- data/lib/ffi/types.rb +153 -0
- data/lib/ffi/union.rb +12 -0
- data/lib/ffi/variadic.rb +25 -0
- data/spec/ffi/bool_spec.rb +24 -0
- data/spec/ffi/buffer_spec.rb +202 -0
- data/spec/ffi/callback_spec.rb +591 -0
- data/spec/ffi/enum_spec.rb +164 -0
- data/spec/ffi/errno_spec.rb +13 -0
- data/spec/ffi/function_spec.rb +73 -0
- data/spec/ffi/library_spec.rb +148 -0
- data/spec/ffi/managed_struct_spec.rb +56 -0
- data/spec/ffi/number_spec.rb +231 -0
- data/spec/ffi/pointer_spec.rb +195 -0
- data/spec/ffi/rbx/attach_function_spec.rb +27 -0
- data/spec/ffi/rbx/memory_pointer_spec.rb +102 -0
- data/spec/ffi/rbx/spec_helper.rb +1 -0
- data/spec/ffi/rbx/struct_spec.rb +13 -0
- data/spec/ffi/spec_helper.rb +17 -0
- data/spec/ffi/string_spec.rb +103 -0
- data/spec/ffi/struct_callback_spec.rb +64 -0
- data/spec/ffi/struct_initialize_spec.rb +30 -0
- data/spec/ffi/struct_spec.rb +529 -0
- data/spec/ffi/typedef_spec.rb +48 -0
- data/spec/ffi/union_spec.rb +60 -0
- data/spec/ffi/variadic_spec.rb +84 -0
- data/spec/spec.opts +4 -0
- metadata +396 -0
@@ -0,0 +1,118 @@
|
|
1
|
+
/* -----------------------------------------------------------------*-C-*-
|
2
|
+
ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc.
|
3
|
+
Copyright (C) 2007 Free Software Foundation, Inc
|
4
|
+
Target configuration macros for PowerPC.
|
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
|
+
|
28
|
+
#ifndef LIBFFI_TARGET_H
|
29
|
+
#define LIBFFI_TARGET_H
|
30
|
+
|
31
|
+
/* ---- System specific configurations ----------------------------------- */
|
32
|
+
|
33
|
+
#if defined (POWERPC) && defined (__powerpc64__)
|
34
|
+
#define POWERPC64
|
35
|
+
#endif
|
36
|
+
|
37
|
+
#ifndef LIBFFI_ASM
|
38
|
+
typedef unsigned long ffi_arg;
|
39
|
+
typedef signed long ffi_sarg;
|
40
|
+
|
41
|
+
typedef enum ffi_abi {
|
42
|
+
FFI_FIRST_ABI = 0,
|
43
|
+
|
44
|
+
#ifdef POWERPC
|
45
|
+
FFI_SYSV,
|
46
|
+
FFI_GCC_SYSV,
|
47
|
+
FFI_LINUX64,
|
48
|
+
FFI_LINUX,
|
49
|
+
FFI_LINUX_SOFT_FLOAT,
|
50
|
+
# ifdef POWERPC64
|
51
|
+
FFI_DEFAULT_ABI = FFI_LINUX64,
|
52
|
+
# else
|
53
|
+
# if (!defined(__NO_FPRS__) && (__LDBL_MANT_DIG__ == 106))
|
54
|
+
FFI_DEFAULT_ABI = FFI_LINUX,
|
55
|
+
# else
|
56
|
+
# ifdef __NO_FPRS__
|
57
|
+
FFI_DEFAULT_ABI = FFI_LINUX_SOFT_FLOAT,
|
58
|
+
# else
|
59
|
+
FFI_DEFAULT_ABI = FFI_GCC_SYSV,
|
60
|
+
# endif
|
61
|
+
# endif
|
62
|
+
# endif
|
63
|
+
#endif
|
64
|
+
|
65
|
+
#ifdef POWERPC_AIX
|
66
|
+
FFI_AIX,
|
67
|
+
FFI_DARWIN,
|
68
|
+
FFI_DEFAULT_ABI = FFI_AIX,
|
69
|
+
#endif
|
70
|
+
|
71
|
+
#ifdef POWERPC_DARWIN
|
72
|
+
FFI_AIX,
|
73
|
+
FFI_DARWIN,
|
74
|
+
FFI_DEFAULT_ABI = FFI_DARWIN,
|
75
|
+
#endif
|
76
|
+
|
77
|
+
#ifdef POWERPC_FREEBSD
|
78
|
+
FFI_SYSV,
|
79
|
+
FFI_GCC_SYSV,
|
80
|
+
FFI_LINUX64,
|
81
|
+
FFI_DEFAULT_ABI = FFI_SYSV,
|
82
|
+
#endif
|
83
|
+
|
84
|
+
FFI_LAST_ABI
|
85
|
+
} ffi_abi;
|
86
|
+
#endif
|
87
|
+
|
88
|
+
/* ---- Definitions for closures ----------------------------------------- */
|
89
|
+
|
90
|
+
#define FFI_CLOSURES 1
|
91
|
+
#define FFI_NATIVE_RAW_API 0
|
92
|
+
|
93
|
+
/* For additional types like the below, take care about the order in
|
94
|
+
ppc_closures.S. They must follow after the FFI_TYPE_LAST. */
|
95
|
+
|
96
|
+
/* Needed for soft-float long-double-128 support. */
|
97
|
+
#define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1)
|
98
|
+
|
99
|
+
/* Needed for FFI_SYSV small structure returns. */
|
100
|
+
#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2)
|
101
|
+
|
102
|
+
#if defined(POWERPC64) || defined(POWERPC_AIX)
|
103
|
+
#define FFI_TRAMPOLINE_SIZE 24
|
104
|
+
#else /* POWERPC || POWERPC_AIX */
|
105
|
+
#define FFI_TRAMPOLINE_SIZE 40
|
106
|
+
#endif
|
107
|
+
|
108
|
+
#ifndef LIBFFI_ASM
|
109
|
+
#if defined(POWERPC_DARWIN) || defined(POWERPC_AIX)
|
110
|
+
struct ffi_aix_trampoline_struct {
|
111
|
+
void * code_pointer; /* Pointer to ffi_closure_ASM */
|
112
|
+
void * toc; /* TOC */
|
113
|
+
void * static_chain; /* Pointer to closure */
|
114
|
+
};
|
115
|
+
#endif
|
116
|
+
#endif
|
117
|
+
|
118
|
+
#endif
|
@@ -0,0 +1,187 @@
|
|
1
|
+
/* -----------------------------------------------------------------------
|
2
|
+
sysv.h - Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
|
3
|
+
Copyright (c) 2008 Red Hat, Inc.
|
4
|
+
|
5
|
+
PowerPC64 Assembly glue.
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
a copy of this software and associated documentation files (the
|
9
|
+
``Software''), to deal in the Software without restriction, including
|
10
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be included
|
16
|
+
in all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
22
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
23
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
25
|
+
DEALINGS IN THE SOFTWARE.
|
26
|
+
----------------------------------------------------------------------- */
|
27
|
+
|
28
|
+
#define LIBFFI_ASM
|
29
|
+
#include <fficonfig.h>
|
30
|
+
#include <ffi.h>
|
31
|
+
|
32
|
+
#ifdef __powerpc64__
|
33
|
+
.hidden ffi_call_LINUX64, .ffi_call_LINUX64
|
34
|
+
.globl ffi_call_LINUX64, .ffi_call_LINUX64
|
35
|
+
.section ".opd","aw"
|
36
|
+
.align 3
|
37
|
+
ffi_call_LINUX64:
|
38
|
+
.quad .ffi_call_LINUX64,.TOC.@tocbase,0
|
39
|
+
.size ffi_call_LINUX64,24
|
40
|
+
.type .ffi_call_LINUX64,@function
|
41
|
+
.text
|
42
|
+
.ffi_call_LINUX64:
|
43
|
+
.LFB1:
|
44
|
+
mflr %r0
|
45
|
+
std %r28, -32(%r1)
|
46
|
+
std %r29, -24(%r1)
|
47
|
+
std %r30, -16(%r1)
|
48
|
+
std %r31, -8(%r1)
|
49
|
+
std %r0, 16(%r1)
|
50
|
+
|
51
|
+
mr %r28, %r1 /* our AP. */
|
52
|
+
.LCFI0:
|
53
|
+
stdux %r1, %r1, %r4
|
54
|
+
mr %r31, %r5 /* flags, */
|
55
|
+
mr %r30, %r6 /* rvalue, */
|
56
|
+
mr %r29, %r7 /* function address. */
|
57
|
+
std %r2, 40(%r1)
|
58
|
+
|
59
|
+
/* Call ffi_prep_args64. */
|
60
|
+
mr %r4, %r1
|
61
|
+
bl .ffi_prep_args64
|
62
|
+
|
63
|
+
ld %r0, 0(%r29)
|
64
|
+
ld %r2, 8(%r29)
|
65
|
+
ld %r11, 16(%r29)
|
66
|
+
|
67
|
+
/* Now do the call. */
|
68
|
+
/* Set up cr1 with bits 4-7 of the flags. */
|
69
|
+
mtcrf 0x40, %r31
|
70
|
+
|
71
|
+
/* Get the address to call into CTR. */
|
72
|
+
mtctr %r0
|
73
|
+
/* Load all those argument registers. */
|
74
|
+
ld %r3, -32-(8*8)(%r28)
|
75
|
+
ld %r4, -32-(7*8)(%r28)
|
76
|
+
ld %r5, -32-(6*8)(%r28)
|
77
|
+
ld %r6, -32-(5*8)(%r28)
|
78
|
+
bf- 5, 1f
|
79
|
+
ld %r7, -32-(4*8)(%r28)
|
80
|
+
ld %r8, -32-(3*8)(%r28)
|
81
|
+
ld %r9, -32-(2*8)(%r28)
|
82
|
+
ld %r10, -32-(1*8)(%r28)
|
83
|
+
1:
|
84
|
+
|
85
|
+
/* Load all the FP registers. */
|
86
|
+
bf- 6, 2f
|
87
|
+
lfd %f1, -32-(21*8)(%r28)
|
88
|
+
lfd %f2, -32-(20*8)(%r28)
|
89
|
+
lfd %f3, -32-(19*8)(%r28)
|
90
|
+
lfd %f4, -32-(18*8)(%r28)
|
91
|
+
lfd %f5, -32-(17*8)(%r28)
|
92
|
+
lfd %f6, -32-(16*8)(%r28)
|
93
|
+
lfd %f7, -32-(15*8)(%r28)
|
94
|
+
lfd %f8, -32-(14*8)(%r28)
|
95
|
+
lfd %f9, -32-(13*8)(%r28)
|
96
|
+
lfd %f10, -32-(12*8)(%r28)
|
97
|
+
lfd %f11, -32-(11*8)(%r28)
|
98
|
+
lfd %f12, -32-(10*8)(%r28)
|
99
|
+
lfd %f13, -32-(9*8)(%r28)
|
100
|
+
2:
|
101
|
+
|
102
|
+
/* Make the call. */
|
103
|
+
bctrl
|
104
|
+
|
105
|
+
/* This must follow the call immediately, the unwinder
|
106
|
+
uses this to find out if r2 has been saved or not. */
|
107
|
+
ld %r2, 40(%r1)
|
108
|
+
|
109
|
+
/* Now, deal with the return value. */
|
110
|
+
mtcrf 0x01, %r31
|
111
|
+
bt- 30, .Ldone_return_value
|
112
|
+
bt- 29, .Lfp_return_value
|
113
|
+
std %r3, 0(%r30)
|
114
|
+
/* Fall through... */
|
115
|
+
|
116
|
+
.Ldone_return_value:
|
117
|
+
/* Restore the registers we used and return. */
|
118
|
+
mr %r1, %r28
|
119
|
+
ld %r0, 16(%r28)
|
120
|
+
ld %r28, -32(%r1)
|
121
|
+
mtlr %r0
|
122
|
+
ld %r29, -24(%r1)
|
123
|
+
ld %r30, -16(%r1)
|
124
|
+
ld %r31, -8(%r1)
|
125
|
+
blr
|
126
|
+
|
127
|
+
.Lfp_return_value:
|
128
|
+
bf 28, .Lfloat_return_value
|
129
|
+
stfd %f1, 0(%r30)
|
130
|
+
mtcrf 0x02, %r31 /* cr6 */
|
131
|
+
bf 27, .Ldone_return_value
|
132
|
+
stfd %f2, 8(%r30)
|
133
|
+
b .Ldone_return_value
|
134
|
+
.Lfloat_return_value:
|
135
|
+
stfs %f1, 0(%r30)
|
136
|
+
b .Ldone_return_value
|
137
|
+
.LFE1:
|
138
|
+
.long 0
|
139
|
+
.byte 0,12,0,1,128,4,0,0
|
140
|
+
.size .ffi_call_LINUX64,.-.ffi_call_LINUX64
|
141
|
+
|
142
|
+
.section .eh_frame,EH_FRAME_FLAGS,@progbits
|
143
|
+
.Lframe1:
|
144
|
+
.4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
|
145
|
+
.LSCIE1:
|
146
|
+
.4byte 0x0 # CIE Identifier Tag
|
147
|
+
.byte 0x1 # CIE Version
|
148
|
+
.ascii "zR\0" # CIE Augmentation
|
149
|
+
.uleb128 0x1 # CIE Code Alignment Factor
|
150
|
+
.sleb128 -8 # CIE Data Alignment Factor
|
151
|
+
.byte 0x41 # CIE RA Column
|
152
|
+
.uleb128 0x1 # Augmentation size
|
153
|
+
.byte 0x14 # FDE Encoding (pcrel udata8)
|
154
|
+
.byte 0xc # DW_CFA_def_cfa
|
155
|
+
.uleb128 0x1
|
156
|
+
.uleb128 0x0
|
157
|
+
.align 3
|
158
|
+
.LECIE1:
|
159
|
+
.LSFDE1:
|
160
|
+
.4byte .LEFDE1-.LASFDE1 # FDE Length
|
161
|
+
.LASFDE1:
|
162
|
+
.4byte .LASFDE1-.Lframe1 # FDE CIE offset
|
163
|
+
.8byte .LFB1-. # FDE initial location
|
164
|
+
.8byte .LFE1-.LFB1 # FDE address range
|
165
|
+
.uleb128 0x0 # Augmentation size
|
166
|
+
.byte 0x2 # DW_CFA_advance_loc1
|
167
|
+
.byte .LCFI0-.LFB1
|
168
|
+
.byte 0xd # DW_CFA_def_cfa_register
|
169
|
+
.uleb128 0x1c
|
170
|
+
.byte 0x11 # DW_CFA_offset_extended_sf
|
171
|
+
.uleb128 0x41
|
172
|
+
.sleb128 -2
|
173
|
+
.byte 0x9f # DW_CFA_offset, column 0x1f
|
174
|
+
.uleb128 0x1
|
175
|
+
.byte 0x9e # DW_CFA_offset, column 0x1e
|
176
|
+
.uleb128 0x2
|
177
|
+
.byte 0x9d # DW_CFA_offset, column 0x1d
|
178
|
+
.uleb128 0x3
|
179
|
+
.byte 0x9c # DW_CFA_offset, column 0x1c
|
180
|
+
.uleb128 0x4
|
181
|
+
.align 3
|
182
|
+
.LEFDE1:
|
183
|
+
#endif
|
184
|
+
|
185
|
+
#if defined __ELF__ && defined __linux__
|
186
|
+
.section .note.GNU-stack,"",@progbits
|
187
|
+
#endif
|
@@ -0,0 +1,236 @@
|
|
1
|
+
/* -----------------------------------------------------------------------
|
2
|
+
sysv.h - Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
|
3
|
+
Copyright (c) 2008 Red Hat, Inc.
|
4
|
+
|
5
|
+
PowerPC64 Assembly glue.
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
a copy of this software and associated documentation files (the
|
9
|
+
``Software''), to deal in the Software without restriction, including
|
10
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be included
|
16
|
+
in all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
22
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
23
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
25
|
+
DEALINGS IN THE SOFTWARE.
|
26
|
+
----------------------------------------------------------------------- */
|
27
|
+
#define LIBFFI_ASM
|
28
|
+
#include <fficonfig.h>
|
29
|
+
#include <ffi.h>
|
30
|
+
|
31
|
+
.file "linux64_closure.S"
|
32
|
+
|
33
|
+
#ifdef __powerpc64__
|
34
|
+
FFI_HIDDEN (ffi_closure_LINUX64)
|
35
|
+
FFI_HIDDEN (.ffi_closure_LINUX64)
|
36
|
+
.globl ffi_closure_LINUX64, .ffi_closure_LINUX64
|
37
|
+
.section ".opd","aw"
|
38
|
+
.align 3
|
39
|
+
ffi_closure_LINUX64:
|
40
|
+
.quad .ffi_closure_LINUX64,.TOC.@tocbase,0
|
41
|
+
.size ffi_closure_LINUX64,24
|
42
|
+
.type .ffi_closure_LINUX64,@function
|
43
|
+
.text
|
44
|
+
.ffi_closure_LINUX64:
|
45
|
+
.LFB1:
|
46
|
+
# save general regs into parm save area
|
47
|
+
std %r3, 48(%r1)
|
48
|
+
std %r4, 56(%r1)
|
49
|
+
std %r5, 64(%r1)
|
50
|
+
std %r6, 72(%r1)
|
51
|
+
mflr %r0
|
52
|
+
|
53
|
+
std %r7, 80(%r1)
|
54
|
+
std %r8, 88(%r1)
|
55
|
+
std %r9, 96(%r1)
|
56
|
+
std %r10, 104(%r1)
|
57
|
+
std %r0, 16(%r1)
|
58
|
+
|
59
|
+
# mandatory 48 bytes special reg save area + 64 bytes parm save area
|
60
|
+
# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
|
61
|
+
stdu %r1, -240(%r1)
|
62
|
+
.LCFI0:
|
63
|
+
|
64
|
+
# next save fpr 1 to fpr 13
|
65
|
+
stfd %f1, 128+(0*8)(%r1)
|
66
|
+
stfd %f2, 128+(1*8)(%r1)
|
67
|
+
stfd %f3, 128+(2*8)(%r1)
|
68
|
+
stfd %f4, 128+(3*8)(%r1)
|
69
|
+
stfd %f5, 128+(4*8)(%r1)
|
70
|
+
stfd %f6, 128+(5*8)(%r1)
|
71
|
+
stfd %f7, 128+(6*8)(%r1)
|
72
|
+
stfd %f8, 128+(7*8)(%r1)
|
73
|
+
stfd %f9, 128+(8*8)(%r1)
|
74
|
+
stfd %f10, 128+(9*8)(%r1)
|
75
|
+
stfd %f11, 128+(10*8)(%r1)
|
76
|
+
stfd %f12, 128+(11*8)(%r1)
|
77
|
+
stfd %f13, 128+(12*8)(%r1)
|
78
|
+
|
79
|
+
# set up registers for the routine that actually does the work
|
80
|
+
# get the context pointer from the trampoline
|
81
|
+
mr %r3, %r11
|
82
|
+
|
83
|
+
# now load up the pointer to the result storage
|
84
|
+
addi %r4, %r1, 112
|
85
|
+
|
86
|
+
# now load up the pointer to the parameter save area
|
87
|
+
# in the previous frame
|
88
|
+
addi %r5, %r1, 240 + 48
|
89
|
+
|
90
|
+
# now load up the pointer to the saved fpr registers */
|
91
|
+
addi %r6, %r1, 128
|
92
|
+
|
93
|
+
# make the call
|
94
|
+
bl .ffi_closure_helper_LINUX64
|
95
|
+
.Lret:
|
96
|
+
|
97
|
+
# now r3 contains the return type
|
98
|
+
# so use it to look up in a table
|
99
|
+
# so we know how to deal with each type
|
100
|
+
|
101
|
+
# look up the proper starting point in table
|
102
|
+
# by using return type as offset
|
103
|
+
mflr %r4 # move address of .Lret to r4
|
104
|
+
sldi %r3, %r3, 4 # now multiply return type by 16
|
105
|
+
addi %r4, %r4, .Lret_type0 - .Lret
|
106
|
+
ld %r0, 240+16(%r1)
|
107
|
+
add %r3, %r3, %r4 # add contents of table to table address
|
108
|
+
mtctr %r3
|
109
|
+
bctr # jump to it
|
110
|
+
|
111
|
+
# Each of the ret_typeX code fragments has to be exactly 16 bytes long
|
112
|
+
# (4 instructions). For cache effectiveness we align to a 16 byte boundary
|
113
|
+
# first.
|
114
|
+
.align 4
|
115
|
+
|
116
|
+
.Lret_type0:
|
117
|
+
# case FFI_TYPE_VOID
|
118
|
+
mtlr %r0
|
119
|
+
addi %r1, %r1, 240
|
120
|
+
blr
|
121
|
+
nop
|
122
|
+
# case FFI_TYPE_INT
|
123
|
+
lwa %r3, 112+4(%r1)
|
124
|
+
mtlr %r0
|
125
|
+
addi %r1, %r1, 240
|
126
|
+
blr
|
127
|
+
# case FFI_TYPE_FLOAT
|
128
|
+
lfs %f1, 112+0(%r1)
|
129
|
+
mtlr %r0
|
130
|
+
addi %r1, %r1, 240
|
131
|
+
blr
|
132
|
+
# case FFI_TYPE_DOUBLE
|
133
|
+
lfd %f1, 112+0(%r1)
|
134
|
+
mtlr %r0
|
135
|
+
addi %r1, %r1, 240
|
136
|
+
blr
|
137
|
+
# case FFI_TYPE_LONGDOUBLE
|
138
|
+
lfd %f1, 112+0(%r1)
|
139
|
+
mtlr %r0
|
140
|
+
lfd %f2, 112+8(%r1)
|
141
|
+
b .Lfinish
|
142
|
+
# case FFI_TYPE_UINT8
|
143
|
+
lbz %r3, 112+7(%r1)
|
144
|
+
mtlr %r0
|
145
|
+
addi %r1, %r1, 240
|
146
|
+
blr
|
147
|
+
# case FFI_TYPE_SINT8
|
148
|
+
lbz %r3, 112+7(%r1)
|
149
|
+
extsb %r3,%r3
|
150
|
+
mtlr %r0
|
151
|
+
b .Lfinish
|
152
|
+
# case FFI_TYPE_UINT16
|
153
|
+
lhz %r3, 112+6(%r1)
|
154
|
+
mtlr %r0
|
155
|
+
.Lfinish:
|
156
|
+
addi %r1, %r1, 240
|
157
|
+
blr
|
158
|
+
# case FFI_TYPE_SINT16
|
159
|
+
lha %r3, 112+6(%r1)
|
160
|
+
mtlr %r0
|
161
|
+
addi %r1, %r1, 240
|
162
|
+
blr
|
163
|
+
# case FFI_TYPE_UINT32
|
164
|
+
lwz %r3, 112+4(%r1)
|
165
|
+
mtlr %r0
|
166
|
+
addi %r1, %r1, 240
|
167
|
+
blr
|
168
|
+
# case FFI_TYPE_SINT32
|
169
|
+
lwa %r3, 112+4(%r1)
|
170
|
+
mtlr %r0
|
171
|
+
addi %r1, %r1, 240
|
172
|
+
blr
|
173
|
+
# case FFI_TYPE_UINT64
|
174
|
+
ld %r3, 112+0(%r1)
|
175
|
+
mtlr %r0
|
176
|
+
addi %r1, %r1, 240
|
177
|
+
blr
|
178
|
+
# case FFI_TYPE_SINT64
|
179
|
+
ld %r3, 112+0(%r1)
|
180
|
+
mtlr %r0
|
181
|
+
addi %r1, %r1, 240
|
182
|
+
blr
|
183
|
+
# case FFI_TYPE_STRUCT
|
184
|
+
mtlr %r0
|
185
|
+
addi %r1, %r1, 240
|
186
|
+
blr
|
187
|
+
nop
|
188
|
+
# case FFI_TYPE_POINTER
|
189
|
+
ld %r3, 112+0(%r1)
|
190
|
+
mtlr %r0
|
191
|
+
addi %r1, %r1, 240
|
192
|
+
blr
|
193
|
+
# esac
|
194
|
+
.LFE1:
|
195
|
+
.long 0
|
196
|
+
.byte 0,12,0,1,128,0,0,0
|
197
|
+
.size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64
|
198
|
+
|
199
|
+
.section .eh_frame,EH_FRAME_FLAGS,@progbits
|
200
|
+
.Lframe1:
|
201
|
+
.4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
|
202
|
+
.LSCIE1:
|
203
|
+
.4byte 0x0 # CIE Identifier Tag
|
204
|
+
.byte 0x1 # CIE Version
|
205
|
+
.ascii "zR\0" # CIE Augmentation
|
206
|
+
.uleb128 0x1 # CIE Code Alignment Factor
|
207
|
+
.sleb128 -8 # CIE Data Alignment Factor
|
208
|
+
.byte 0x41 # CIE RA Column
|
209
|
+
.uleb128 0x1 # Augmentation size
|
210
|
+
.byte 0x14 # FDE Encoding (pcrel udata8)
|
211
|
+
.byte 0xc # DW_CFA_def_cfa
|
212
|
+
.uleb128 0x1
|
213
|
+
.uleb128 0x0
|
214
|
+
.align 3
|
215
|
+
.LECIE1:
|
216
|
+
.LSFDE1:
|
217
|
+
.4byte .LEFDE1-.LASFDE1 # FDE Length
|
218
|
+
.LASFDE1:
|
219
|
+
.4byte .LASFDE1-.Lframe1 # FDE CIE offset
|
220
|
+
.8byte .LFB1-. # FDE initial location
|
221
|
+
.8byte .LFE1-.LFB1 # FDE address range
|
222
|
+
.uleb128 0x0 # Augmentation size
|
223
|
+
.byte 0x2 # DW_CFA_advance_loc1
|
224
|
+
.byte .LCFI0-.LFB1
|
225
|
+
.byte 0xe # DW_CFA_def_cfa_offset
|
226
|
+
.uleb128 240
|
227
|
+
.byte 0x11 # DW_CFA_offset_extended_sf
|
228
|
+
.uleb128 0x41
|
229
|
+
.sleb128 -2
|
230
|
+
.align 3
|
231
|
+
.LEFDE1:
|
232
|
+
#endif
|
233
|
+
|
234
|
+
#if defined __ELF__ && defined __linux__
|
235
|
+
.section .note.GNU-stack,"",@progbits
|
236
|
+
#endif
|