ffi 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (530) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.gitmodules +4 -0
  4. data/.travis.yml +42 -0
  5. data/.yardopts +5 -0
  6. data/CHANGELOG.md +131 -0
  7. data/COPYING +49 -0
  8. data/Gemfile +15 -0
  9. data/LICENSE +24 -0
  10. data/LICENSE.SPECS +22 -0
  11. data/README.md +115 -0
  12. data/Rakefile +195 -0
  13. data/appveyor.yml +27 -0
  14. data/ext/ffi_c/AbstractMemory.c +1109 -0
  15. data/ext/ffi_c/AbstractMemory.h +175 -0
  16. data/ext/ffi_c/ArrayType.c +162 -0
  17. data/ext/ffi_c/ArrayType.h +59 -0
  18. data/ext/ffi_c/Buffer.c +365 -0
  19. data/ext/ffi_c/Call.c +503 -0
  20. data/ext/ffi_c/Call.h +107 -0
  21. data/ext/ffi_c/ClosurePool.c +283 -0
  22. data/ext/ffi_c/ClosurePool.h +57 -0
  23. data/ext/ffi_c/DynamicLibrary.c +339 -0
  24. data/ext/ffi_c/DynamicLibrary.h +98 -0
  25. data/ext/ffi_c/Function.c +917 -0
  26. data/ext/ffi_c/Function.h +87 -0
  27. data/ext/ffi_c/FunctionInfo.c +271 -0
  28. data/ext/ffi_c/LastError.c +229 -0
  29. data/ext/ffi_c/LastError.h +47 -0
  30. data/ext/ffi_c/LongDouble.c +63 -0
  31. data/ext/ffi_c/LongDouble.h +51 -0
  32. data/ext/ffi_c/MappedType.c +168 -0
  33. data/ext/ffi_c/MappedType.h +59 -0
  34. data/ext/ffi_c/MemoryPointer.c +197 -0
  35. data/ext/ffi_c/MemoryPointer.h +53 -0
  36. data/ext/ffi_c/MethodHandle.c +358 -0
  37. data/ext/ffi_c/MethodHandle.h +55 -0
  38. data/ext/ffi_c/Platform.c +82 -0
  39. data/ext/ffi_c/Platform.h +45 -0
  40. data/ext/ffi_c/Pointer.c +508 -0
  41. data/ext/ffi_c/Pointer.h +63 -0
  42. data/ext/ffi_c/Struct.c +829 -0
  43. data/ext/ffi_c/Struct.h +106 -0
  44. data/ext/ffi_c/StructByValue.c +150 -0
  45. data/ext/ffi_c/StructByValue.h +55 -0
  46. data/ext/ffi_c/StructLayout.c +698 -0
  47. data/ext/ffi_c/Thread.c +137 -0
  48. data/ext/ffi_c/Thread.h +84 -0
  49. data/ext/ffi_c/Type.c +379 -0
  50. data/ext/ffi_c/Type.h +61 -0
  51. data/ext/ffi_c/Types.c +139 -0
  52. data/ext/ffi_c/Types.h +89 -0
  53. data/ext/ffi_c/Variadic.c +298 -0
  54. data/ext/ffi_c/compat.h +78 -0
  55. data/ext/ffi_c/extconf.rb +86 -0
  56. data/ext/ffi_c/ffi.c +93 -0
  57. data/ext/ffi_c/libffi.bsd.mk +40 -0
  58. data/ext/ffi_c/libffi.darwin.mk +105 -0
  59. data/ext/ffi_c/libffi.gnu.mk +32 -0
  60. data/ext/ffi_c/libffi.mk +18 -0
  61. data/ext/ffi_c/libffi.vc.mk +26 -0
  62. data/ext/ffi_c/libffi.vc64.mk +26 -0
  63. data/ext/ffi_c/libffi/.appveyor.yml +50 -0
  64. data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
  65. data/ext/ffi_c/libffi/.gitignore +38 -0
  66. data/ext/ffi_c/libffi/.travis.yml +34 -0
  67. data/ext/ffi_c/libffi/.travis/ar-lib +270 -0
  68. data/ext/ffi_c/libffi/.travis/build.sh +34 -0
  69. data/ext/ffi_c/libffi/.travis/compile +351 -0
  70. data/ext/ffi_c/libffi/.travis/install.sh +22 -0
  71. data/ext/ffi_c/libffi/.travis/moxie-sim.exp +60 -0
  72. data/ext/ffi_c/libffi/.travis/site.exp +18 -0
  73. data/ext/ffi_c/libffi/ChangeLog.libffi +584 -0
  74. data/ext/ffi_c/libffi/ChangeLog.libffi-3.1 +6000 -0
  75. data/ext/ffi_c/libffi/ChangeLog.libgcj +40 -0
  76. data/ext/ffi_c/libffi/ChangeLog.v1 +764 -0
  77. data/ext/ffi_c/libffi/LICENSE +21 -0
  78. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +352 -0
  79. data/ext/ffi_c/libffi/Makefile.am +166 -0
  80. data/ext/ffi_c/libffi/README.md +461 -0
  81. data/ext/ffi_c/libffi/acinclude.m4 +479 -0
  82. data/ext/ffi_c/libffi/autogen.sh +2 -0
  83. data/ext/ffi_c/libffi/config.guess +1466 -0
  84. data/ext/ffi_c/libffi/config.sub +1836 -0
  85. data/ext/ffi_c/libffi/configure.ac +394 -0
  86. data/ext/ffi_c/libffi/configure.host +289 -0
  87. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +203 -0
  88. data/ext/ffi_c/libffi/include/Makefile.am +9 -0
  89. data/ext/ffi_c/libffi/include/ffi.h.in +511 -0
  90. data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
  91. data/ext/ffi_c/libffi/include/ffi_common.h +149 -0
  92. data/ext/ffi_c/libffi/libffi.map.in +80 -0
  93. data/ext/ffi_c/libffi/libffi.pc.in +11 -0
  94. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +1043 -0
  95. data/ext/ffi_c/libffi/libtool-version +29 -0
  96. data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
  97. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +71 -0
  98. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +194 -0
  99. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +122 -0
  100. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +74 -0
  101. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +87 -0
  102. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
  103. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +302 -0
  104. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +263 -0
  105. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +89 -0
  106. data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
  107. data/ext/ffi_c/libffi/man/Makefile.am +8 -0
  108. data/ext/ffi_c/libffi/man/ffi.3 +41 -0
  109. data/ext/ffi_c/libffi/man/ffi_call.3 +103 -0
  110. data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +68 -0
  111. data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
  112. data/ext/ffi_c/libffi/msvcc.sh +328 -0
  113. data/ext/ffi_c/libffi/src/aarch64/ffi.c +941 -0
  114. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +81 -0
  115. data/ext/ffi_c/libffi/src/aarch64/internal.h +67 -0
  116. data/ext/ffi_c/libffi/src/aarch64/sysv.S +438 -0
  117. data/ext/ffi_c/libffi/src/alpha/ffi.c +521 -0
  118. data/ext/ffi_c/libffi/src/alpha/ffitarget.h +57 -0
  119. data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
  120. data/ext/ffi_c/libffi/src/alpha/osf.S +282 -0
  121. data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
  122. data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
  123. data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
  124. data/ext/ffi_c/libffi/src/arm/ffi.c +819 -0
  125. data/ext/ffi_c/libffi/src/arm/ffitarget.h +82 -0
  126. data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
  127. data/ext/ffi_c/libffi/src/arm/sysv.S +383 -0
  128. data/ext/ffi_c/libffi/src/avr32/ffi.c +423 -0
  129. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +55 -0
  130. data/ext/ffi_c/libffi/src/avr32/sysv.S +208 -0
  131. data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
  132. data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
  133. data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
  134. data/ext/ffi_c/libffi/src/closures.c +966 -0
  135. data/ext/ffi_c/libffi/src/cris/ffi.c +386 -0
  136. data/ext/ffi_c/libffi/src/cris/ffitarget.h +56 -0
  137. data/ext/ffi_c/libffi/src/cris/sysv.S +215 -0
  138. data/ext/ffi_c/libffi/src/debug.c +64 -0
  139. data/ext/ffi_c/libffi/src/dlmalloc.c +5166 -0
  140. data/ext/ffi_c/libffi/src/frv/eabi.S +128 -0
  141. data/ext/ffi_c/libffi/src/frv/ffi.c +292 -0
  142. data/ext/ffi_c/libffi/src/frv/ffitarget.h +62 -0
  143. data/ext/ffi_c/libffi/src/ia64/ffi.c +604 -0
  144. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +56 -0
  145. data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +40 -0
  146. data/ext/ffi_c/libffi/src/ia64/unix.S +567 -0
  147. data/ext/ffi_c/libffi/src/java_raw_api.c +374 -0
  148. data/ext/ffi_c/libffi/src/m32r/ffi.c +232 -0
  149. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +53 -0
  150. data/ext/ffi_c/libffi/src/m32r/sysv.S +121 -0
  151. data/ext/ffi_c/libffi/src/m68k/ffi.c +362 -0
  152. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +54 -0
  153. data/ext/ffi_c/libffi/src/m68k/sysv.S +357 -0
  154. data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
  155. data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
  156. data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
  157. data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
  158. data/ext/ffi_c/libffi/src/metag/ffitarget.h +53 -0
  159. data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
  160. data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
  161. data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
  162. data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
  163. data/ext/ffi_c/libffi/src/mips/ffi.c +1130 -0
  164. data/ext/ffi_c/libffi/src/mips/ffitarget.h +244 -0
  165. data/ext/ffi_c/libffi/src/mips/n32.S +663 -0
  166. data/ext/ffi_c/libffi/src/mips/o32.S +502 -0
  167. data/ext/ffi_c/libffi/src/moxie/eabi.S +101 -0
  168. data/ext/ffi_c/libffi/src/moxie/ffi.c +285 -0
  169. data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
  170. data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
  171. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
  172. data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
  173. data/ext/ffi_c/libffi/src/or1k/ffi.c +328 -0
  174. data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
  175. data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
  176. data/ext/ffi_c/libffi/src/pa/ffi.c +719 -0
  177. data/ext/ffi_c/libffi/src/pa/ffitarget.h +85 -0
  178. data/ext/ffi_c/libffi/src/pa/hpux32.S +368 -0
  179. data/ext/ffi_c/libffi/src/pa/linux.S +357 -0
  180. data/ext/ffi_c/libffi/src/powerpc/aix.S +566 -0
  181. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +694 -0
  182. data/ext/ffi_c/libffi/src/powerpc/asm.h +125 -0
  183. data/ext/ffi_c/libffi/src/powerpc/darwin.S +378 -0
  184. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +571 -0
  185. data/ext/ffi_c/libffi/src/powerpc/ffi.c +173 -0
  186. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +1440 -0
  187. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +974 -0
  188. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +94 -0
  189. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
  190. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +198 -0
  191. data/ext/ffi_c/libffi/src/powerpc/linux64.S +228 -0
  192. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +488 -0
  193. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +397 -0
  194. data/ext/ffi_c/libffi/src/powerpc/sysv.S +175 -0
  195. data/ext/ffi_c/libffi/src/prep_cif.c +261 -0
  196. data/ext/ffi_c/libffi/src/raw_api.c +267 -0
  197. data/ext/ffi_c/libffi/src/riscv/ffi.c +481 -0
  198. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
  199. data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
  200. data/ext/ffi_c/libffi/src/s390/ffi.c +756 -0
  201. data/ext/ffi_c/libffi/src/s390/ffitarget.h +70 -0
  202. data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
  203. data/ext/ffi_c/libffi/src/s390/sysv.S +325 -0
  204. data/ext/ffi_c/libffi/src/sh/ffi.c +717 -0
  205. data/ext/ffi_c/libffi/src/sh/ffitarget.h +54 -0
  206. data/ext/ffi_c/libffi/src/sh/sysv.S +850 -0
  207. data/ext/ffi_c/libffi/src/sh64/ffi.c +469 -0
  208. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +58 -0
  209. data/ext/ffi_c/libffi/src/sh64/sysv.S +539 -0
  210. data/ext/ffi_c/libffi/src/sparc/ffi.c +468 -0
  211. data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
  212. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +81 -0
  213. data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
  214. data/ext/ffi_c/libffi/src/sparc/v8.S +443 -0
  215. data/ext/ffi_c/libffi/src/sparc/v9.S +440 -0
  216. data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
  217. data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
  218. data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
  219. data/ext/ffi_c/libffi/src/types.c +108 -0
  220. data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
  221. data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
  222. data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
  223. data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
  224. data/ext/ffi_c/libffi/src/x86/ffi.c +754 -0
  225. data/ext/ffi_c/libffi/src/x86/ffi64.c +884 -0
  226. data/ext/ffi_c/libffi/src/x86/ffitarget.h +147 -0
  227. data/ext/ffi_c/libffi/src/x86/ffiw64.c +308 -0
  228. data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
  229. data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
  230. data/ext/ffi_c/libffi/src/x86/sysv.S +1129 -0
  231. data/ext/ffi_c/libffi/src/x86/unix64.S +566 -0
  232. data/ext/ffi_c/libffi/src/x86/win64.S +232 -0
  233. data/ext/ffi_c/libffi/src/x86/win64_intel.S +237 -0
  234. data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
  235. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
  236. data/ext/ffi_c/libffi/src/xtensa/sysv.S +258 -0
  237. data/ext/ffi_c/libffi/stamp-h.in +1 -0
  238. data/ext/ffi_c/libffi/testsuite/Makefile.am +117 -0
  239. data/ext/ffi_c/libffi/testsuite/config/default.exp +1 -0
  240. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +636 -0
  241. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +283 -0
  242. data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +45 -0
  243. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
  244. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
  245. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
  246. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +58 -0
  247. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1745 -0
  248. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
  249. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +743 -0
  250. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
  251. data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
  252. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +43 -0
  253. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +89 -0
  254. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +81 -0
  255. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +81 -0
  256. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +82 -0
  257. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +89 -0
  258. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +92 -0
  259. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +90 -0
  260. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_loc_fn0.c +95 -0
  261. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_simple.c +55 -0
  262. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +94 -0
  263. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +95 -0
  264. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +96 -0
  265. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +102 -0
  266. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +89 -0
  267. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +91 -0
  268. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +93 -0
  269. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +113 -0
  270. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +90 -0
  271. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +95 -0
  272. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +90 -0
  273. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +90 -0
  274. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3float.c +95 -0
  275. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +98 -0
  276. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +90 -0
  277. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +109 -0
  278. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +98 -0
  279. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +124 -0
  280. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +113 -0
  281. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +99 -0
  282. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +117 -0
  283. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +97 -0
  284. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +88 -0
  285. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +90 -0
  286. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +91 -0
  287. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +93 -0
  288. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +91 -0
  289. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +92 -0
  290. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +132 -0
  291. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +115 -0
  292. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +95 -0
  293. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +91 -0
  294. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +91 -0
  295. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +92 -0
  296. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +91 -0
  297. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +91 -0
  298. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +93 -0
  299. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +66 -0
  300. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +43 -0
  301. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +61 -0
  302. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +42 -0
  303. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +105 -0
  304. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +61 -0
  305. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_args.c +70 -0
  306. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_float_double.c +55 -0
  307. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +74 -0
  308. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +74 -0
  309. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +86 -0
  310. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +91 -0
  311. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +74 -0
  312. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +86 -0
  313. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +74 -0
  314. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +142 -0
  315. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +44 -0
  316. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +42 -0
  317. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +42 -0
  318. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_struct_va1.c +114 -0
  319. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +42 -0
  320. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +44 -0
  321. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +43 -0
  322. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint_va.c +45 -0
  323. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulong_va.c +45 -0
  324. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +47 -0
  325. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +43 -0
  326. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +44 -0
  327. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +36 -0
  328. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +26 -0
  329. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +138 -0
  330. data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +59 -0
  331. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +60 -0
  332. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +60 -0
  333. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +74 -0
  334. data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +62 -0
  335. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +107 -0
  336. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +341 -0
  337. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +59 -0
  338. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
  339. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
  340. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
  341. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +52 -0
  342. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +152 -0
  343. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +161 -0
  344. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +134 -0
  345. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct11.c +121 -0
  346. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +110 -0
  347. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +111 -0
  348. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +111 -0
  349. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +112 -0
  350. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +131 -0
  351. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +111 -0
  352. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +131 -0
  353. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +131 -0
  354. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
  355. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
  356. data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +90 -0
  357. data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +59 -0
  358. data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +114 -0
  359. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +36 -0
  360. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +43 -0
  361. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +42 -0
  362. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +35 -0
  363. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +36 -0
  364. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +49 -0
  365. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +42 -0
  366. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +34 -0
  367. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +41 -0
  368. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +43 -0
  369. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +36 -0
  370. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +38 -0
  371. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +38 -0
  372. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +38 -0
  373. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large.c +145 -0
  374. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +148 -0
  375. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +124 -0
  376. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +125 -0
  377. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +44 -0
  378. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
  379. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
  380. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
  381. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +67 -0
  382. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
  383. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +67 -0
  384. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +60 -0
  385. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +64 -0
  386. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +66 -0
  387. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +64 -0
  388. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +74 -0
  389. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +81 -0
  390. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +68 -0
  391. data/ext/ffi_c/libffi/testsuite/libffi.call/testclosure.c +70 -0
  392. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
  393. data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest.cc +117 -0
  394. data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc +54 -0
  395. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
  396. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
  397. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
  398. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -0
  399. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
  400. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
  401. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
  402. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
  403. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
  404. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
  405. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
  406. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
  407. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
  408. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
  409. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
  410. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
  411. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
  412. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
  413. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
  414. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
  415. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +36 -0
  416. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
  417. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
  418. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
  419. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
  420. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
  421. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
  422. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
  423. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
  424. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
  425. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
  426. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
  427. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
  428. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
  429. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
  430. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
  431. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
  432. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
  433. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
  434. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
  435. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
  436. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
  437. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
  438. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
  439. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
  440. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
  441. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
  442. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
  443. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
  444. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
  445. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
  446. data/ext/ffi_c/rbffi.h +55 -0
  447. data/ext/ffi_c/rbffi_endian.h +59 -0
  448. data/ext/ffi_c/win32/stdbool.h +8 -0
  449. data/ext/ffi_c/win32/stdint.h +201 -0
  450. data/ffi.gemspec +43 -0
  451. data/lib/ffi.rb +20 -0
  452. data/lib/ffi/autopointer.rb +203 -0
  453. data/lib/ffi/buffer.rb +4 -0
  454. data/lib/ffi/callback.rb +4 -0
  455. data/lib/ffi/data_converter.rb +67 -0
  456. data/lib/ffi/enum.rb +296 -0
  457. data/lib/ffi/errno.rb +43 -0
  458. data/lib/ffi/ffi.rb +45 -0
  459. data/lib/ffi/io.rb +62 -0
  460. data/lib/ffi/library.rb +588 -0
  461. data/lib/ffi/managedstruct.rb +84 -0
  462. data/lib/ffi/memorypointer.rb +1 -0
  463. data/lib/ffi/platform.rb +172 -0
  464. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  465. data/lib/ffi/platform/aarch64-freebsd12/types.conf +128 -0
  466. data/lib/ffi/platform/aarch64-linux/types.conf +104 -0
  467. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  468. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  469. data/lib/ffi/platform/arm-linux/types.conf +104 -0
  470. data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
  471. data/lib/ffi/platform/i386-darwin/types.conf +100 -0
  472. data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
  473. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  474. data/lib/ffi/platform/i386-gnu/types.conf +107 -0
  475. data/lib/ffi/platform/i386-linux/types.conf +103 -0
  476. data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
  477. data/lib/ffi/platform/i386-openbsd/types.conf +128 -0
  478. data/lib/ffi/platform/i386-solaris/types.conf +122 -0
  479. data/lib/ffi/platform/i386-windows/types.conf +105 -0
  480. data/lib/ffi/platform/ia64-linux/types.conf +104 -0
  481. data/lib/ffi/platform/mips-linux/types.conf +102 -0
  482. data/lib/ffi/platform/mips64-linux/types.conf +104 -0
  483. data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  484. data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  485. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
  486. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
  487. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
  488. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
  489. data/lib/ffi/platform/powerpc-aix/types.conf +180 -0
  490. data/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
  491. data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
  492. data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  493. data/lib/ffi/platform/s390-linux/types.conf +102 -0
  494. data/lib/ffi/platform/s390x-linux/types.conf +102 -0
  495. data/lib/ffi/platform/sparc-linux/types.conf +102 -0
  496. data/lib/ffi/platform/sparc-solaris/types.conf +128 -0
  497. data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
  498. data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
  499. data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  500. data/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
  501. data/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
  502. data/lib/ffi/platform/x86_64-freebsd12/types.conf +128 -0
  503. data/lib/ffi/platform/x86_64-linux/types.conf +102 -0
  504. data/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
  505. data/lib/ffi/platform/x86_64-openbsd/types.conf +134 -0
  506. data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
  507. data/lib/ffi/platform/x86_64-windows/types.conf +120 -0
  508. data/lib/ffi/pointer.rb +160 -0
  509. data/lib/ffi/struct.rb +311 -0
  510. data/lib/ffi/struct_by_reference.rb +72 -0
  511. data/lib/ffi/struct_layout.rb +96 -0
  512. data/lib/ffi/struct_layout_builder.rb +227 -0
  513. data/lib/ffi/tools/const_generator.rb +230 -0
  514. data/lib/ffi/tools/generator.rb +105 -0
  515. data/lib/ffi/tools/generator_task.rb +32 -0
  516. data/lib/ffi/tools/struct_generator.rb +194 -0
  517. data/lib/ffi/tools/types_generator.rb +134 -0
  518. data/lib/ffi/types.rb +194 -0
  519. data/lib/ffi/union.rb +43 -0
  520. data/lib/ffi/variadic.rb +78 -0
  521. data/lib/ffi/version.rb +3 -0
  522. data/samples/getlogin.rb +8 -0
  523. data/samples/getpid.rb +8 -0
  524. data/samples/gettimeofday.rb +18 -0
  525. data/samples/hello.rb +7 -0
  526. data/samples/inotify.rb +60 -0
  527. data/samples/pty.rb +76 -0
  528. data/samples/qsort.rb +21 -0
  529. data/samples/sample_helper.rb +6 -0
  530. metadata +663 -0
