ffi 1.9.21-x86-mingw32 → 1.9.22-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.

Files changed (551) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +22 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +52 -0
  5. data/.yardopts +5 -0
  6. data/Gemfile +15 -0
  7. data/{spec/ffi/LICENSE.SPECS → LICENSE.SPECS} +1 -1
  8. data/README.md +1 -1
  9. data/Rakefile +28 -3
  10. data/appveyor.yml +22 -0
  11. data/ffi.gemspec +14 -1
  12. data/lib/2.0/ffi_c.so +0 -0
  13. data/lib/2.1/ffi_c.so +0 -0
  14. data/lib/2.2/ffi_c.so +0 -0
  15. data/lib/2.3/ffi_c.so +0 -0
  16. data/lib/2.4/ffi_c.so +0 -0
  17. data/lib/2.5/ffi_c.so +0 -0
  18. data/lib/ffi/library.rb +1 -1
  19. data/lib/ffi/version.rb +1 -1
  20. data/samples/getlogin.rb +8 -0
  21. data/samples/getpid.rb +8 -0
  22. data/samples/gettimeofday.rb +18 -0
  23. data/samples/hello.rb +7 -0
  24. data/samples/inotify.rb +60 -0
  25. data/samples/pty.rb +76 -0
  26. data/samples/qsort.rb +21 -0
  27. data/samples/sample_helper.rb +6 -0
  28. metadata +17 -526
  29. data/ext/ffi_c/AbstractMemory.c +0 -1109
  30. data/ext/ffi_c/AbstractMemory.h +0 -175
  31. data/ext/ffi_c/ArrayType.c +0 -162
  32. data/ext/ffi_c/ArrayType.h +0 -59
  33. data/ext/ffi_c/Buffer.c +0 -365
  34. data/ext/ffi_c/Call.c +0 -517
  35. data/ext/ffi_c/Call.h +0 -110
  36. data/ext/ffi_c/ClosurePool.c +0 -283
  37. data/ext/ffi_c/ClosurePool.h +0 -57
  38. data/ext/ffi_c/DataConverter.c +0 -91
  39. data/ext/ffi_c/DynamicLibrary.c +0 -339
  40. data/ext/ffi_c/DynamicLibrary.h +0 -98
  41. data/ext/ffi_c/Function.c +0 -998
  42. data/ext/ffi_c/Function.h +0 -87
  43. data/ext/ffi_c/FunctionInfo.c +0 -271
  44. data/ext/ffi_c/LastError.c +0 -184
  45. data/ext/ffi_c/LastError.h +0 -47
  46. data/ext/ffi_c/LongDouble.c +0 -63
  47. data/ext/ffi_c/LongDouble.h +0 -51
  48. data/ext/ffi_c/MappedType.c +0 -168
  49. data/ext/ffi_c/MappedType.h +0 -59
  50. data/ext/ffi_c/MemoryPointer.c +0 -197
  51. data/ext/ffi_c/MemoryPointer.h +0 -53
  52. data/ext/ffi_c/MethodHandle.c +0 -358
  53. data/ext/ffi_c/MethodHandle.h +0 -55
  54. data/ext/ffi_c/Platform.c +0 -129
  55. data/ext/ffi_c/Platform.h +0 -45
  56. data/ext/ffi_c/Pointer.c +0 -508
  57. data/ext/ffi_c/Pointer.h +0 -63
  58. data/ext/ffi_c/Struct.c +0 -829
  59. data/ext/ffi_c/Struct.h +0 -106
  60. data/ext/ffi_c/StructByReference.c +0 -190
  61. data/ext/ffi_c/StructByReference.h +0 -50
  62. data/ext/ffi_c/StructByValue.c +0 -150
  63. data/ext/ffi_c/StructByValue.h +0 -55
  64. data/ext/ffi_c/StructLayout.c +0 -698
  65. data/ext/ffi_c/Thread.c +0 -352
  66. data/ext/ffi_c/Thread.h +0 -95
  67. data/ext/ffi_c/Type.c +0 -397
  68. data/ext/ffi_c/Type.h +0 -62
  69. data/ext/ffi_c/Types.c +0 -139
  70. data/ext/ffi_c/Types.h +0 -89
  71. data/ext/ffi_c/Variadic.c +0 -304
  72. data/ext/ffi_c/compat.h +0 -78
  73. data/ext/ffi_c/extconf.rb +0 -71
  74. data/ext/ffi_c/ffi.c +0 -98
  75. data/ext/ffi_c/libffi.bsd.mk +0 -40
  76. data/ext/ffi_c/libffi.darwin.mk +0 -105
  77. data/ext/ffi_c/libffi.gnu.mk +0 -32
  78. data/ext/ffi_c/libffi.mk +0 -18
  79. data/ext/ffi_c/libffi.vc.mk +0 -26
  80. data/ext/ffi_c/libffi.vc64.mk +0 -26
  81. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  82. data/ext/ffi_c/libffi/ChangeLog.libffi-3.1 +0 -6000
  83. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  84. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  85. data/ext/ffi_c/libffi/LICENSE +0 -21
  86. data/ext/ffi_c/libffi/Makefile.am +0 -205
  87. data/ext/ffi_c/libffi/Makefile.in +0 -1805
  88. data/ext/ffi_c/libffi/README +0 -454
  89. data/ext/ffi_c/libffi/acinclude.m4 +0 -473
  90. data/ext/ffi_c/libffi/aclocal.m4 +0 -2134
  91. data/ext/ffi_c/libffi/autogen.sh +0 -2
  92. data/ext/ffi_c/libffi/autom4te.cache/output.0 +0 -21972
  93. data/ext/ffi_c/libffi/autom4te.cache/output.1 +0 -21972
  94. data/ext/ffi_c/libffi/autom4te.cache/output.2 +0 -21972
  95. data/ext/ffi_c/libffi/autom4te.cache/output.3 +0 -21972
  96. data/ext/ffi_c/libffi/autom4te.cache/requests +0 -331
  97. data/ext/ffi_c/libffi/autom4te.cache/traces.0 +0 -4010
  98. data/ext/ffi_c/libffi/autom4te.cache/traces.1 +0 -1005
  99. data/ext/ffi_c/libffi/autom4te.cache/traces.2 +0 -4010
  100. data/ext/ffi_c/libffi/autom4te.cache/traces.3 +0 -4010
  101. data/ext/ffi_c/libffi/compile +0 -347
  102. data/ext/ffi_c/libffi/config.guess +0 -1462
  103. data/ext/ffi_c/libffi/config.sub +0 -1825
  104. data/ext/ffi_c/libffi/configure +0 -21972
  105. data/ext/ffi_c/libffi/configure.ac +0 -388
  106. data/ext/ffi_c/libffi/configure.host +0 -272
  107. data/ext/ffi_c/libffi/depcomp +0 -791
  108. data/ext/ffi_c/libffi/doc/Makefile.am +0 -3
  109. data/ext/ffi_c/libffi/doc/Makefile.in +0 -811
  110. data/ext/ffi_c/libffi/doc/libffi.texi +0 -985
  111. data/ext/ffi_c/libffi/doc/mdate-sh +0 -228
  112. data/ext/ffi_c/libffi/doc/texinfo.tex +0 -10079
  113. data/ext/ffi_c/libffi/doc/version.texi +0 -4
  114. data/ext/ffi_c/libffi/fficonfig.h.in +0 -210
  115. data/ext/ffi_c/libffi/fficonfig.h.in~ +0 -210
  116. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +0 -207
  117. data/ext/ffi_c/libffi/include/Makefile.am +0 -9
  118. data/ext/ffi_c/libffi/include/Makefile.in +0 -604
  119. data/ext/ffi_c/libffi/include/ffi.h.in +0 -484
  120. data/ext/ffi_c/libffi/include/ffi_cfi.h +0 -55
  121. data/ext/ffi_c/libffi/include/ffi_common.h +0 -147
  122. data/ext/ffi_c/libffi/install-sh +0 -508
  123. data/ext/ffi_c/libffi/libffi.map.in +0 -80
  124. data/ext/ffi_c/libffi/libffi.pc.in +0 -11
  125. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +0 -637
  126. data/ext/ffi_c/libffi/libtool-ldflags +0 -106
  127. data/ext/ffi_c/libffi/libtool-version +0 -29
  128. data/ext/ffi_c/libffi/ltmain.sh +0 -11156
  129. data/ext/ffi_c/libffi/m4/asmcfi.m4 +0 -13
  130. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +0 -69
  131. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +0 -181
  132. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +0 -122
  133. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +0 -72
  134. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +0 -84
  135. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +0 -70
  136. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +0 -301
  137. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +0 -225
  138. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +0 -79
  139. data/ext/ffi_c/libffi/m4/libtool.m4 +0 -8387
  140. data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -437
  141. data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -124
  142. data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
  143. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -99
  144. data/ext/ffi_c/libffi/man/Makefile.am +0 -8
  145. data/ext/ffi_c/libffi/man/Makefile.in +0 -558
  146. data/ext/ffi_c/libffi/man/ffi.3 +0 -41
  147. data/ext/ffi_c/libffi/man/ffi_call.3 +0 -103
  148. data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +0 -68
  149. data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +0 -73
  150. data/ext/ffi_c/libffi/missing +0 -215
  151. data/ext/ffi_c/libffi/msvcc.sh +0 -260
  152. data/ext/ffi_c/libffi/src/aarch64/ffi.c +0 -941
  153. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +0 -81
  154. data/ext/ffi_c/libffi/src/aarch64/internal.h +0 -67
  155. data/ext/ffi_c/libffi/src/aarch64/sysv.S +0 -438
  156. data/ext/ffi_c/libffi/src/alpha/ffi.c +0 -521
  157. data/ext/ffi_c/libffi/src/alpha/ffitarget.h +0 -57
  158. data/ext/ffi_c/libffi/src/alpha/internal.h +0 -23
  159. data/ext/ffi_c/libffi/src/alpha/osf.S +0 -282
  160. data/ext/ffi_c/libffi/src/arc/arcompact.S +0 -135
  161. data/ext/ffi_c/libffi/src/arc/ffi.c +0 -266
  162. data/ext/ffi_c/libffi/src/arc/ffitarget.h +0 -53
  163. data/ext/ffi_c/libffi/src/arm/ffi.c +0 -808
  164. data/ext/ffi_c/libffi/src/arm/ffitarget.h +0 -82
  165. data/ext/ffi_c/libffi/src/arm/internal.h +0 -7
  166. data/ext/ffi_c/libffi/src/arm/sysv.S +0 -383
  167. data/ext/ffi_c/libffi/src/avr32/ffi.c +0 -423
  168. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +0 -55
  169. data/ext/ffi_c/libffi/src/avr32/sysv.S +0 -208
  170. data/ext/ffi_c/libffi/src/bfin/ffi.c +0 -196
  171. data/ext/ffi_c/libffi/src/bfin/ffitarget.h +0 -43
  172. data/ext/ffi_c/libffi/src/bfin/sysv.S +0 -179
  173. data/ext/ffi_c/libffi/src/closures.c +0 -890
  174. data/ext/ffi_c/libffi/src/cris/ffi.c +0 -386
  175. data/ext/ffi_c/libffi/src/cris/ffitarget.h +0 -56
  176. data/ext/ffi_c/libffi/src/cris/sysv.S +0 -215
  177. data/ext/ffi_c/libffi/src/debug.c +0 -64
  178. data/ext/ffi_c/libffi/src/dlmalloc.c +0 -5166
  179. data/ext/ffi_c/libffi/src/frv/eabi.S +0 -128
  180. data/ext/ffi_c/libffi/src/frv/ffi.c +0 -292
  181. data/ext/ffi_c/libffi/src/frv/ffitarget.h +0 -62
  182. data/ext/ffi_c/libffi/src/ia64/ffi.c +0 -586
  183. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +0 -55
  184. data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +0 -40
  185. data/ext/ffi_c/libffi/src/ia64/unix.S +0 -560
  186. data/ext/ffi_c/libffi/src/java_raw_api.c +0 -374
  187. data/ext/ffi_c/libffi/src/m32r/ffi.c +0 -232
  188. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +0 -53
  189. data/ext/ffi_c/libffi/src/m32r/sysv.S +0 -121
  190. data/ext/ffi_c/libffi/src/m68k/ffi.c +0 -362
  191. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +0 -54
  192. data/ext/ffi_c/libffi/src/m68k/sysv.S +0 -357
  193. data/ext/ffi_c/libffi/src/m88k/ffi.c +0 -400
  194. data/ext/ffi_c/libffi/src/m88k/ffitarget.h +0 -49
  195. data/ext/ffi_c/libffi/src/m88k/obsd.S +0 -209
  196. data/ext/ffi_c/libffi/src/metag/ffi.c +0 -330
  197. data/ext/ffi_c/libffi/src/metag/ffitarget.h +0 -53
  198. data/ext/ffi_c/libffi/src/metag/sysv.S +0 -311
  199. data/ext/ffi_c/libffi/src/microblaze/ffi.c +0 -321
  200. data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +0 -53
  201. data/ext/ffi_c/libffi/src/microblaze/sysv.S +0 -302
  202. data/ext/ffi_c/libffi/src/mips/ffi.c +0 -1105
  203. data/ext/ffi_c/libffi/src/mips/ffitarget.h +0 -249
  204. data/ext/ffi_c/libffi/src/mips/n32.S +0 -661
  205. data/ext/ffi_c/libffi/src/mips/o32.S +0 -502
  206. data/ext/ffi_c/libffi/src/moxie/eabi.S +0 -101
  207. data/ext/ffi_c/libffi/src/moxie/ffi.c +0 -272
  208. data/ext/ffi_c/libffi/src/moxie/ffitarget.h +0 -52
  209. data/ext/ffi_c/libffi/src/nios2/ffi.c +0 -304
  210. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +0 -52
  211. data/ext/ffi_c/libffi/src/nios2/sysv.S +0 -136
  212. data/ext/ffi_c/libffi/src/or1k/ffi.c +0 -328
  213. data/ext/ffi_c/libffi/src/or1k/ffitarget.h +0 -58
  214. data/ext/ffi_c/libffi/src/or1k/sysv.S +0 -107
  215. data/ext/ffi_c/libffi/src/pa/ffi.c +0 -719
  216. data/ext/ffi_c/libffi/src/pa/ffitarget.h +0 -85
  217. data/ext/ffi_c/libffi/src/pa/hpux32.S +0 -368
  218. data/ext/ffi_c/libffi/src/pa/linux.S +0 -357
  219. data/ext/ffi_c/libffi/src/powerpc/aix.S +0 -328
  220. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +0 -447
  221. data/ext/ffi_c/libffi/src/powerpc/asm.h +0 -125
  222. data/ext/ffi_c/libffi/src/powerpc/darwin.S +0 -378
  223. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +0 -571
  224. data/ext/ffi_c/libffi/src/powerpc/ffi.c +0 -173
  225. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +0 -1359
  226. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +0 -945
  227. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +0 -94
  228. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +0 -923
  229. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +0 -195
  230. data/ext/ffi_c/libffi/src/powerpc/linux64.S +0 -228
  231. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +0 -488
  232. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +0 -397
  233. data/ext/ffi_c/libffi/src/powerpc/sysv.S +0 -175
  234. data/ext/ffi_c/libffi/src/prep_cif.c +0 -261
  235. data/ext/ffi_c/libffi/src/raw_api.c +0 -267
  236. data/ext/ffi_c/libffi/src/s390/ffi.c +0 -756
  237. data/ext/ffi_c/libffi/src/s390/ffitarget.h +0 -70
  238. data/ext/ffi_c/libffi/src/s390/internal.h +0 -11
  239. data/ext/ffi_c/libffi/src/s390/sysv.S +0 -325
  240. data/ext/ffi_c/libffi/src/sh/ffi.c +0 -717
  241. data/ext/ffi_c/libffi/src/sh/ffitarget.h +0 -54
  242. data/ext/ffi_c/libffi/src/sh/sysv.S +0 -850
  243. data/ext/ffi_c/libffi/src/sh64/ffi.c +0 -469
  244. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +0 -58
  245. data/ext/ffi_c/libffi/src/sh64/sysv.S +0 -539
  246. data/ext/ffi_c/libffi/src/sparc/ffi.c +0 -468
  247. data/ext/ffi_c/libffi/src/sparc/ffi64.c +0 -608
  248. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +0 -81
  249. data/ext/ffi_c/libffi/src/sparc/internal.h +0 -26
  250. data/ext/ffi_c/libffi/src/sparc/v8.S +0 -443
  251. data/ext/ffi_c/libffi/src/sparc/v9.S +0 -440
  252. data/ext/ffi_c/libffi/src/tile/ffi.c +0 -355
  253. data/ext/ffi_c/libffi/src/tile/ffitarget.h +0 -65
  254. data/ext/ffi_c/libffi/src/tile/tile.S +0 -360
  255. data/ext/ffi_c/libffi/src/types.c +0 -106
  256. data/ext/ffi_c/libffi/src/vax/elfbsd.S +0 -195
  257. data/ext/ffi_c/libffi/src/vax/ffi.c +0 -276
  258. data/ext/ffi_c/libffi/src/vax/ffitarget.h +0 -49
  259. data/ext/ffi_c/libffi/src/x86/asmnames.h +0 -30
  260. data/ext/ffi_c/libffi/src/x86/ffi.c +0 -733
  261. data/ext/ffi_c/libffi/src/x86/ffi64.c +0 -857
  262. data/ext/ffi_c/libffi/src/x86/ffitarget.h +0 -141
  263. data/ext/ffi_c/libffi/src/x86/ffiw64.c +0 -287
  264. data/ext/ffi_c/libffi/src/x86/internal.h +0 -29
  265. data/ext/ffi_c/libffi/src/x86/internal64.h +0 -22
  266. data/ext/ffi_c/libffi/src/x86/sysv.S +0 -1043
  267. data/ext/ffi_c/libffi/src/x86/unix64.S +0 -525
  268. data/ext/ffi_c/libffi/src/x86/win64.S +0 -232
  269. data/ext/ffi_c/libffi/src/x86/win64_intel.S +0 -237
  270. data/ext/ffi_c/libffi/src/xtensa/ffi.c +0 -298
  271. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +0 -53
  272. data/ext/ffi_c/libffi/src/xtensa/sysv.S +0 -253
  273. data/ext/ffi_c/libffi/stamp-h.in +0 -1
  274. data/ext/ffi_c/libffi/testsuite/Makefile.am +0 -85
  275. data/ext/ffi_c/libffi/testsuite/Makefile.in +0 -607
  276. data/ext/ffi_c/libffi/testsuite/config/default.exp +0 -1
  277. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +0 -445
  278. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +0 -283
  279. data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +0 -45
  280. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +0 -46
  281. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +0 -30
  282. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +0 -89
  283. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +0 -81
  284. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +0 -81
  285. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +0 -82
  286. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +0 -89
  287. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +0 -92
  288. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +0 -90
  289. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_loc_fn0.c +0 -95
  290. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_simple.c +0 -55
  291. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +0 -94
  292. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +0 -95
  293. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +0 -96
  294. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +0 -102
  295. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +0 -89
  296. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +0 -91
  297. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +0 -93
  298. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +0 -113
  299. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +0 -90
  300. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +0 -95
  301. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +0 -90
  302. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +0 -90
  303. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +0 -98
  304. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +0 -90
  305. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +0 -109
  306. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +0 -98
  307. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +0 -124
  308. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +0 -113
  309. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +0 -99
  310. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +0 -117
  311. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +0 -97
  312. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +0 -88
  313. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +0 -90
  314. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +0 -91
  315. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +0 -93
  316. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +0 -91
  317. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +0 -92
  318. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +0 -132
  319. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +0 -115
  320. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +0 -95
  321. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +0 -91
  322. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +0 -91
  323. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +0 -92
  324. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +0 -91
  325. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +0 -91
  326. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +0 -93
  327. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +0 -66
  328. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +0 -43
  329. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +0 -61
  330. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +0 -42
  331. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +0 -105
  332. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +0 -61
  333. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_args.c +0 -70
  334. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_float_double.c +0 -55
  335. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +0 -74
  336. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +0 -74
  337. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +0 -86
  338. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +0 -91
  339. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +0 -74
  340. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +0 -86
  341. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +0 -74
  342. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +0 -142
  343. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +0 -44
  344. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +0 -42
  345. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +0 -42
  346. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_struct_va1.c +0 -114
  347. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +0 -42
  348. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +0 -44
  349. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +0 -43
  350. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint_va.c +0 -45
  351. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulong_va.c +0 -45
  352. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +0 -47
  353. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +0 -43
  354. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +0 -44
  355. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +0 -36
  356. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +0 -26
  357. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +0 -136
  358. data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +0 -59
  359. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +0 -60
  360. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +0 -60
  361. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +0 -74
  362. data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +0 -62
  363. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +0 -107
  364. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +0 -341
  365. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +0 -59
  366. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +0 -57
  367. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +0 -70
  368. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +0 -78
  369. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -52
  370. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +0 -152
  371. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +0 -161
  372. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +0 -133
  373. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct11.c +0 -121
  374. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +0 -110
  375. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +0 -111
  376. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +0 -111
  377. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +0 -112
  378. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +0 -131
  379. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +0 -111
  380. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +0 -131
  381. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +0 -131
  382. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +0 -46
  383. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +0 -127
  384. data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +0 -90
  385. data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +0 -59
  386. data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +0 -114
  387. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +0 -36
  388. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +0 -43
  389. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +0 -42
  390. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +0 -35
  391. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +0 -36
  392. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +0 -49
  393. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +0 -42
  394. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +0 -34
  395. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +0 -41
  396. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +0 -43
  397. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +0 -36
  398. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +0 -38
  399. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +0 -38
  400. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +0 -38
  401. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large.c +0 -145
  402. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +0 -148
  403. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +0 -124
  404. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +0 -125
  405. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +0 -44
  406. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +0 -49
  407. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +0 -49
  408. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +0 -55
  409. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +0 -67
  410. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +0 -67
  411. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +0 -60
  412. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +0 -64
  413. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +0 -66
  414. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +0 -64
  415. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +0 -74
  416. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +0 -81
  417. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +0 -68
  418. data/ext/ffi_c/libffi/testsuite/libffi.call/testclosure.c +0 -70
  419. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +0 -61
  420. data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest.cc +0 -117
  421. data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc +0 -54
  422. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +0 -196
  423. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +0 -121
  424. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +0 -123
  425. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +0 -125
  426. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +0 -91
  427. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +0 -10
  428. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +0 -10
  429. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +0 -10
  430. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +0 -42
  431. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +0 -10
  432. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +0 -10
  433. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +0 -10
  434. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +0 -71
  435. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +0 -10
  436. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +0 -10
  437. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +0 -10
  438. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +0 -80
  439. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +0 -10
  440. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +0 -16
  441. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +0 -10
  442. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +0 -36
  443. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +0 -51
  444. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +0 -7
  445. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +0 -7
  446. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +0 -7
  447. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +0 -10
  448. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +0 -10
  449. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +0 -86
  450. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +0 -10
  451. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +0 -1
  452. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +0 -78
  453. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +0 -10
  454. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +0 -10
  455. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +0 -10
  456. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +0 -37
  457. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +0 -41
  458. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +0 -10
  459. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +0 -10
  460. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +0 -10
  461. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +0 -44
  462. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +0 -10
  463. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +0 -10
  464. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +0 -10
  465. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +0 -10
  466. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +0 -10
  467. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +0 -10
  468. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +0 -34
  469. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +0 -28
  470. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +0 -1
  471. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +0 -36
  472. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +0 -19
  473. data/ext/ffi_c/rbffi.h +0 -57
  474. data/ext/ffi_c/rbffi_endian.h +0 -59
  475. data/ext/ffi_c/win32/stdbool.h +0 -8
  476. data/ext/ffi_c/win32/stdint.h +0 -201
  477. data/gen/Rakefile +0 -30
  478. data/libtest/Benchmark.c +0 -52
  479. data/libtest/BoolTest.c +0 -34
  480. data/libtest/BufferTest.c +0 -31
  481. data/libtest/ClosureTest.c +0 -205
  482. data/libtest/EnumTest.c +0 -51
  483. data/libtest/FunctionTest.c +0 -70
  484. data/libtest/GNUmakefile +0 -149
  485. data/libtest/GlobalVariable.c +0 -62
  486. data/libtest/LastErrorTest.c +0 -21
  487. data/libtest/NumberTest.c +0 -132
  488. data/libtest/PointerTest.c +0 -63
  489. data/libtest/ReferenceTest.c +0 -23
  490. data/libtest/StringTest.c +0 -34
  491. data/libtest/StructTest.c +0 -243
  492. data/libtest/UnionTest.c +0 -43
  493. data/libtest/VariadicTest.c +0 -99
  494. data/spec/ffi/async_callback_spec.rb +0 -35
  495. data/spec/ffi/bitmask_spec.rb +0 -575
  496. data/spec/ffi/bool_spec.rb +0 -32
  497. data/spec/ffi/buffer_spec.rb +0 -279
  498. data/spec/ffi/callback_spec.rb +0 -773
  499. data/spec/ffi/custom_param_type.rb +0 -37
  500. data/spec/ffi/custom_type_spec.rb +0 -74
  501. data/spec/ffi/dup_spec.rb +0 -52
  502. data/spec/ffi/embed-test/ext/Makefile +0 -242
  503. data/spec/ffi/enum_spec.rb +0 -423
  504. data/spec/ffi/errno_spec.rb +0 -20
  505. data/spec/ffi/ffi_spec.rb +0 -28
  506. data/spec/ffi/fixtures/Benchmark.c +0 -52
  507. data/spec/ffi/fixtures/BitmaskTest.c +0 -51
  508. data/spec/ffi/fixtures/BoolTest.c +0 -34
  509. data/spec/ffi/fixtures/BufferTest.c +0 -31
  510. data/spec/ffi/fixtures/ClosureTest.c +0 -205
  511. data/spec/ffi/fixtures/EnumTest.c +0 -51
  512. data/spec/ffi/fixtures/FunctionTest.c +0 -142
  513. data/spec/ffi/fixtures/GNUmakefile +0 -149
  514. data/spec/ffi/fixtures/GlobalVariable.c +0 -62
  515. data/spec/ffi/fixtures/LastErrorTest.c +0 -21
  516. data/spec/ffi/fixtures/NumberTest.c +0 -132
  517. data/spec/ffi/fixtures/PipeHelper.h +0 -21
  518. data/spec/ffi/fixtures/PipeHelperPosix.c +0 -41
  519. data/spec/ffi/fixtures/PipeHelperWindows.c +0 -72
  520. data/spec/ffi/fixtures/PointerTest.c +0 -63
  521. data/spec/ffi/fixtures/ReferenceTest.c +0 -23
  522. data/spec/ffi/fixtures/StringTest.c +0 -34
  523. data/spec/ffi/fixtures/StructTest.c +0 -243
  524. data/spec/ffi/fixtures/UnionTest.c +0 -43
  525. data/spec/ffi/fixtures/VariadicTest.c +0 -99
  526. data/spec/ffi/fixtures/classes.rb +0 -438
  527. data/spec/ffi/function_spec.rb +0 -97
  528. data/spec/ffi/io_spec.rb +0 -16
  529. data/spec/ffi/library_spec.rb +0 -286
  530. data/spec/ffi/long_double.rb +0 -30
  531. data/spec/ffi/managed_struct_spec.rb +0 -68
  532. data/spec/ffi/memorypointer_spec.rb +0 -78
  533. data/spec/ffi/number_spec.rb +0 -247
  534. data/spec/ffi/platform_spec.rb +0 -114
  535. data/spec/ffi/pointer_spec.rb +0 -285
  536. data/spec/ffi/rbx/attach_function_spec.rb +0 -34
  537. data/spec/ffi/rbx/memory_pointer_spec.rb +0 -198
  538. data/spec/ffi/rbx/spec_helper.rb +0 -6
  539. data/spec/ffi/rbx/struct_spec.rb +0 -18
  540. data/spec/ffi/spec_helper.rb +0 -93
  541. data/spec/ffi/string_spec.rb +0 -118
  542. data/spec/ffi/strptr_spec.rb +0 -50
  543. data/spec/ffi/struct_by_ref_spec.rb +0 -43
  544. data/spec/ffi/struct_callback_spec.rb +0 -69
  545. data/spec/ffi/struct_initialize_spec.rb +0 -35
  546. data/spec/ffi/struct_packed_spec.rb +0 -50
  547. data/spec/ffi/struct_spec.rb +0 -882
  548. data/spec/ffi/typedef_spec.rb +0 -91
  549. data/spec/ffi/union_spec.rb +0 -67
  550. data/spec/ffi/variadic_spec.rb +0 -132
  551. data/spec/spec.opts +0 -4
@@ -1,22 +0,0 @@
1
- #define UNIX64_RET_VOID 0
2
- #define UNIX64_RET_UINT8 1
3
- #define UNIX64_RET_UINT16 2
4
- #define UNIX64_RET_UINT32 3
5
- #define UNIX64_RET_SINT8 4
6
- #define UNIX64_RET_SINT16 5
7
- #define UNIX64_RET_SINT32 6
8
- #define UNIX64_RET_INT64 7
9
- #define UNIX64_RET_XMM32 8
10
- #define UNIX64_RET_XMM64 9
11
- #define UNIX64_RET_X87 10
12
- #define UNIX64_RET_X87_2 11
13
- #define UNIX64_RET_ST_XMM0_RAX 12
14
- #define UNIX64_RET_ST_RAX_XMM0 13
15
- #define UNIX64_RET_ST_XMM0_XMM1 14
16
- #define UNIX64_RET_ST_RAX_RDX 15
17
-
18
- #define UNIX64_RET_LAST 15
19
-
20
- #define UNIX64_FLAG_RET_IN_MEM (1 << 10)
21
- #define UNIX64_FLAG_XMM_ARGS (1 << 11)
22
- #define UNIX64_SIZE_SHIFT 12
@@ -1,1043 +0,0 @@
1
- /* -----------------------------------------------------------------------
2
- sysv.S - Copyright (c) 2017 Anthony Green
3
- - Copyright (c) 2013 The Written Word, Inc.
4
- - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
5
-
6
- X86 Foreign Function Interface
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining
9
- a copy of this software and associated documentation files (the
10
- ``Software''), to deal in the Software without restriction, including
11
- without limitation the rights to use, copy, modify, merge, publish,
12
- distribute, sublicense, and/or sell copies of the Software, and to
13
- permit persons to whom the Software is furnished to do so, subject to
14
- the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included
17
- in all copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
20
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
- DEALINGS IN THE SOFTWARE.
27
- ----------------------------------------------------------------------- */
28
-
29
- #ifndef __x86_64__
30
- #ifndef _MSC_VER
31
-
32
- #define LIBFFI_ASM
33
- #include <fficonfig.h>
34
- #include <ffi.h>
35
- #include "internal.h"
36
-
37
- #define C2(X, Y) X ## Y
38
- #define C1(X, Y) C2(X, Y)
39
- #ifdef __USER_LABEL_PREFIX__
40
- # define C(X) C1(__USER_LABEL_PREFIX__, X)
41
- #else
42
- # define C(X) X
43
- #endif
44
-
45
- #ifdef X86_DARWIN
46
- # define L(X) C1(L, X)
47
- #else
48
- # define L(X) C1(.L, X)
49
- #endif
50
-
51
- #ifdef __ELF__
52
- # define ENDF(X) .type X,@function; .size X, . - X
53
- #else
54
- # define ENDF(X)
55
- #endif
56
-
57
- /* Handle win32 fastcall name mangling. */
58
- #ifdef X86_WIN32
59
- # define ffi_call_i386 @ffi_call_i386@8
60
- # define ffi_closure_inner @ffi_closure_inner@8
61
- #else
62
- # define ffi_call_i386 C(ffi_call_i386)
63
- # define ffi_closure_inner C(ffi_closure_inner)
64
- #endif
65
-
66
- /* This macro allows the safe creation of jump tables without an
67
- actual table. The entry points into the table are all 8 bytes.
68
- The use of ORG asserts that we're at the correct location. */
69
- /* ??? The clang assembler doesn't handle .org with symbolic expressions. */
70
- #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
71
- # define E(BASE, X) .balign 8
72
- #else
73
- # define E(BASE, X) .balign 8; .org BASE + X * 8
74
- #endif
75
-
76
- .text
77
- .balign 16
78
- .globl ffi_call_i386
79
- FFI_HIDDEN(ffi_call_i386)
80
-
81
- /* This is declared as
82
-
83
- void ffi_call_i386(struct call_frame *frame, char *argp)
84
- __attribute__((fastcall));
85
-
86
- Thus the arguments are present in
87
-
88
- ecx: frame
89
- edx: argp
90
- */
91
-
92
- ffi_call_i386:
93
- L(UW0):
94
- # cfi_startproc
95
- #if !HAVE_FASTCALL
96
- movl 4(%esp), %ecx
97
- movl 8(%esp), %edx
98
- #endif
99
- movl (%esp), %eax /* move the return address */
100
- movl %ebp, (%ecx) /* store %ebp into local frame */
101
- movl %eax, 4(%ecx) /* store retaddr into local frame */
102
-
103
- /* New stack frame based off ebp. This is a itty bit of unwind
104
- trickery in that the CFA *has* changed. There is no easy way
105
- to describe it correctly on entry to the function. Fortunately,
106
- it doesn't matter too much since at all points we can correctly
107
- unwind back to ffi_call. Note that the location to which we
108
- moved the return address is (the new) CFA-4, so from the
109
- perspective of the unwind info, it hasn't moved. */
110
- movl %ecx, %ebp
111
- L(UW1):
112
- # cfi_def_cfa(%ebp, 8)
113
- # cfi_rel_offset(%ebp, 0)
114
-
115
- movl %edx, %esp /* set outgoing argument stack */
116
- movl 20+R_EAX*4(%ebp), %eax /* set register arguments */
117
- movl 20+R_EDX*4(%ebp), %edx
118
- movl 20+R_ECX*4(%ebp), %ecx
119
-
120
- call *8(%ebp)
121
-
122
- movl 12(%ebp), %ecx /* load return type code */
123
- movl %ebx, 8(%ebp) /* preserve %ebx */
124
- L(UW2):
125
- # cfi_rel_offset(%ebx, 8)
126
-
127
- andl $X86_RET_TYPE_MASK, %ecx
128
- #ifdef __PIC__
129
- call C(__x86.get_pc_thunk.bx)
130
- L(pc1):
131
- leal L(store_table)-L(pc1)(%ebx, %ecx, 8), %ebx
132
- #else
133
- leal L(store_table)(,%ecx, 8), %ebx
134
- #endif
135
- movl 16(%ebp), %ecx /* load result address */
136
- jmp *%ebx
137
-
138
- .balign 8
139
- L(store_table):
140
- E(L(store_table), X86_RET_FLOAT)
141
- fstps (%ecx)
142
- jmp L(e1)
143
- E(L(store_table), X86_RET_DOUBLE)
144
- fstpl (%ecx)
145
- jmp L(e1)
146
- E(L(store_table), X86_RET_LDOUBLE)
147
- fstpt (%ecx)
148
- jmp L(e1)
149
- E(L(store_table), X86_RET_SINT8)
150
- movsbl %al, %eax
151
- mov %eax, (%ecx)
152
- jmp L(e1)
153
- E(L(store_table), X86_RET_SINT16)
154
- movswl %ax, %eax
155
- mov %eax, (%ecx)
156
- jmp L(e1)
157
- E(L(store_table), X86_RET_UINT8)
158
- movzbl %al, %eax
159
- mov %eax, (%ecx)
160
- jmp L(e1)
161
- E(L(store_table), X86_RET_UINT16)
162
- movzwl %ax, %eax
163
- mov %eax, (%ecx)
164
- jmp L(e1)
165
- E(L(store_table), X86_RET_INT64)
166
- movl %edx, 4(%ecx)
167
- /* fallthru */
168
- E(L(store_table), X86_RET_INT32)
169
- movl %eax, (%ecx)
170
- /* fallthru */
171
- E(L(store_table), X86_RET_VOID)
172
- L(e1):
173
- movl 8(%ebp), %ebx
174
- movl %ebp, %esp
175
- popl %ebp
176
- L(UW3):
177
- # cfi_remember_state
178
- # cfi_def_cfa(%esp, 4)
179
- # cfi_restore(%ebx)
180
- # cfi_restore(%ebp)
181
- ret
182
- L(UW4):
183
- # cfi_restore_state
184
-
185
- E(L(store_table), X86_RET_STRUCTPOP)
186
- jmp L(e1)
187
- E(L(store_table), X86_RET_STRUCTARG)
188
- jmp L(e1)
189
- E(L(store_table), X86_RET_STRUCT_1B)
190
- movb %al, (%ecx)
191
- jmp L(e1)
192
- E(L(store_table), X86_RET_STRUCT_2B)
193
- movw %ax, (%ecx)
194
- jmp L(e1)
195
-
196
- /* Fill out the table so that bad values are predictable. */
197
- E(L(store_table), X86_RET_UNUSED14)
198
- ud2
199
- E(L(store_table), X86_RET_UNUSED15)
200
- ud2
201
-
202
- L(UW5):
203
- # cfi_endproc
204
- ENDF(ffi_call_i386)
205
-
206
- /* The inner helper is declared as
207
-
208
- void ffi_closure_inner(struct closure_frame *frame, char *argp)
209
- __attribute_((fastcall))
210
-
211
- Thus the arguments are placed in
212
-
213
- ecx: frame
214
- edx: argp
215
- */
216
-
217
- /* Macros to help setting up the closure_data structure. */
218
-
219
- #if HAVE_FASTCALL
220
- # define closure_FS (40 + 4)
221
- # define closure_CF 0
222
- #else
223
- # define closure_FS (8 + 40 + 12)
224
- # define closure_CF 8
225
- #endif
226
-
227
- #define FFI_CLOSURE_SAVE_REGS \
228
- movl %eax, closure_CF+16+R_EAX*4(%esp); \
229
- movl %edx, closure_CF+16+R_EDX*4(%esp); \
230
- movl %ecx, closure_CF+16+R_ECX*4(%esp)
231
-
232
- #define FFI_CLOSURE_COPY_TRAMP_DATA \
233
- movl FFI_TRAMPOLINE_SIZE(%eax), %edx; /* copy cif */ \
234
- movl FFI_TRAMPOLINE_SIZE+4(%eax), %ecx; /* copy fun */ \
235
- movl FFI_TRAMPOLINE_SIZE+8(%eax), %eax; /* copy user_data */ \
236
- movl %edx, closure_CF+28(%esp); \
237
- movl %ecx, closure_CF+32(%esp); \
238
- movl %eax, closure_CF+36(%esp)
239
-
240
- #if HAVE_FASTCALL
241
- # define FFI_CLOSURE_PREP_CALL \
242
- movl %esp, %ecx; /* load closure_data */ \
243
- leal closure_FS+4(%esp), %edx; /* load incoming stack */
244
- #else
245
- # define FFI_CLOSURE_PREP_CALL \
246
- leal closure_CF(%esp), %ecx; /* load closure_data */ \
247
- leal closure_FS+4(%esp), %edx; /* load incoming stack */ \
248
- movl %ecx, (%esp); \
249
- movl %edx, 4(%esp)
250
- #endif
251
-
252
- #define FFI_CLOSURE_CALL_INNER(UWN) \
253
- call ffi_closure_inner
254
-
255
- #define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \
256
- andl $X86_RET_TYPE_MASK, %eax; \
257
- leal L(C1(load_table,N))(, %eax, 8), %edx; \
258
- movl closure_CF(%esp), %eax; /* optimiztic load */ \
259
- jmp *%edx
260
-
261
- #ifdef __PIC__
262
- # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
263
- # undef FFI_CLOSURE_MASK_AND_JUMP
264
- # define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \
265
- andl $X86_RET_TYPE_MASK, %eax; \
266
- call C(__x86.get_pc_thunk.dx); \
267
- L(C1(pc,N)): \
268
- leal L(C1(load_table,N))-L(C1(pc,N))(%edx, %eax, 8), %edx; \
269
- movl closure_CF(%esp), %eax; /* optimiztic load */ \
270
- jmp *%edx
271
- # else
272
- # define FFI_CLOSURE_CALL_INNER_SAVE_EBX
273
- # undef FFI_CLOSURE_CALL_INNER
274
- # define FFI_CLOSURE_CALL_INNER(UWN) \
275
- movl %ebx, 40(%esp); /* save ebx */ \
276
- L(C1(UW,UWN)): \
277
- # cfi_rel_offset(%ebx, 40); \
278
- call C(__x86.get_pc_thunk.bx); /* load got register */ \
279
- addl $C(_GLOBAL_OFFSET_TABLE_), %ebx; \
280
- call ffi_closure_inner@PLT
281
- # undef FFI_CLOSURE_MASK_AND_JUMP
282
- # define FFI_CLOSURE_MASK_AND_JUMP(N, UWN) \
283
- andl $X86_RET_TYPE_MASK, %eax; \
284
- leal L(C1(load_table,N))@GOTOFF(%ebx, %eax, 8), %edx; \
285
- movl 40(%esp), %ebx; /* restore ebx */ \
286
- L(C1(UW,UWN)): \
287
- # cfi_restore(%ebx); \
288
- movl closure_CF(%esp), %eax; /* optimiztic load */ \
289
- jmp *%edx
290
- # endif /* DARWIN || HIDDEN */
291
- #endif /* __PIC__ */
292
-
293
- .balign 16
294
- .globl C(ffi_go_closure_EAX)
295
- FFI_HIDDEN(C(ffi_go_closure_EAX))
296
- C(ffi_go_closure_EAX):
297
- L(UW6):
298
- # cfi_startproc
299
- subl $closure_FS, %esp
300
- L(UW7):
301
- # cfi_def_cfa_offset(closure_FS + 4)
302
- FFI_CLOSURE_SAVE_REGS
303
- movl 4(%eax), %edx /* copy cif */
304
- movl 8(%eax), %ecx /* copy fun */
305
- movl %edx, closure_CF+28(%esp)
306
- movl %ecx, closure_CF+32(%esp)
307
- movl %eax, closure_CF+36(%esp) /* closure is user_data */
308
- jmp L(do_closure_i386)
309
- L(UW8):
310
- # cfi_endproc
311
- ENDF(C(ffi_go_closure_EAX))
312
-
313
- .balign 16
314
- .globl C(ffi_go_closure_ECX)
315
- FFI_HIDDEN(C(ffi_go_closure_ECX))
316
- C(ffi_go_closure_ECX):
317
- L(UW9):
318
- # cfi_startproc
319
- subl $closure_FS, %esp
320
- L(UW10):
321
- # cfi_def_cfa_offset(closure_FS + 4)
322
- FFI_CLOSURE_SAVE_REGS
323
- movl 4(%ecx), %edx /* copy cif */
324
- movl 8(%ecx), %eax /* copy fun */
325
- movl %edx, closure_CF+28(%esp)
326
- movl %eax, closure_CF+32(%esp)
327
- movl %ecx, closure_CF+36(%esp) /* closure is user_data */
328
- jmp L(do_closure_i386)
329
- L(UW11):
330
- # cfi_endproc
331
- ENDF(C(ffi_go_closure_ECX))
332
-
333
- /* The closure entry points are reached from the ffi_closure trampoline.
334
- On entry, %eax contains the address of the ffi_closure. */
335
-
336
- .balign 16
337
- .globl C(ffi_closure_i386)
338
- FFI_HIDDEN(C(ffi_closure_i386))
339
-
340
- C(ffi_closure_i386):
341
- L(UW12):
342
- # cfi_startproc
343
- subl $closure_FS, %esp
344
- L(UW13):
345
- # cfi_def_cfa_offset(closure_FS + 4)
346
-
347
- FFI_CLOSURE_SAVE_REGS
348
- FFI_CLOSURE_COPY_TRAMP_DATA
349
-
350
- /* Entry point from preceeding Go closures. */
351
- L(do_closure_i386):
352
-
353
- FFI_CLOSURE_PREP_CALL
354
- FFI_CLOSURE_CALL_INNER(14)
355
- FFI_CLOSURE_MASK_AND_JUMP(2, 15)
356
-
357
- .balign 8
358
- L(load_table2):
359
- E(L(load_table2), X86_RET_FLOAT)
360
- flds closure_CF(%esp)
361
- jmp L(e2)
362
- E(L(load_table2), X86_RET_DOUBLE)
363
- fldl closure_CF(%esp)
364
- jmp L(e2)
365
- E(L(load_table2), X86_RET_LDOUBLE)
366
- fldt closure_CF(%esp)
367
- jmp L(e2)
368
- E(L(load_table2), X86_RET_SINT8)
369
- movsbl %al, %eax
370
- jmp L(e2)
371
- E(L(load_table2), X86_RET_SINT16)
372
- movswl %ax, %eax
373
- jmp L(e2)
374
- E(L(load_table2), X86_RET_UINT8)
375
- movzbl %al, %eax
376
- jmp L(e2)
377
- E(L(load_table2), X86_RET_UINT16)
378
- movzwl %ax, %eax
379
- jmp L(e2)
380
- E(L(load_table2), X86_RET_INT64)
381
- movl closure_CF+4(%esp), %edx
382
- jmp L(e2)
383
- E(L(load_table2), X86_RET_INT32)
384
- nop
385
- /* fallthru */
386
- E(L(load_table2), X86_RET_VOID)
387
- L(e2):
388
- addl $closure_FS, %esp
389
- L(UW16):
390
- # cfi_adjust_cfa_offset(-closure_FS)
391
- ret
392
- L(UW17):
393
- # cfi_adjust_cfa_offset(closure_FS)
394
- E(L(load_table2), X86_RET_STRUCTPOP)
395
- addl $closure_FS, %esp
396
- L(UW18):
397
- # cfi_adjust_cfa_offset(-closure_FS)
398
- ret $4
399
- L(UW19):
400
- # cfi_adjust_cfa_offset(closure_FS)
401
- E(L(load_table2), X86_RET_STRUCTARG)
402
- jmp L(e2)
403
- E(L(load_table2), X86_RET_STRUCT_1B)
404
- movzbl %al, %eax
405
- jmp L(e2)
406
- E(L(load_table2), X86_RET_STRUCT_2B)
407
- movzwl %ax, %eax
408
- jmp L(e2)
409
-
410
- /* Fill out the table so that bad values are predictable. */
411
- E(L(load_table2), X86_RET_UNUSED14)
412
- ud2
413
- E(L(load_table2), X86_RET_UNUSED15)
414
- ud2
415
-
416
- L(UW20):
417
- # cfi_endproc
418
- ENDF(C(ffi_closure_i386))
419
-
420
- .balign 16
421
- .globl C(ffi_go_closure_STDCALL)
422
- FFI_HIDDEN(C(ffi_go_closure_STDCALL))
423
- C(ffi_go_closure_STDCALL):
424
- L(UW21):
425
- # cfi_startproc
426
- subl $closure_FS, %esp
427
- L(UW22):
428
- # cfi_def_cfa_offset(closure_FS + 4)
429
- FFI_CLOSURE_SAVE_REGS
430
- movl 4(%ecx), %edx /* copy cif */
431
- movl 8(%ecx), %eax /* copy fun */
432
- movl %edx, closure_CF+28(%esp)
433
- movl %eax, closure_CF+32(%esp)
434
- movl %ecx, closure_CF+36(%esp) /* closure is user_data */
435
- jmp L(do_closure_STDCALL)
436
- L(UW23):
437
- # cfi_endproc
438
- ENDF(C(ffi_go_closure_STDCALL))
439
-
440
- /* For REGISTER, we have no available parameter registers, and so we
441
- enter here having pushed the closure onto the stack. */
442
-
443
- .balign 16
444
- .globl C(ffi_closure_REGISTER)
445
- FFI_HIDDEN(C(ffi_closure_REGISTER))
446
- C(ffi_closure_REGISTER):
447
- L(UW24):
448
- # cfi_startproc
449
- # cfi_def_cfa(%esp, 8)
450
- # cfi_offset(%eip, -8)
451
- subl $closure_FS-4, %esp
452
- L(UW25):
453
- # cfi_def_cfa_offset(closure_FS + 4)
454
- FFI_CLOSURE_SAVE_REGS
455
- movl closure_FS-4(%esp), %ecx /* load retaddr */
456
- movl closure_FS(%esp), %eax /* load closure */
457
- movl %ecx, closure_FS(%esp) /* move retaddr */
458
- jmp L(do_closure_REGISTER)
459
- L(UW26):
460
- # cfi_endproc
461
- ENDF(C(ffi_closure_REGISTER))
462
-
463
- /* For STDCALL (and others), we need to pop N bytes of arguments off
464
- the stack following the closure. The amount needing to be popped
465
- is returned to us from ffi_closure_inner. */
466
-
467
- .balign 16
468
- .globl C(ffi_closure_STDCALL)
469
- FFI_HIDDEN(C(ffi_closure_STDCALL))
470
- C(ffi_closure_STDCALL):
471
- L(UW27):
472
- # cfi_startproc
473
- subl $closure_FS, %esp
474
- L(UW28):
475
- # cfi_def_cfa_offset(closure_FS + 4)
476
-
477
- FFI_CLOSURE_SAVE_REGS
478
-
479
- /* Entry point from ffi_closure_REGISTER. */
480
- L(do_closure_REGISTER):
481
-
482
- FFI_CLOSURE_COPY_TRAMP_DATA
483
-
484
- /* Entry point from preceeding Go closure. */
485
- L(do_closure_STDCALL):
486
-
487
- FFI_CLOSURE_PREP_CALL
488
- FFI_CLOSURE_CALL_INNER(29)
489
-
490
- movl %eax, %ecx
491
- shrl $X86_RET_POP_SHIFT, %ecx /* isolate pop count */
492
- leal closure_FS(%esp, %ecx), %ecx /* compute popped esp */
493
- movl closure_FS(%esp), %edx /* move return address */
494
- movl %edx, (%ecx)
495
-
496
- /* From this point on, the value of %esp upon return is %ecx+4,
497
- and we've copied the return address to %ecx to make return easy.
498
- There's no point in representing this in the unwind info, as
499
- there is always a window between the mov and the ret which
500
- will be wrong from one point of view or another. */
501
-
502
- FFI_CLOSURE_MASK_AND_JUMP(3, 30)
503
-
504
- .balign 8
505
- L(load_table3):
506
- E(L(load_table3), X86_RET_FLOAT)
507
- flds closure_CF(%esp)
508
- movl %ecx, %esp
509
- ret
510
- E(L(load_table3), X86_RET_DOUBLE)
511
- fldl closure_CF(%esp)
512
- movl %ecx, %esp
513
- ret
514
- E(L(load_table3), X86_RET_LDOUBLE)
515
- fldt closure_CF(%esp)
516
- movl %ecx, %esp
517
- ret
518
- E(L(load_table3), X86_RET_SINT8)
519
- movsbl %al, %eax
520
- movl %ecx, %esp
521
- ret
522
- E(L(load_table3), X86_RET_SINT16)
523
- movswl %ax, %eax
524
- movl %ecx, %esp
525
- ret
526
- E(L(load_table3), X86_RET_UINT8)
527
- movzbl %al, %eax
528
- movl %ecx, %esp
529
- ret
530
- E(L(load_table3), X86_RET_UINT16)
531
- movzwl %ax, %eax
532
- movl %ecx, %esp
533
- ret
534
- E(L(load_table3), X86_RET_INT64)
535
- movl closure_CF+4(%esp), %edx
536
- movl %ecx, %esp
537
- ret
538
- E(L(load_table3), X86_RET_INT32)
539
- movl %ecx, %esp
540
- ret
541
- E(L(load_table3), X86_RET_VOID)
542
- movl %ecx, %esp
543
- ret
544
- E(L(load_table3), X86_RET_STRUCTPOP)
545
- movl %ecx, %esp
546
- ret
547
- E(L(load_table3), X86_RET_STRUCTARG)
548
- movl %ecx, %esp
549
- ret
550
- E(L(load_table3), X86_RET_STRUCT_1B)
551
- movzbl %al, %eax
552
- movl %ecx, %esp
553
- ret
554
- E(L(load_table3), X86_RET_STRUCT_2B)
555
- movzwl %ax, %eax
556
- movl %ecx, %esp
557
- ret
558
-
559
- /* Fill out the table so that bad values are predictable. */
560
- E(L(load_table3), X86_RET_UNUSED14)
561
- ud2
562
- E(L(load_table3), X86_RET_UNUSED15)
563
- ud2
564
-
565
- L(UW31):
566
- # cfi_endproc
567
- ENDF(C(ffi_closure_STDCALL))
568
-
569
- #if !FFI_NO_RAW_API
570
-
571
- #define raw_closure_S_FS (16+16+12)
572
-
573
- .balign 16
574
- .globl C(ffi_closure_raw_SYSV)
575
- FFI_HIDDEN(C(ffi_closure_raw_SYSV))
576
- C(ffi_closure_raw_SYSV):
577
- L(UW32):
578
- # cfi_startproc
579
- subl $raw_closure_S_FS, %esp
580
- L(UW33):
581
- # cfi_def_cfa_offset(raw_closure_S_FS + 4)
582
- movl %ebx, raw_closure_S_FS-4(%esp)
583
- L(UW34):
584
- # cfi_rel_offset(%ebx, raw_closure_S_FS-4)
585
-
586
- movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */
587
- movl %edx, 12(%esp)
588
- leal raw_closure_S_FS+4(%esp), %edx /* load raw_args */
589
- movl %edx, 8(%esp)
590
- leal 16(%esp), %edx /* load &res */
591
- movl %edx, 4(%esp)
592
- movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */
593
- movl %ebx, (%esp)
594
- call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */
595
-
596
- movl 20(%ebx), %eax /* load cif->flags */
597
- andl $X86_RET_TYPE_MASK, %eax
598
- #ifdef __PIC__
599
- call C(__x86.get_pc_thunk.bx)
600
- L(pc4):
601
- leal L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx
602
- #else
603
- leal L(load_table4)(,%eax, 8), %ecx
604
- #endif
605
- movl raw_closure_S_FS-4(%esp), %ebx
606
- L(UW35):
607
- # cfi_restore(%ebx)
608
- movl 16(%esp), %eax /* Optimistic load */
609
- jmp *%ecx
610
-
611
- .balign 8
612
- L(load_table4):
613
- E(L(load_table4), X86_RET_FLOAT)
614
- flds 16(%esp)
615
- jmp L(e4)
616
- E(L(load_table4), X86_RET_DOUBLE)
617
- fldl 16(%esp)
618
- jmp L(e4)
619
- E(L(load_table4), X86_RET_LDOUBLE)
620
- fldt 16(%esp)
621
- jmp L(e4)
622
- E(L(load_table4), X86_RET_SINT8)
623
- movsbl %al, %eax
624
- jmp L(e4)
625
- E(L(load_table4), X86_RET_SINT16)
626
- movswl %ax, %eax
627
- jmp L(e4)
628
- E(L(load_table4), X86_RET_UINT8)
629
- movzbl %al, %eax
630
- jmp L(e4)
631
- E(L(load_table4), X86_RET_UINT16)
632
- movzwl %ax, %eax
633
- jmp L(e4)
634
- E(L(load_table4), X86_RET_INT64)
635
- movl 16+4(%esp), %edx
636
- jmp L(e4)
637
- E(L(load_table4), X86_RET_INT32)
638
- nop
639
- /* fallthru */
640
- E(L(load_table4), X86_RET_VOID)
641
- L(e4):
642
- addl $raw_closure_S_FS, %esp
643
- L(UW36):
644
- # cfi_adjust_cfa_offset(-raw_closure_S_FS)
645
- ret
646
- L(UW37):
647
- # cfi_adjust_cfa_offset(raw_closure_S_FS)
648
- E(L(load_table4), X86_RET_STRUCTPOP)
649
- addl $raw_closure_S_FS, %esp
650
- L(UW38):
651
- # cfi_adjust_cfa_offset(-raw_closure_S_FS)
652
- ret $4
653
- L(UW39):
654
- # cfi_adjust_cfa_offset(raw_closure_S_FS)
655
- E(L(load_table4), X86_RET_STRUCTARG)
656
- jmp L(e4)
657
- E(L(load_table4), X86_RET_STRUCT_1B)
658
- movzbl %al, %eax
659
- jmp L(e4)
660
- E(L(load_table4), X86_RET_STRUCT_2B)
661
- movzwl %ax, %eax
662
- jmp L(e4)
663
-
664
- /* Fill out the table so that bad values are predictable. */
665
- E(L(load_table4), X86_RET_UNUSED14)
666
- ud2
667
- E(L(load_table4), X86_RET_UNUSED15)
668
- ud2
669
-
670
- L(UW40):
671
- # cfi_endproc
672
- ENDF(C(ffi_closure_raw_SYSV))
673
-
674
- #define raw_closure_T_FS (16+16+8)
675
-
676
- .balign 16
677
- .globl C(ffi_closure_raw_THISCALL)
678
- FFI_HIDDEN(C(ffi_closure_raw_THISCALL))
679
- C(ffi_closure_raw_THISCALL):
680
- L(UW41):
681
- # cfi_startproc
682
- /* Rearrange the stack such that %ecx is the first argument.
683
- This means moving the return address. */
684
- popl %edx
685
- L(UW42):
686
- # cfi_def_cfa_offset(0)
687
- # cfi_register(%eip, %edx)
688
- pushl %ecx
689
- L(UW43):
690
- # cfi_adjust_cfa_offset(4)
691
- pushl %edx
692
- L(UW44):
693
- # cfi_adjust_cfa_offset(4)
694
- # cfi_rel_offset(%eip, 0)
695
- subl $raw_closure_T_FS, %esp
696
- L(UW45):
697
- # cfi_adjust_cfa_offset(raw_closure_T_FS)
698
- movl %ebx, raw_closure_T_FS-4(%esp)
699
- L(UW46):
700
- # cfi_rel_offset(%ebx, raw_closure_T_FS-4)
701
-
702
- movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */
703
- movl %edx, 12(%esp)
704
- leal raw_closure_T_FS+4(%esp), %edx /* load raw_args */
705
- movl %edx, 8(%esp)
706
- leal 16(%esp), %edx /* load &res */
707
- movl %edx, 4(%esp)
708
- movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */
709
- movl %ebx, (%esp)
710
- call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */
711
-
712
- movl 20(%ebx), %eax /* load cif->flags */
713
- andl $X86_RET_TYPE_MASK, %eax
714
- #ifdef __PIC__
715
- call C(__x86.get_pc_thunk.bx)
716
- L(pc5):
717
- leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx
718
- #else
719
- leal L(load_table5)(,%eax, 8), %ecx
720
- #endif
721
- movl raw_closure_T_FS-4(%esp), %ebx
722
- L(UW47):
723
- # cfi_restore(%ebx)
724
- movl 16(%esp), %eax /* Optimistic load */
725
- jmp *%ecx
726
-
727
- .balign 8
728
- L(load_table5):
729
- E(L(load_table5), X86_RET_FLOAT)
730
- flds 16(%esp)
731
- jmp L(e5)
732
- E(L(load_table5), X86_RET_DOUBLE)
733
- fldl 16(%esp)
734
- jmp L(e5)
735
- E(L(load_table5), X86_RET_LDOUBLE)
736
- fldt 16(%esp)
737
- jmp L(e5)
738
- E(L(load_table5), X86_RET_SINT8)
739
- movsbl %al, %eax
740
- jmp L(e5)
741
- E(L(load_table5), X86_RET_SINT16)
742
- movswl %ax, %eax
743
- jmp L(e5)
744
- E(L(load_table5), X86_RET_UINT8)
745
- movzbl %al, %eax
746
- jmp L(e5)
747
- E(L(load_table5), X86_RET_UINT16)
748
- movzwl %ax, %eax
749
- jmp L(e5)
750
- E(L(load_table5), X86_RET_INT64)
751
- movl 16+4(%esp), %edx
752
- jmp L(e5)
753
- E(L(load_table5), X86_RET_INT32)
754
- nop
755
- /* fallthru */
756
- E(L(load_table5), X86_RET_VOID)
757
- L(e5):
758
- addl $raw_closure_T_FS, %esp
759
- L(UW48):
760
- # cfi_adjust_cfa_offset(-raw_closure_T_FS)
761
- /* Remove the extra %ecx argument we pushed. */
762
- ret $4
763
- L(UW49):
764
- # cfi_adjust_cfa_offset(raw_closure_T_FS)
765
- E(L(load_table5), X86_RET_STRUCTPOP)
766
- addl $raw_closure_T_FS, %esp
767
- L(UW50):
768
- # cfi_adjust_cfa_offset(-raw_closure_T_FS)
769
- ret $8
770
- L(UW51):
771
- # cfi_adjust_cfa_offset(raw_closure_T_FS)
772
- E(L(load_table5), X86_RET_STRUCTARG)
773
- jmp L(e5)
774
- E(L(load_table5), X86_RET_STRUCT_1B)
775
- movzbl %al, %eax
776
- jmp L(e5)
777
- E(L(load_table5), X86_RET_STRUCT_2B)
778
- movzwl %ax, %eax
779
- jmp L(e5)
780
-
781
- /* Fill out the table so that bad values are predictable. */
782
- E(L(load_table5), X86_RET_UNUSED14)
783
- ud2
784
- E(L(load_table5), X86_RET_UNUSED15)
785
- ud2
786
-
787
- L(UW52):
788
- # cfi_endproc
789
- ENDF(C(ffi_closure_raw_THISCALL))
790
-
791
- #endif /* !FFI_NO_RAW_API */
792
-
793
- #ifdef X86_DARWIN
794
- # define COMDAT(X) \
795
- .section __TEXT,__textcoal_nt,coalesced,pure_instructions; \
796
- .weak_definition X; \
797
- .private_extern X
798
- #elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
799
- # define COMDAT(X) \
800
- .section .text.X,"axG",@progbits,X,comdat; \
801
- .globl X; \
802
- FFI_HIDDEN(X)
803
- #else
804
- # define COMDAT(X)
805
- #endif
806
-
807
- #if defined(__PIC__)
808
- COMDAT(C(__x86.get_pc_thunk.bx))
809
- C(__x86.get_pc_thunk.bx):
810
- movl (%esp), %ebx
811
- ret
812
- ENDF(C(__x86.get_pc_thunk.bx))
813
- # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
814
- COMDAT(C(__x86.get_pc_thunk.dx))
815
- C(__x86.get_pc_thunk.dx):
816
- movl (%esp), %edx
817
- ret
818
- ENDF(C(__x86.get_pc_thunk.dx))
819
- #endif /* DARWIN || HIDDEN */
820
- #endif /* __PIC__ */
821
-
822
- /* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */
823
-
824
- #ifdef __APPLE__
825
- .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
826
- EHFrame0:
827
- #elif defined(X86_WIN32)
828
- .section .eh_frame,"r"
829
- #elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE)
830
- .section .eh_frame,EH_FRAME_FLAGS,@unwind
831
- #else
832
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
833
- #endif
834
-
835
- #ifdef HAVE_AS_X86_PCREL
836
- # define PCREL(X) X - .
837
- #else
838
- # define PCREL(X) X@rel
839
- #endif
840
-
841
- /* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */
842
- #define ADV(N, P) .byte 2, L(N)-L(P)
843
-
844
- .balign 4
845
- L(CIE):
846
- .set L(set0),L(ECIE)-L(SCIE)
847
- .long L(set0) /* CIE Length */
848
- L(SCIE):
849
- .long 0 /* CIE Identifier Tag */
850
- .byte 1 /* CIE Version */
851
- .ascii "zR\0" /* CIE Augmentation */
852
- .byte 1 /* CIE Code Alignment Factor */
853
- .byte 0x7c /* CIE Data Alignment Factor */
854
- .byte 0x8 /* CIE RA Column */
855
- .byte 1 /* Augmentation size */
856
- .byte 0x1b /* FDE Encoding (pcrel sdata4) */
857
- .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp offset 4 */
858
- .byte 0x80+8, 1 /* DW_CFA_offset, %eip offset 1*-4 */
859
- .balign 4
860
- L(ECIE):
861
-
862
- .set L(set1),L(EFDE1)-L(SFDE1)
863
- .long L(set1) /* FDE Length */
864
- L(SFDE1):
865
- .long L(SFDE1)-L(CIE) /* FDE CIE offset */
866
- .long PCREL(L(UW0)) /* Initial location */
867
- .long L(UW5)-L(UW0) /* Address range */
868
- .byte 0 /* Augmentation size */
869
- ADV(UW1, UW0)
870
- .byte 0xc, 5, 8 /* DW_CFA_def_cfa, %ebp 8 */
871
- .byte 0x80+5, 2 /* DW_CFA_offset, %ebp 2*-4 */
872
- ADV(UW2, UW1)
873
- .byte 0x80+3, 0 /* DW_CFA_offset, %ebx 0*-4 */
874
- ADV(UW3, UW2)
875
- .byte 0xa /* DW_CFA_remember_state */
876
- .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp 4 */
877
- .byte 0xc0+3 /* DW_CFA_restore, %ebx */
878
- .byte 0xc0+5 /* DW_CFA_restore, %ebp */
879
- ADV(UW4, UW3)
880
- .byte 0xb /* DW_CFA_restore_state */
881
- .balign 4
882
- L(EFDE1):
883
-
884
- .set L(set2),L(EFDE2)-L(SFDE2)
885
- .long L(set2) /* FDE Length */
886
- L(SFDE2):
887
- .long L(SFDE2)-L(CIE) /* FDE CIE offset */
888
- .long PCREL(L(UW6)) /* Initial location */
889
- .long L(UW8)-L(UW6) /* Address range */
890
- .byte 0 /* Augmentation size */
891
- ADV(UW7, UW6)
892
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
893
- .balign 4
894
- L(EFDE2):
895
-
896
- .set L(set3),L(EFDE3)-L(SFDE3)
897
- .long L(set3) /* FDE Length */
898
- L(SFDE3):
899
- .long L(SFDE3)-L(CIE) /* FDE CIE offset */
900
- .long PCREL(L(UW9)) /* Initial location */
901
- .long L(UW11)-L(UW9) /* Address range */
902
- .byte 0 /* Augmentation size */
903
- ADV(UW10, UW9)
904
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
905
- .balign 4
906
- L(EFDE3):
907
-
908
- .set L(set4),L(EFDE4)-L(SFDE4)
909
- .long L(set4) /* FDE Length */
910
- L(SFDE4):
911
- .long L(SFDE4)-L(CIE) /* FDE CIE offset */
912
- .long PCREL(L(UW12)) /* Initial location */
913
- .long L(UW20)-L(UW12) /* Address range */
914
- .byte 0 /* Augmentation size */
915
- ADV(UW13, UW12)
916
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
917
- #ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
918
- ADV(UW14, UW13)
919
- .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */
920
- ADV(UW15, UW14)
921
- .byte 0xc0+3 /* DW_CFA_restore %ebx */
922
- ADV(UW16, UW15)
923
- #else
924
- ADV(UW16, UW13)
925
- #endif
926
- .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
927
- ADV(UW17, UW16)
928
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
929
- ADV(UW18, UW17)
930
- .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
931
- ADV(UW19, UW18)
932
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
933
- .balign 4
934
- L(EFDE4):
935
-
936
- .set L(set5),L(EFDE5)-L(SFDE5)
937
- .long L(set5) /* FDE Length */
938
- L(SFDE5):
939
- .long L(SFDE5)-L(CIE) /* FDE CIE offset */
940
- .long PCREL(L(UW21)) /* Initial location */
941
- .long L(UW23)-L(UW21) /* Address range */
942
- .byte 0 /* Augmentation size */
943
- ADV(UW22, UW21)
944
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
945
- .balign 4
946
- L(EFDE5):
947
-
948
- .set L(set6),L(EFDE6)-L(SFDE6)
949
- .long L(set6) /* FDE Length */
950
- L(SFDE6):
951
- .long L(SFDE6)-L(CIE) /* FDE CIE offset */
952
- .long PCREL(L(UW24)) /* Initial location */
953
- .long L(UW26)-L(UW24) /* Address range */
954
- .byte 0 /* Augmentation size */
955
- .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
956
- .byte 0x80+8, 2 /* DW_CFA_offset %eip, 2*-4 */
957
- ADV(UW25, UW24)
958
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
959
- .balign 4
960
- L(EFDE6):
961
-
962
- .set L(set7),L(EFDE7)-L(SFDE7)
963
- .long L(set7) /* FDE Length */
964
- L(SFDE7):
965
- .long L(SFDE7)-L(CIE) /* FDE CIE offset */
966
- .long PCREL(L(UW27)) /* Initial location */
967
- .long L(UW31)-L(UW27) /* Address range */
968
- .byte 0 /* Augmentation size */
969
- ADV(UW28, UW27)
970
- .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
971
- #ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
972
- ADV(UW29, UW28)
973
- .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */
974
- ADV(UW30, UW29)
975
- .byte 0xc0+3 /* DW_CFA_restore %ebx */
976
- #endif
977
- .balign 4
978
- L(EFDE7):
979
-
980
- #if !FFI_NO_RAW_API
981
- .set L(set8),L(EFDE8)-L(SFDE8)
982
- .long L(set8) /* FDE Length */
983
- L(SFDE8):
984
- .long L(SFDE8)-L(CIE) /* FDE CIE offset */
985
- .long PCREL(L(UW32)) /* Initial location */
986
- .long L(UW40)-L(UW32) /* Address range */
987
- .byte 0 /* Augmentation size */
988
- ADV(UW33, UW32)
989
- .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
990
- ADV(UW34, UW33)
991
- .byte 0x80+3, 2 /* DW_CFA_offset %ebx 2*-4 */
992
- ADV(UW35, UW34)
993
- .byte 0xc0+3 /* DW_CFA_restore %ebx */
994
- ADV(UW36, UW35)
995
- .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
996
- ADV(UW37, UW36)
997
- .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
998
- ADV(UW38, UW37)
999
- .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
1000
- ADV(UW39, UW38)
1001
- .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
1002
- .balign 4
1003
- L(EFDE8):
1004
-
1005
- .set L(set9),L(EFDE9)-L(SFDE9)
1006
- .long L(set9) /* FDE Length */
1007
- L(SFDE9):
1008
- .long L(SFDE9)-L(CIE) /* FDE CIE offset */
1009
- .long PCREL(L(UW41)) /* Initial location */
1010
- .long L(UW52)-L(UW41) /* Address range */
1011
- .byte 0 /* Augmentation size */
1012
- ADV(UW42, UW41)
1013
- .byte 0xe, 0 /* DW_CFA_def_cfa_offset */
1014
- .byte 0x9, 8, 2 /* DW_CFA_register %eip, %edx */
1015
- ADV(UW43, UW42)
1016
- .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
1017
- ADV(UW44, UW43)
1018
- .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1019
- .byte 0x80+8, 2 /* DW_CFA_offset %eip 2*-4 */
1020
- ADV(UW45, UW44)
1021
- .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1022
- ADV(UW46, UW45)
1023
- .byte 0x80+3, 3 /* DW_CFA_offset %ebx 3*-4 */
1024
- ADV(UW47, UW46)
1025
- .byte 0xc0+3 /* DW_CFA_restore %ebx */
1026
- ADV(UW48, UW47)
1027
- .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1028
- ADV(UW49, UW48)
1029
- .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1030
- ADV(UW50, UW49)
1031
- .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1032
- ADV(UW51, UW50)
1033
- .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1034
- .balign 4
1035
- L(EFDE9):
1036
- #endif /* !FFI_NO_RAW_API */
1037
-
1038
- #endif /* ifndef _MSC_VER */
1039
- #endif /* ifndef __x86_64__ */
1040
-
1041
- #if defined __ELF__ && defined __linux__
1042
- .section .note.GNU-stack,"",@progbits
1043
- #endif