@@ -0,0 +1,357 @@
1
+ /* -----------------------------------------------------------------------
2
+ linux.S - (c) 2003-2004 Randolph Chung <tausq@debian.org>
3
+ (c) 2008 Red Hat, Inc.
4
+
5
+ HPPA Foreign Function Interface
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, EXPRESS
19
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
+ IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
22
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ OTHER DEALINGS IN THE SOFTWARE.
25
+ ----------------------------------------------------------------------- */
26
+
27
+ #define LIBFFI_ASM
28
+ #include <fficonfig.h>
29
+ #include <ffi.h>
30
+
31
+ .text
32
+ .level 1.1
33
+ .align 4
34
+
35
+ /* void ffi_call_pa32(void (*)(char *, extended_cif *),
36
+ extended_cif *ecif,
37
+ unsigned bytes,
38
+ unsigned flags,
39
+ unsigned *rvalue,
40
+ void (*fn)(void));
41
+ */
42
+
43
+ .export ffi_call_pa32,code
44
+ .import ffi_prep_args_pa32,code
45
+
46
+ .type ffi_call_pa32, @function
47
+ .LFB1:
48
+ ffi_call_pa32:
49
+ .proc
50
+ .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4
51
+ .entry
52
+ stw %rp, -20(%sp)
53
+ copy %r3, %r1
54
+ .LCFI11:
55
+
56
+ copy %sp, %r3
57
+ .LCFI12:
58
+
59
+ /* Setup the stack for calling prep_args...
60
+ We want the stack to look like this:
61
+
62
+ [ Previous stack ] <- %r3
63
+
64
+ [ 64-bytes register save area ] <- %r4
65
+
66
+ [ Stack space for actual call, passed as ] <- %arg0
67
+ [ arg0 to ffi_prep_args_pa32 ]
68
+
69
+ [ Stack for calling prep_args ] <- %sp
70
+ */
71
+
72
+ stwm %r1, 64(%sp)
73
+ stw %r4, 12(%r3)
74
+ .LCFI13:
75
+ copy %sp, %r4
76
+
77
+ addl %arg2, %r4, %arg0 /* arg stack */
78
+ stw %arg3, -48(%r3) /* save flags; we need it later */
79
+
80
+ /* Call prep_args:
81
+ %arg0(stack) -- set up above
82
+ %arg1(ecif) -- same as incoming param
83
+ %arg2(bytes) -- same as incoming param */
84
+ bl ffi_prep_args_pa32,%r2
85
+ ldo 64(%arg0), %sp
86
+ ldo -64(%sp), %sp
87
+
88
+ /* now %sp should point where %arg0 was pointing. */
89
+
90
+ /* Load the arguments that should be passed in registers
91
+ The fp args were loaded by the prep_args function. */
92
+ ldw -36(%sp), %arg0
93
+ ldw -40(%sp), %arg1
94
+ ldw -44(%sp), %arg2
95
+ ldw -48(%sp), %arg3
96
+
97
+ /* in case the function is going to return a structure
98
+ we need to give it a place to put the result. */
99
+ ldw -52(%r3), %ret0 /* %ret0 <- rvalue */
100
+ ldw -56(%r3), %r22 /* %r22 <- function to call */
101
+ bl $$dyncall, %r31 /* Call the user function */
102
+ copy %r31, %rp
103
+
104
+ /* Prepare to store the result; we need to recover flags and rvalue. */
105
+ ldw -48(%r3), %r21 /* r21 <- flags */
106
+ ldw -52(%r3), %r20 /* r20 <- rvalue */
107
+
108
+ /* Store the result according to the return type. */
109
+
110
+ .Lcheckint:
111
+ comib,<>,n FFI_TYPE_INT, %r21, .Lcheckint8
112
+ b .Ldone
113
+ stw %ret0, 0(%r20)
114
+
115
+ .Lcheckint8:
116
+ comib,<>,n FFI_TYPE_UINT8, %r21, .Lcheckint16
117
+ b .Ldone
118
+ stb %ret0, 0(%r20)
119
+
120
+ .Lcheckint16:
121
+ comib,<>,n FFI_TYPE_UINT16, %r21, .Lcheckdbl
122
+ b .Ldone
123
+ sth %ret0, 0(%r20)
124
+
125
+ .Lcheckdbl:
126
+ comib,<>,n FFI_TYPE_DOUBLE, %r21, .Lcheckfloat
127
+ b .Ldone
128
+ fstd %fr4,0(%r20)
129
+
130
+ .Lcheckfloat:
131
+ comib,<>,n FFI_TYPE_FLOAT, %r21, .Lcheckll
132
+ b .Ldone
133
+ fstw %fr4L,0(%r20)
134
+
135
+ .Lcheckll:
136
+ comib,<>,n FFI_TYPE_UINT64, %r21, .Lchecksmst2
137
+ stw %ret0, 0(%r20)
138
+ b .Ldone
139
+ stw %ret1, 4(%r20)
140
+
141
+ .Lchecksmst2:
142
+ comib,<>,n FFI_TYPE_SMALL_STRUCT2, %r21, .Lchecksmst3
143
+ /* 2-byte structs are returned in ret0 as ????xxyy. */
144
+ extru %ret0, 23, 8, %r22
145
+ stbs,ma %r22, 1(%r20)
146
+ b .Ldone
147
+ stb %ret0, 0(%r20)
148
+
149
+ .Lchecksmst3:
150
+ comib,<>,n FFI_TYPE_SMALL_STRUCT3, %r21, .Lchecksmst4
151
+ /* 3-byte structs are returned in ret0 as ??xxyyzz. */
152
+ extru %ret0, 15, 8, %r22
153
+ stbs,ma %r22, 1(%r20)
154
+ extru %ret0, 23, 8, %r22
155
+ stbs,ma %r22, 1(%r20)
156
+ b .Ldone
157
+ stb %ret0, 0(%r20)
158
+
159
+ .Lchecksmst4:
160
+ comib,<>,n FFI_TYPE_SMALL_STRUCT4, %r21, .Lchecksmst5
161
+ /* 4-byte structs are returned in ret0 as wwxxyyzz. */
162
+ extru %ret0, 7, 8, %r22
163
+ stbs,ma %r22, 1(%r20)
164
+ extru %ret0, 15, 8, %r22
165
+ stbs,ma %r22, 1(%r20)
166
+ extru %ret0, 23, 8, %r22
167
+ stbs,ma %r22, 1(%r20)
168
+ b .Ldone
169
+ stb %ret0, 0(%r20)
170
+
171
+ .Lchecksmst5:
172
+ comib,<>,n FFI_TYPE_SMALL_STRUCT5, %r21, .Lchecksmst6
173
+ /* 5 byte values are returned right justified:
174
+ ret0 ret1
175
+ 5: ??????aa bbccddee */
176
+ stbs,ma %ret0, 1(%r20)
177
+ extru %ret1, 7, 8, %r22
178
+ stbs,ma %r22, 1(%r20)
179
+ extru %ret1, 15, 8, %r22
180
+ stbs,ma %r22, 1(%r20)
181
+ extru %ret1, 23, 8, %r22
182
+ stbs,ma %r22, 1(%r20)
183
+ b .Ldone
184
+ stb %ret1, 0(%r20)
185
+
186
+ .Lchecksmst6:
187
+ comib,<>,n FFI_TYPE_SMALL_STRUCT6, %r21, .Lchecksmst7
188
+ /* 6 byte values are returned right justified:
189
+ ret0 ret1
190
+ 6: ????aabb ccddeeff */
191
+ extru %ret0, 23, 8, %r22
192
+ stbs,ma %r22, 1(%r20)
193
+ stbs,ma %ret0, 1(%r20)
194
+ extru %ret1, 7, 8, %r22
195
+ stbs,ma %r22, 1(%r20)
196
+ extru %ret1, 15, 8, %r22
197
+ stbs,ma %r22, 1(%r20)
198
+ extru %ret1, 23, 8, %r22
199
+ stbs,ma %r22, 1(%r20)
200
+ b .Ldone
201
+ stb %ret1, 0(%r20)
202
+
203
+ .Lchecksmst7:
204
+ comib,<>,n FFI_TYPE_SMALL_STRUCT7, %r21, .Lchecksmst8
205
+ /* 7 byte values are returned right justified:
206
+ ret0 ret1
207
+ 7: ??aabbcc ddeeffgg */
208
+ extru %ret0, 15, 8, %r22
209
+ stbs,ma %r22, 1(%r20)
210
+ extru %ret0, 23, 8, %r22
211
+ stbs,ma %r22, 1(%r20)
212
+ stbs,ma %ret0, 1(%r20)
213
+ extru %ret1, 7, 8, %r22
214
+ stbs,ma %r22, 1(%r20)
215
+ extru %ret1, 15, 8, %r22
216
+ stbs,ma %r22, 1(%r20)
217
+ extru %ret1, 23, 8, %r22
218
+ stbs,ma %r22, 1(%r20)
219
+ b .Ldone
220
+ stb %ret1, 0(%r20)
221
+
222
+ .Lchecksmst8:
223
+ comib,<>,n FFI_TYPE_SMALL_STRUCT8, %r21, .Ldone
224
+ /* 8 byte values are returned right justified:
225
+ ret0 ret1
226
+ 8: aabbccdd eeffgghh */
227
+ extru %ret0, 7, 8, %r22
228
+ stbs,ma %r22, 1(%r20)
229
+ extru %ret0, 15, 8, %r22
230
+ stbs,ma %r22, 1(%r20)
231
+ extru %ret0, 23, 8, %r22
232
+ stbs,ma %r22, 1(%r20)
233
+ stbs,ma %ret0, 1(%r20)
234
+ extru %ret1, 7, 8, %r22
235
+ stbs,ma %r22, 1(%r20)
236
+ extru %ret1, 15, 8, %r22
237
+ stbs,ma %r22, 1(%r20)
238
+ extru %ret1, 23, 8, %r22
239
+ stbs,ma %r22, 1(%r20)
240
+ stb %ret1, 0(%r20)
241
+
242
+ .Ldone:
243
+ /* all done, return */
244
+ copy %r4, %sp /* pop arg stack */
245
+ ldw 12(%r3), %r4
246
+ ldwm -64(%sp), %r3 /* .. and pop stack */
247
+ ldw -20(%sp), %rp
248
+ bv %r0(%rp)
249
+ nop
250
+ .exit
251
+ .procend
252
+ .LFE1:
253
+
254
+ /* void ffi_closure_pa32(void);
255
+ Called with closure argument in %r21 */
256
+ .export ffi_closure_pa32,code
257
+ .import ffi_closure_inner_pa32,code
258
+
259
+ .type ffi_closure_pa32, @function
260
+ .LFB2:
261
+ ffi_closure_pa32:
262
+ .proc
263
+ .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
264
+ .entry
265
+
266
+ stw %rp, -20(%sp)
267
+ .LCFI20:
268
+ copy %r3, %r1
269
+ .LCFI21:
270
+ copy %sp, %r3
271
+ .LCFI22:
272
+ stwm %r1, 64(%sp)
273
+
274
+ /* Put arguments onto the stack and call ffi_closure_inner. */
275
+ stw %arg0, -36(%r3)
276
+ stw %arg1, -40(%r3)
277
+ stw %arg2, -44(%r3)
278
+ stw %arg3, -48(%r3)
279
+
280
+ copy %r21, %arg0
281
+ bl ffi_closure_inner_pa32, %r2
282
+ copy %r3, %arg1
283
+
284
+ ldwm -64(%sp), %r3
285
+ ldw -20(%sp), %rp
286
+ ldw -36(%sp), %ret0
287
+ bv %r0(%r2)
288
+ ldw -40(%sp), %ret1
289
+
290
+ .exit
291
+ .procend
292
+ .LFE2:
293
+
294
+ .section ".eh_frame",EH_FRAME_FLAGS,@progbits
295
+ .Lframe1:
296
+ .word .LECIE1-.LSCIE1 ;# Length of Common Information Entry
297
+ .LSCIE1:
298
+ .word 0x0 ;# CIE Identifier Tag
299
+ .byte 0x1 ;# CIE Version
300
+ .ascii "\0" ;# CIE Augmentation
301
+ .uleb128 0x1 ;# CIE Code Alignment Factor
302
+ .sleb128 4 ;# CIE Data Alignment Factor
303
+ .byte 0x2 ;# CIE RA Column
304
+ .byte 0xc ;# DW_CFA_def_cfa
305
+ .uleb128 0x1e
306
+ .uleb128 0x0
307
+ .align 4
308
+ .LECIE1:
309
+ .LSFDE1:
310
+ .word .LEFDE1-.LASFDE1 ;# FDE Length
311
+ .LASFDE1:
312
+ .word .LASFDE1-.Lframe1 ;# FDE CIE offset
313
+ .word .LFB1 ;# FDE initial location
314
+ .word .LFE1-.LFB1 ;# FDE address range
315
+
316
+ .byte 0x4 ;# DW_CFA_advance_loc4
317
+ .word .LCFI11-.LFB1
318
+ .byte 0x83 ;# DW_CFA_offset, column 0x3
319
+ .uleb128 0x0
320
+ .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20]
321
+ .uleb128 0x2
322
+ .sleb128 -5
323
+
324
+ .byte 0x4 ;# DW_CFA_advance_loc4
325
+ .word .LCFI12-.LCFI11
326
+ .byte 0xd ;# DW_CFA_def_cfa_register = r3
327
+ .uleb128 0x3
328
+
329
+ .byte 0x4 ;# DW_CFA_advance_loc4
330
+ .word .LCFI13-.LCFI12
331
+ .byte 0x84 ;# DW_CFA_offset, column 0x4
332
+ .uleb128 0x3
333
+
334
+ .align 4
335
+ .LEFDE1:
336
+
337
+ .LSFDE2:
338
+ .word .LEFDE2-.LASFDE2 ;# FDE Length
339
+ .LASFDE2:
340
+ .word .LASFDE2-.Lframe1 ;# FDE CIE offset
341
+ .word .LFB2 ;# FDE initial location
342
+ .word .LFE2-.LFB2 ;# FDE address range
343
+ .byte 0x4 ;# DW_CFA_advance_loc4
344
+ .word .LCFI21-.LFB2
345
+ .byte 0x83 ;# DW_CFA_offset, column 0x3
346
+ .uleb128 0x0
347
+ .byte 0x11 ;# DW_CFA_offset_extended_sf
348
+ .uleb128 0x2
349
+ .sleb128 -5
350
+
351
+ .byte 0x4 ;# DW_CFA_advance_loc4
352
+ .word .LCFI22-.LCFI21
353
+ .byte 0xd ;# DW_CFA_def_cfa_register = r3
354
+ .uleb128 0x3
355
+
356
+ .align 4
357
+ .LEFDE2:
@@ -0,0 +1,566 @@
1
+ /* -----------------------------------------------------------------------
2
+ aix.S - Copyright (c) 2002, 2009 Free Software Foundation, Inc.
3
+ based on darwin.S by John Hornkvist
4
+
5
+ PowerPC 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, EXPRESS
19
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
22
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ OTHER DEALINGS IN THE SOFTWARE.
25
+ ----------------------------------------------------------------------- */
26
+
27
+ .set r0,0
28
+ .set r1,1
29
+ .set r2,2
30
+ .set r3,3
31
+ .set r4,4
32
+ .set r5,5
33
+ .set r6,6
34
+ .set r7,7
35
+ .set r8,8
36
+ .set r9,9
37
+ .set r10,10
38
+ .set r11,11
39
+ .set r12,12
40
+ .set r13,13
41
+ .set r14,14
42
+ .set r15,15
43
+ .set r16,16
44
+ .set r17,17
45
+ .set r18,18
46
+ .set r19,19
47
+ .set r20,20
48
+ .set r21,21
49
+ .set r22,22
50
+ .set r23,23
51
+ .set r24,24
52
+ .set r25,25
53
+ .set r26,26
54
+ .set r27,27
55
+ .set r28,28
56
+ .set r29,29
57
+ .set r30,30
58
+ .set r31,31
59
+ .set f0,0
60
+ .set f1,1
61
+ .set f2,2
62
+ .set f3,3
63
+ .set f4,4
64
+ .set f5,5
65
+ .set f6,6
66
+ .set f7,7
67
+ .set f8,8
68
+ .set f9,9
69
+ .set f10,10
70
+ .set f11,11
71
+ .set f12,12
72
+ .set f13,13
73
+ .set f14,14
74
+ .set f15,15
75
+ .set f16,16
76
+ .set f17,17
77
+ .set f18,18
78
+ .set f19,19
79
+ .set f20,20
80
+ .set f21,21
81
+
82
+ .extern .ffi_prep_args
83
+
84
+ #define LIBFFI_ASM
85
+ #include <fficonfig.h>
86
+ #include <ffi.h>
87
+ #define JUMPTARGET(name) name
88
+ #define L(x) x
89
+ .file "aix.S"
90
+ .toc
91
+
92
+ /* void ffi_call_AIX(extended_cif *ecif, unsigned long bytes,
93
+ * unsigned int flags, unsigned int *rvalue,
94
+ * void (*fn)(),
95
+ * void (*prep_args)(extended_cif*, unsigned *const));
96
+ * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args
97
+ */
98
+
99
+ .csect .text[PR]
100
+ .align 2
101
+ .globl ffi_call_AIX
102
+ .globl .ffi_call_AIX
103
+ .csect ffi_call_AIX[DS]
104
+ ffi_call_AIX:
105
+ #ifdef __64BIT__
106
+ .llong .ffi_call_AIX, TOC[tc0], 0
107
+ .csect .text[PR]
108
+ .ffi_call_AIX:
109
+ .function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0
110
+ .bf __LINE__
111
+ .line 1
112
+ LFB..0:
113
+ /* Save registers we use. */
114
+ mflr r0
115
+
116
+ std r28,-32(r1)
117
+ std r29,-24(r1)
118
+ std r30,-16(r1)
119
+ std r31, -8(r1)
120
+
121
+ std r0, 16(r1)
122
+ LCFI..0:
123
+ mr r28, r1 /* our AP. */
124
+ stdux r1, r1, r4
125
+ LCFI..1:
126
+
127
+ /* Save arguments over call... */
128
+ mr r31, r5 /* flags, */
129
+ mr r30, r6 /* rvalue, */
130
+ mr r29, r7 /* function address. */
131
+ std r2, 40(r1)
132
+
133
+ /* Call ffi_prep_args. */
134
+ mr r4, r1
135
+ bl .ffi_prep_args
136
+ nop
137
+
138
+ /* Now do the call. */
139
+ ld r0, 0(r29)
140
+ ld r2, 8(r29)
141
+ ld r11, 16(r29)
142
+ /* Set up cr1 with bits 4-7 of the flags. */
143
+ mtcrf 0x40, r31
144
+ mtctr r0
145
+ /* Load all those argument registers. */
146
+ /* We have set up a nice stack frame, just load it into registers. */
147
+ ld r3, 40+(1*8)(r1)
148
+ ld r4, 40+(2*8)(r1)
149
+ ld r5, 40+(3*8)(r1)
150
+ ld r6, 40+(4*8)(r1)
151
+ nop
152
+ ld r7, 40+(5*8)(r1)
153
+ ld r8, 40+(6*8)(r1)
154
+ ld r9, 40+(7*8)(r1)
155
+ ld r10,40+(8*8)(r1)
156
+
157
+ L1:
158
+ /* Load all the FP registers. */
159
+ bf 6,L2 /* 2f + 0x18 */
160
+ lfd f1,-32-(13*8)(r28)
161
+ lfd f2,-32-(12*8)(r28)
162
+ lfd f3,-32-(11*8)(r28)
163
+ lfd f4,-32-(10*8)(r28)
164
+ nop
165
+ lfd f5,-32-(9*8)(r28)
166
+ lfd f6,-32-(8*8)(r28)
167
+ lfd f7,-32-(7*8)(r28)
168
+ lfd f8,-32-(6*8)(r28)
169
+ nop
170
+ lfd f9,-32-(5*8)(r28)
171
+ lfd f10,-32-(4*8)(r28)
172
+ lfd f11,-32-(3*8)(r28)
173
+ lfd f12,-32-(2*8)(r28)
174
+ nop
175
+ lfd f13,-32-(1*8)(r28)
176
+
177
+ L2:
178
+ /* Make the call. */
179
+ bctrl
180
+ ld r2, 40(r1)
181
+
182
+ /* Now, deal with the return value. */
183
+ mtcrf 0x01, r31
184
+
185
+ bt 30, L(done_return_value)
186
+ bt 29, L(fp_return_value)
187
+ std r3, 0(r30)
188
+
189
+ /* Fall through... */
190
+
191
+ L(done_return_value):
192
+ /* Restore the registers we used and return. */
193
+ mr r1, r28
194
+ ld r0, 16(r28)
195
+ ld r28, -32(r1)
196
+ mtlr r0
197
+ ld r29, -24(r1)
198
+ ld r30, -16(r1)
199
+ ld r31, -8(r1)
200
+ blr
201
+
202
+ L(fp_return_value):
203
+ bf 28, L(float_return_value)
204
+ stfd f1, 0(r30)
205
+ bf 31, L(done_return_value)
206
+ stfd f2, 8(r30)
207
+ b L(done_return_value)
208
+ L(float_return_value):
209
+ stfs f1, 0(r30)
210
+ b L(done_return_value)
211
+ LFE..0:
212
+ #else /* ! __64BIT__ */
213
+
214
+ .long .ffi_call_AIX, TOC[tc0], 0
215
+ .csect .text[PR]
216
+ .ffi_call_AIX:
217
+ .function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0
218
+ .bf __LINE__
219
+ .line 1
220
+ LFB..0:
221
+ /* Save registers we use. */
222
+ mflr r0
223
+
224
+ stw r28,-16(r1)
225
+ stw r29,-12(r1)
226
+ stw r30, -8(r1)
227
+ stw r31, -4(r1)
228
+
229
+ stw r0, 8(r1)
230
+ LCFI..0:
231
+ mr r28, r1 /* out AP. */
232
+ stwux r1, r1, r4
233
+ LCFI..1:
234
+
235
+ /* Save arguments over call... */
236
+ mr r31, r5 /* flags, */
237
+ mr r30, r6 /* rvalue, */
238
+ mr r29, r7 /* function address, */
239
+ stw r2, 20(r1)
240
+
241
+ /* Call ffi_prep_args. */
242
+ mr r4, r1
243
+ bl .ffi_prep_args
244
+ nop
245
+
246
+ /* Now do the call. */
247
+ lwz r0, 0(r29)
248
+ lwz r2, 4(r29)
249
+ lwz r11, 8(r29)
250
+ /* Set up cr1 with bits 4-7 of the flags. */
251
+ mtcrf 0x40, r31
252
+ mtctr r0
253
+ /* Load all those argument registers. */
254
+ /* We have set up a nice stack frame, just load it into registers. */
255
+ lwz r3, 20+(1*4)(r1)
256
+ lwz r4, 20+(2*4)(r1)
257
+ lwz r5, 20+(3*4)(r1)
258
+ lwz r6, 20+(4*4)(r1)
259
+ nop
260
+ lwz r7, 20+(5*4)(r1)
261
+ lwz r8, 20+(6*4)(r1)
262
+ lwz r9, 20+(7*4)(r1)
263
+ lwz r10,20+(8*4)(r1)
264
+
265
+ L1:
266
+ /* Load all the FP registers. */
267
+ bf 6,L2 /* 2f + 0x18 */
268
+ lfd f1,-16-(13*8)(r28)
269
+ lfd f2,-16-(12*8)(r28)
270
+ lfd f3,-16-(11*8)(r28)
271
+ lfd f4,-16-(10*8)(r28)
272
+ nop
273
+ lfd f5,-16-(9*8)(r28)
274
+ lfd f6,-16-(8*8)(r28)
275
+ lfd f7,-16-(7*8)(r28)
276
+ lfd f8,-16-(6*8)(r28)
277
+ nop
278
+ lfd f9,-16-(5*8)(r28)
279
+ lfd f10,-16-(4*8)(r28)
280
+ lfd f11,-16-(3*8)(r28)
281
+ lfd f12,-16-(2*8)(r28)
282
+ nop
283
+ lfd f13,-16-(1*8)(r28)
284
+
285
+ L2:
286
+ /* Make the call. */
287
+ bctrl
288
+ lwz r2, 20(r1)
289
+
290
+ /* Now, deal with the return value. */
291
+ mtcrf 0x01, r31
292
+
293
+ bt 30, L(done_return_value)
294
+ bt 29, L(fp_return_value)
295
+ stw r3, 0(r30)
296
+ bf 28, L(done_return_value)
297
+ stw r4, 4(r30)
298
+
299
+ /* Fall through... */
300
+
301
+ L(done_return_value):
302
+ /* Restore the registers we used and return. */
303
+ mr r1, r28
304
+ lwz r0, 8(r28)
305
+ lwz r28,-16(r1)
306
+ mtlr r0
307
+ lwz r29,-12(r1)
308
+ lwz r30, -8(r1)
309
+ lwz r31, -4(r1)
310
+ blr
311
+
312
+ L(fp_return_value):
313
+ bf 28, L(float_return_value)
314
+ stfd f1, 0(r30)
315
+ b L(done_return_value)
316
+ L(float_return_value):
317
+ stfs f1, 0(r30)
318
+ b L(done_return_value)
319
+ LFE..0:
320
+ #endif
321
+ .ef __LINE__
322
+ .long 0
323
+ .byte 0,0,0,1,128,4,0,0
324
+ /* END(ffi_call_AIX) */
325
+
326
+ /* void ffi_call_go_AIX(extended_cif *ecif, unsigned long bytes,
327
+ * unsigned int flags, unsigned int *rvalue,
328
+ * void (*fn)(),
329
+ * void (*prep_args)(extended_cif*, unsigned *const),
330
+ * void *closure);
331
+ * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args, r9=closure
332
+ */
333
+
334
+ .csect .text[PR]
335
+ .align 2
336
+ .globl ffi_call_go_AIX
337
+ .globl .ffi_call_go_AIX
338
+ .csect ffi_call_go_AIX[DS]
339
+ ffi_call_go_AIX:
340
+ #ifdef __64BIT__
341
+ .llong .ffi_call_go_AIX, TOC[tc0], 0
342
+ .csect .text[PR]
343
+ .ffi_call_go_AIX:
344
+ .function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1
345
+ .bf __LINE__
346
+ .line 1
347
+ LFB..1:
348
+ /* Save registers we use. */
349
+ mflr r0
350
+
351
+ std r28,-32(r1)
352
+ std r29,-24(r1)
353
+ std r30,-16(r1)
354
+ std r31, -8(r1)
355
+
356
+ std r9, 8(r1) /* closure, saved in cr field. */
357
+ std r0, 16(r1)
358
+ LCFI..2:
359
+ mr r28, r1 /* our AP. */
360
+ stdux r1, r1, r4
361
+ LCFI..3:
362
+
363
+ /* Save arguments over call... */
364
+ mr r31, r5 /* flags, */
365
+ mr r30, r6 /* rvalue, */
366
+ mr r29, r7 /* function address, */
367
+ std r2, 40(r1)
368
+
369
+ /* Call ffi_prep_args. */
370
+ mr r4, r1
371
+ bl .ffi_prep_args
372
+ nop
373
+
374
+ /* Now do the call. */
375
+ ld r0, 0(r29)
376
+ ld r2, 8(r29)
377
+ ld r11, 8(r28) /* closure */
378
+ /* Set up cr1 with bits 4-7 of the flags. */
379
+ mtcrf 0x40, r31
380
+ mtctr r0
381
+ /* Load all those argument registers. */
382
+ /* We have set up a nice stack frame, just load it into registers. */
383
+ ld r3, 40+(1*8)(r1)
384
+ ld r4, 40+(2*8)(r1)
385
+ ld r5, 40+(3*8)(r1)
386
+ ld r6, 40+(4*8)(r1)
387
+ nop
388
+ ld r7, 40+(5*8)(r1)
389
+ ld r8, 40+(6*8)(r1)
390
+ ld r9, 40+(7*8)(r1)
391
+ ld r10,40+(8*8)(r1)
392
+
393
+ b L1
394
+ LFE..1:
395
+ #else /* ! __64BIT__ */
396
+
397
+ .long .ffi_call_go_AIX, TOC[tc0], 0
398
+ .csect .text[PR]
399
+ .ffi_call_go_AIX:
400
+ .function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1
401
+ .bf __LINE__
402
+ .line 1
403
+ /* Save registers we use. */
404
+ LFB..1:
405
+ mflr r0
406
+
407
+ stw r28,-16(r1)
408
+ stw r29,-12(r1)
409
+ stw r30, -8(r1)
410
+ stw r31, -4(r1)
411
+
412
+ stw r9, 4(r1) /* closure, saved in cr field. */
413
+ stw r0, 8(r1)
414
+ LCFI..2:
415
+ mr r28, r1 /* out AP. */
416
+ stwux r1, r1, r4
417
+ LCFI..3:
418
+
419
+ /* Save arguments over call... */
420
+ mr r31, r5 /* flags, */
421
+ mr r30, r6 /* rvalue, */
422
+ mr r29, r7 /* function address, */
423
+ stw r2, 20(r1)
424
+
425
+ /* Call ffi_prep_args. */
426
+ mr r4, r1
427
+ bl .ffi_prep_args
428
+ nop
429
+
430
+ /* Now do the call. */
431
+ lwz r0, 0(r29)
432
+ lwz r2, 4(r29)
433
+ lwz r11, 4(r28) /* closure */
434
+ /* Set up cr1 with bits 4-7 of the flags. */
435
+ mtcrf 0x40, r31
436
+ mtctr r0
437
+ /* Load all those argument registers. */
438
+ /* We have set up a nice stack frame, just load it into registers. */
439
+ lwz r3, 20+(1*4)(r1)
440
+ lwz r4, 20+(2*4)(r1)
441
+ lwz r5, 20+(3*4)(r1)
442
+ lwz r6, 20+(4*4)(r1)
443
+ nop
444
+ lwz r7, 20+(5*4)(r1)
445
+ lwz r8, 20+(6*4)(r1)
446
+ lwz r9, 20+(7*4)(r1)
447
+ lwz r10,20+(8*4)(r1)
448
+
449
+ b L1
450
+ LFE..1:
451
+ #endif
452
+ .ef __LINE__
453
+ .long 0
454
+ .byte 0,0,0,1,128,4,0,0
455
+ /* END(ffi_call_go_AIX) */
456
+
457
+ .csect .text[PR]
458
+ .align 2
459
+ .globl ffi_call_DARWIN
460
+ .globl .ffi_call_DARWIN
461
+ .csect ffi_call_DARWIN[DS]
462
+ ffi_call_DARWIN:
463
+ #ifdef __64BIT__
464
+ .llong .ffi_call_DARWIN, TOC[tc0], 0
465
+ #else
466
+ .long .ffi_call_DARWIN, TOC[tc0], 0
467
+ #endif
468
+ .csect .text[PR]
469
+ .ffi_call_DARWIN:
470
+ blr
471
+ .long 0
472
+ .byte 0,0,0,0,0,0,0,0
473
+ /* END(ffi_call_DARWIN) */
474
+
475
+ /* EH frame stuff. */
476
+
477
+ #define LR_REGNO 0x41 /* Link Register (65), see rs6000.md */
478
+ #ifdef __64BIT__
479
+ #define PTRSIZE 8
480
+ #define LOG2_PTRSIZE 3
481
+ #define FDE_ENCODING 0x1c /* DW_EH_PE_pcrel|DW_EH_PE_sdata8 */
482
+ #define EH_DATA_ALIGN_FACT 0x78 /* LEB128 -8 */
483
+ #else
484
+ #define PTRSIZE 4
485
+ #define LOG2_PTRSIZE 2
486
+ #define FDE_ENCODING 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4 */
487
+ #define EH_DATA_ALIGN_FACT 0x7c /* LEB128 -4 */
488
+ #endif
489
+ .csect _unwind.ro_[RO],4
490
+ .align LOG2_PTRSIZE
491
+ .globl _GLOBAL__F_libffi_src_powerpc_aix
492
+ _GLOBAL__F_libffi_src_powerpc_aix:
493
+ Lframe..1:
494
+ .vbyte 4,LECIE..1-LSCIE..1 /* CIE Length */
495
+ LSCIE..1:
496
+ .vbyte 4,0 /* CIE Identifier Tag */
497
+ .byte 0x3 /* CIE Version */
498
+ .byte "zR" /* CIE Augmentation */
499
+ .byte 0
500
+ .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */
501
+ .byte EH_DATA_ALIGN_FACT /* leb128 -4/-8; CIE Data Alignment Factor */
502
+ .byte 0x41 /* CIE RA Column */
503
+ .byte 0x1 /* uleb128 0x1; Augmentation size */
504
+ .byte FDE_ENCODING /* FDE Encoding (pcrel|sdata4/8) */
505
+ .byte 0xc /* DW_CFA_def_cfa */
506
+ .byte 0x1 /* uleb128 0x1; Register r1 */
507
+ .byte 0 /* uleb128 0x0; Offset 0 */
508
+ .align LOG2_PTRSIZE
509
+ LECIE..1:
510
+ LSFDE..1:
511
+ .vbyte 4,LEFDE..1-LASFDE..1 /* FDE Length */
512
+ LASFDE..1:
513
+ .vbyte 4,LASFDE..1-Lframe..1 /* FDE CIE offset */
514
+ .vbyte PTRSIZE,LFB..0-$ /* FDE initial location */
515
+ .vbyte PTRSIZE,LFE..0-LFB..0 /* FDE address range */
516
+ .byte 0 /* uleb128 0x0; Augmentation size */
517
+ .byte 0x4 /* DW_CFA_advance_loc4 */
518
+ .vbyte 4,LCFI..0-LFB..0
519
+ .byte 0x11 /* DW_CFA_def_offset_extended_sf */
520
+ .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */
521
+ .byte 0x7e /* leb128 -2; Offset -2 (8/16) */
522
+ .byte 0x9f /* DW_CFA_offset Register r31 */
523
+ .byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */
524
+ .byte 0x9e /* DW_CFA_offset Register r30 */
525
+ .byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */
526
+ .byte 0x9d /* DW_CFA_offset Register r29 */
527
+ .byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */
528
+ .byte 0x9c /* DW_CFA_offset Register r28 */
529
+ .byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */
530
+ .byte 0x4 /* DW_CFA_advance_loc4 */
531
+ .vbyte 4,LCFI..1-LCFI..0
532
+ .byte 0xd /* DW_CFA_def_cfa_register */
533
+ .byte 0x1c /* uleb128 28; Register r28 */
534
+ .align LOG2_PTRSIZE
535
+ LEFDE..1:
536
+ LSFDE..2:
537
+ .vbyte 4,LEFDE..2-LASFDE..2 /* FDE Length */
538
+ LASFDE..2:
539
+ .vbyte 4,LASFDE..2-Lframe..1 /* FDE CIE offset */
540
+ .vbyte PTRSIZE,LFB..1-$ /* FDE initial location */
541
+ .vbyte PTRSIZE,LFE..1-LFB..1 /* FDE address range */
542
+ .byte 0 /* uleb128 0x0; Augmentation size */
543
+ .byte 0x4 /* DW_CFA_advance_loc4 */
544
+ .vbyte 4,LCFI..2-LFB..1
545
+ .byte 0x11 /* DW_CFA_def_offset_extended_sf */
546
+ .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */
547
+ .byte 0x7e /* leb128 -2; Offset -2 (8/16) */
548
+ .byte 0x9f /* DW_CFA_offset Register r31 */
549
+ .byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */
550
+ .byte 0x9e /* DW_CFA_offset Register r30 */
551
+ .byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */
552
+ .byte 0x9d /* DW_CFA_offset Register r29 */
553
+ .byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */
554
+ .byte 0x9c /* DW_CFA_offset Register r28 */
555
+ .byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */
556
+ .byte 0x4 /* DW_CFA_advance_loc4 */
557
+ .vbyte 4,LCFI..3-LCFI..2
558
+ .byte 0xd /* DW_CFA_def_cfa_register */
559
+ .byte 0x1c /* uleb128 28; Register r28 */
560
+ .align LOG2_PTRSIZE
561
+ LEFDE..2:
562
+ .vbyte 4,0 /* End of FDEs */
563
+
564
+ .csect .text[PR]
565
+ .ref _GLOBAL__F_libffi_src_powerpc_aix /* Prevents garbage collection by AIX linker */
566
+