ffi 1.15.5 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +118 -0
  4. data/Gemfile +10 -3
  5. data/README.md +4 -3
  6. data/Rakefile +25 -10
  7. data/ext/ffi_c/AbstractMemory.c +99 -74
  8. data/ext/ffi_c/AbstractMemory.h +3 -2
  9. data/ext/ffi_c/ArrayType.c +51 -15
  10. data/ext/ffi_c/ArrayType.h +1 -0
  11. data/ext/ffi_c/Buffer.c +90 -33
  12. data/ext/ffi_c/Call.c +29 -12
  13. data/ext/ffi_c/Call.h +3 -2
  14. data/ext/ffi_c/DynamicLibrary.c +90 -27
  15. data/ext/ffi_c/Function.c +244 -98
  16. data/ext/ffi_c/Function.h +1 -0
  17. data/ext/ffi_c/FunctionInfo.c +81 -25
  18. data/ext/ffi_c/LastError.c +29 -11
  19. data/ext/ffi_c/MappedType.c +66 -23
  20. data/ext/ffi_c/MappedType.h +0 -2
  21. data/ext/ffi_c/MemoryPointer.c +36 -9
  22. data/ext/ffi_c/MethodHandle.c +3 -1
  23. data/ext/ffi_c/Pointer.c +82 -40
  24. data/ext/ffi_c/Pointer.h +1 -0
  25. data/ext/ffi_c/Struct.c +166 -84
  26. data/ext/ffi_c/Struct.h +7 -4
  27. data/ext/ffi_c/StructByValue.c +48 -16
  28. data/ext/ffi_c/StructLayout.c +130 -61
  29. data/ext/ffi_c/Type.c +120 -51
  30. data/ext/ffi_c/Type.h +3 -1
  31. data/ext/ffi_c/Types.c +8 -2
  32. data/ext/ffi_c/Types.h +0 -1
  33. data/ext/ffi_c/Variadic.c +71 -26
  34. data/ext/ffi_c/compat.h +22 -22
  35. data/ext/ffi_c/extconf.rb +19 -2
  36. data/ext/ffi_c/ffi.c +4 -0
  37. data/ext/ffi_c/libffi/.allow-ai-service +0 -0
  38. data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
  39. data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
  40. data/ext/ffi_c/libffi/.appveyor.yml +27 -9
  41. data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
  42. data/ext/ffi_c/libffi/{.travis → .ci}/build-in-container.sh +4 -6
  43. data/ext/ffi_c/libffi/.ci/build.sh +124 -0
  44. data/ext/ffi_c/libffi/{.travis → .ci}/install.sh +14 -7
  45. data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
  46. data/ext/ffi_c/libffi/{.travis → .ci}/site.exp +5 -3
  47. data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
  48. data/ext/ffi_c/libffi/.github/workflows/build.yml +479 -0
  49. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +172 -0
  50. data/ext/ffi_c/libffi/.gitignore +10 -2
  51. data/ext/ffi_c/libffi/LICENSE +1 -1
  52. data/ext/ffi_c/libffi/Makefile.am +12 -5
  53. data/ext/ffi_c/libffi/Makefile.in +118 -51
  54. data/ext/ffi_c/libffi/README.md +150 -105
  55. data/ext/ffi_c/libffi/acinclude.m4 +10 -112
  56. data/ext/ffi_c/libffi/compile +348 -0
  57. data/ext/ffi_c/libffi/config.guess +623 -556
  58. data/ext/ffi_c/libffi/config.sub +75 -34
  59. data/ext/ffi_c/libffi/configure +4571 -3830
  60. data/ext/ffi_c/libffi/configure.ac +64 -28
  61. data/ext/ffi_c/libffi/configure.host +26 -7
  62. data/ext/ffi_c/libffi/doc/Makefile.in +9 -6
  63. data/ext/ffi_c/libffi/doc/libffi.texi +82 -33
  64. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  65. data/ext/ffi_c/libffi/fficonfig.h.in +12 -47
  66. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +163 -52
  67. data/ext/ffi_c/libffi/include/Makefile.am +1 -1
  68. data/ext/ffi_c/libffi/include/Makefile.in +10 -9
  69. data/ext/ffi_c/libffi/include/ffi.h.in +55 -60
  70. data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
  71. data/ext/ffi_c/libffi/include/ffi_common.h +33 -2
  72. data/ext/ffi_c/libffi/include/tramp.h +45 -0
  73. data/ext/ffi_c/libffi/install-sh +92 -69
  74. data/ext/ffi_c/libffi/libffi.map.in +5 -0
  75. data/ext/ffi_c/libffi/libtool-version +2 -2
  76. data/ext/ffi_c/libffi/ltmain.sh +518 -333
  77. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
  78. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
  79. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -45
  80. data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
  81. data/ext/ffi_c/libffi/man/Makefile.in +9 -6
  82. data/ext/ffi_c/libffi/missing +1 -1
  83. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +2 -2
  84. data/ext/ffi_c/libffi/msvcc.sh +1 -1
  85. data/ext/ffi_c/libffi/src/aarch64/ffi.c +172 -55
  86. data/ext/ffi_c/libffi/src/aarch64/internal.h +32 -0
  87. data/ext/ffi_c/libffi/src/aarch64/sysv.S +331 -87
  88. data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
  89. data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
  90. data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
  91. data/ext/ffi_c/libffi/src/arm/ffi.c +62 -17
  92. data/ext/ffi_c/libffi/src/arm/ffitarget.h +3 -3
  93. data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
  94. data/ext/ffi_c/libffi/src/arm/sysv.S +113 -42
  95. data/ext/ffi_c/libffi/src/closures.c +136 -50
  96. data/ext/ffi_c/libffi/src/debug.c +2 -2
  97. data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
  98. data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
  99. data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
  100. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
  101. data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
  102. data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
  103. data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
  104. data/ext/ffi_c/libffi/src/mips/ffi.c +250 -67
  105. data/ext/ffi_c/libffi/src/mips/ffitarget.h +7 -0
  106. data/ext/ffi_c/libffi/src/mips/n32.S +193 -33
  107. data/ext/ffi_c/libffi/src/mips/o32.S +61 -4
  108. data/ext/ffi_c/libffi/src/moxie/ffi.c +47 -22
  109. data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
  110. data/ext/ffi_c/libffi/src/pa/ffi.c +32 -33
  111. data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
  112. data/ext/ffi_c/libffi/src/pa/ffitarget.h +22 -8
  113. data/ext/ffi_c/libffi/src/pa/hpux32.S +83 -36
  114. data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
  115. data/ext/ffi_c/libffi/src/pa/linux.S +82 -35
  116. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +36 -24
  117. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1 -1
  118. data/ext/ffi_c/libffi/src/powerpc/linux64.S +2 -0
  119. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +2 -0
  120. data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
  121. data/ext/ffi_c/libffi/src/prep_cif.c +22 -2
  122. data/ext/ffi_c/libffi/src/riscv/ffi.c +37 -4
  123. data/ext/ffi_c/libffi/src/sparc/ffi64.c +23 -1
  124. data/ext/ffi_c/libffi/src/tramp.c +716 -0
  125. data/ext/ffi_c/libffi/src/types.c +4 -6
  126. data/ext/ffi_c/libffi/src/wasm32/ffi.c +947 -0
  127. data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
  128. data/ext/ffi_c/libffi/src/x86/ffi.c +99 -37
  129. data/ext/ffi_c/libffi/src/x86/ffi64.c +67 -12
  130. data/ext/ffi_c/libffi/src/x86/ffitarget.h +9 -5
  131. data/ext/ffi_c/libffi/src/x86/ffiw64.c +44 -1
  132. data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
  133. data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
  134. data/ext/ffi_c/libffi/src/x86/sysv.S +172 -38
  135. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +91 -88
  136. data/ext/ffi_c/libffi/src/x86/unix64.S +96 -6
  137. data/ext/ffi_c/libffi/src/x86/win64.S +20 -7
  138. data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
  139. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
  140. data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
  141. data/ext/ffi_c/libffi/testsuite/Makefile.am +79 -114
  142. data/ext/ffi_c/libffi/testsuite/Makefile.in +89 -121
  143. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
  144. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
  145. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +86 -0
  146. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
  147. data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
  148. data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
  149. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +43 -21
  150. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
  151. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1 -0
  152. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
  153. data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
  154. data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
  155. data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
  156. data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
  157. data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
  158. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
  159. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
  160. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
  161. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
  162. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
  163. data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
  164. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
  165. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
  166. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
  167. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
  168. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
  169. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
  170. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
  171. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
  172. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
  173. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
  174. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
  175. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
  176. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
  177. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
  178. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
  179. data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
  180. data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
  181. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
  182. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
  183. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
  184. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +3 -2
  185. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +2 -0
  186. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +2 -0
  187. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +21 -1
  188. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +2 -0
  189. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +2 -0
  190. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +2 -0
  191. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +7 -6
  192. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +6 -0
  193. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +18 -0
  194. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +22 -0
  195. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +24 -0
  196. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +29 -0
  197. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +4 -0
  198. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +19 -1
  199. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +21 -1
  200. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +35 -3
  201. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +13 -0
  202. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +19 -0
  203. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +13 -0
  204. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +13 -0
  205. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +18 -0
  206. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +22 -0
  207. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +13 -0
  208. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +29 -1
  209. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +19 -1
  210. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +24 -0
  211. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +28 -1
  212. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +24 -2
  213. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +39 -1
  214. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +25 -1
  215. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +14 -0
  216. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +14 -1
  217. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +14 -2
  218. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +19 -1
  219. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +19 -1
  220. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +20 -1
  221. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +40 -25
  222. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +40 -3
  223. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +19 -1
  224. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +18 -1
  225. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +18 -3
  226. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +18 -1
  227. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +18 -1
  228. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +19 -1
  229. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +19 -1
  230. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +3 -1
  231. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +9 -1
  232. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +4 -0
  233. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +11 -1
  234. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +22 -3
  235. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +5 -1
  236. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +6 -1
  237. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +9 -1
  238. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +9 -1
  239. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +6 -2
  240. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +9 -1
  241. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +5 -0
  242. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +10 -0
  243. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +3 -0
  244. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +2 -0
  245. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +3 -0
  246. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +11 -0
  247. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +3 -0
  248. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +4 -0
  249. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +4 -0
  250. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +4 -0
  251. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +2 -0
  252. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +3 -0
  253. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -138
  254. data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +21 -21
  255. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +32 -9
  256. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +1 -1
  257. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +12 -0
  258. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +21 -5
  259. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
  260. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
  261. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +10 -1
  262. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +10 -1
  263. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +9 -0
  264. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +9 -0
  265. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +11 -0
  266. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +9 -0
  267. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +11 -0
  268. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +11 -0
  269. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
  270. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
  271. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
  272. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +1 -1
  273. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +1 -1
  274. data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +6 -1
  275. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +2 -1
  276. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +1 -0
  277. data/ext/ffi_c/libffi.bsd.mk +2 -2
  278. data/ext/ffi_c/libffi.darwin.mk +2 -2
  279. data/ext/ffi_c/libffi.gnu.mk +2 -2
  280. data/ext/ffi_c/rbffi.h +1 -1
  281. data/ffi.gemspec +3 -3
  282. data/lib/ffi/autopointer.rb +8 -31
  283. data/lib/ffi/compat.rb +43 -0
  284. data/lib/ffi/data_converter.rb +2 -2
  285. data/lib/ffi/dynamic_library.rb +118 -0
  286. data/lib/ffi/enum.rb +18 -12
  287. data/lib/ffi/ffi.rb +3 -0
  288. data/lib/ffi/function.rb +71 -0
  289. data/lib/ffi/io.rb +2 -2
  290. data/lib/ffi/library.rb +72 -88
  291. data/lib/ffi/library_path.rb +109 -0
  292. data/lib/ffi/managedstruct.rb +1 -1
  293. data/lib/ffi/platform/aarch64-linux/types.conf +74 -3
  294. data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
  295. data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
  296. data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
  297. data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
  298. data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
  299. data/lib/ffi/platform.rb +15 -13
  300. data/lib/ffi/pointer.rb +6 -6
  301. data/lib/ffi/struct.rb +6 -5
  302. data/lib/ffi/struct_layout.rb +3 -3
  303. data/lib/ffi/struct_layout_builder.rb +9 -9
  304. data/lib/ffi/types.rb +65 -37
  305. data/lib/ffi/variadic.rb +19 -8
  306. data/lib/ffi/version.rb +1 -1
  307. data/samples/hello_ractor.rb +11 -0
  308. data/samples/qsort_ractor.rb +28 -0
  309. data/sig/ffi/abstract_memory.rbs +165 -0
  310. data/sig/ffi/auto_pointer.rbs +27 -0
  311. data/sig/ffi/buffer.rbs +18 -0
  312. data/sig/ffi/data_converter.rbs +10 -0
  313. data/sig/ffi/dynamic_library.rbs +9 -0
  314. data/sig/ffi/enum.rbs +38 -0
  315. data/sig/ffi/function.rbs +39 -0
  316. data/sig/ffi/library.rbs +42 -0
  317. data/sig/ffi/native_type.rbs +86 -0
  318. data/sig/ffi/pointer.rbs +42 -0
  319. data/sig/ffi/struct.rbs +76 -0
  320. data/sig/ffi/struct_by_reference.rbs +11 -0
  321. data/sig/ffi/struct_by_value.rbs +7 -0
  322. data/sig/ffi/struct_layout.rbs +9 -0
  323. data/sig/ffi/struct_layout_builder.rbs +5 -0
  324. data/sig/ffi/type.rbs +39 -0
  325. data/sig/ffi.rbs +26 -0
  326. data.tar.gz.sig +0 -0
  327. metadata +122 -28
  328. metadata.gz.sig +1 -0
  329. data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +0 -14
  330. data/ext/ffi_c/libffi/.travis/build.sh +0 -142
  331. data/ext/ffi_c/libffi/.travis.yml +0 -83
  332. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +0 -44
  333. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +0 -44
  334. /data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
  335. /data/ext/ffi_c/libffi/{.travis → .ci}/bfin-sim.exp +0 -0
  336. /data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
  337. /data/ext/ffi_c/libffi/{.travis → .ci}/m32r-sim.exp +0 -0
  338. /data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +0 -0
  339. /data/ext/ffi_c/libffi/{.travis → .ci}/or1k-sim.exp +0 -0
  340. /data/ext/ffi_c/libffi/{.travis → .ci}/powerpc-eabisim.exp +0 -0
  341. /data/ext/ffi_c/libffi/{.travis → .ci}/wine-sim.exp +0 -0
  342. /data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
  343. /data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +0 -0
@@ -0,0 +1,681 @@
1
+ /* -----------------------------------------------------------------------
2
+ hpux64.S - (c) 2005-2022 John David Anglin <dave.anglin@bell.net>
3
+
4
+ HPUX PA 64-Bit Foreign Function Interface
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ ``Software''), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included
15
+ in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
18
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
21
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ ----------------------------------------------------------------------- */
25
+
26
+ #define LIBFFI_ASM
27
+ #include <fficonfig.h>
28
+ #include <ffi.h>
29
+
30
+ .LEVEL 2.0w
31
+ .text
32
+ .align 4
33
+
34
+ /* void ffi_call_pa64(void (*)(char *, extended_cif *),
35
+ extended_cif *ecif,
36
+ unsigned bytes,
37
+ unsigned flags,
38
+ unsigned *rvalue,
39
+ void (*fn)());
40
+ */
41
+
42
+ .export ffi_call_pa64,code
43
+ .import ffi_prep_args_pa64,code
44
+
45
+ .align 4
46
+
47
+ L$FB1
48
+ ffi_call_pa64
49
+ .proc
50
+ .callinfo FRAME=48,CALLS,SAVE_RP,ENTRY_GR=4
51
+ .entry
52
+ std %rp, -16(%sp)
53
+ copy %r3, %r1
54
+ L$CFI11
55
+ copy %sp, %r3
56
+ L$CFI12
57
+ std,ma %r1, 48(%sp)
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
+ [ 48-byte register save area ]
65
+
66
+ [ Stack space for call arguments ] <- %r4
67
+
68
+ [ 16-byte rame marker ]
69
+
70
+ [ 128-byte stack for calling prep_args ] <- %sp
71
+ */
72
+
73
+ std %r4, 8(%r3) ; save r4
74
+ L$CFI13
75
+ std %r23, 16(%r3) ; save flags we need it later
76
+ std %r22, 24(%r3) ; save rvalue
77
+ std %r21, 32(%r3) ; save fn pointer
78
+
79
+ copy %sp, %r4
80
+ copy %r4, %r26 ; argument stack pointer
81
+ addl %r24, %sp, %sp ; allocate argument space
82
+
83
+ ldo 112(%sp), %r29 ; arg pointer for prep args
84
+
85
+ /* Call prep_args:
86
+ %arg0(stack) -- set up above to point to call arguments
87
+ %arg1(ecif) -- same as incoming param
88
+ %arg2(bytes) -- same as incoming param */
89
+ bl ffi_prep_args_pa64,%r2
90
+ ldo 128(%sp), %sp
91
+ ldo -128(%sp), %sp
92
+
93
+ /* Load the arguments that should be passed in registers
94
+ The fp args were loaded by the prep_args function. */
95
+ ldd 0(%r4), %r26
96
+ ldd 8(%r4), %r25
97
+ ldd 16(%r4), %r24
98
+ ldd 24(%r4), %r23
99
+ ldd 32(%r4), %r22
100
+ ldd 40(%r4), %r21
101
+ ldd 48(%r4), %r20
102
+ ldd 56(%r4), %r19
103
+
104
+ ldd 24(%r3), %ret0 ; %ret0 <- rvalue
105
+
106
+ ldd 32(%r3), %r1 ; %r1 <- function pointer
107
+ ldd 16(%r1), %rp ; fn address
108
+ ldd 24(%r1), %dp ; New gp
109
+ bve,l (%rp), %r2 ; Call the user function
110
+ ldo 64(%r4), %r29 ; Argument pointer
111
+
112
+ /* Prepare to store the result; recover flags and rvalue. */
113
+ ldd 16(%r3), %r21 ; r21 <- flags
114
+ extrd,s %r21, 63, 32, %r21 ; sign extend flags for blr
115
+
116
+ /* Adjust flags range from [-16, 15] to [0, 31]. */
117
+ addi 16, %r21, %r21
118
+
119
+ blr %r21, %r0
120
+ ldd 24(%r3), %r20 ; r20 <- rvalue
121
+
122
+ /* Giant jump table */
123
+ /* 16-byte small struct */
124
+ b,n L$smst16
125
+ nop
126
+ /* 15-byte small struct */
127
+ b,n L$smst15
128
+ nop
129
+ /* 14-byte small struct */
130
+ b,n L$smst14
131
+ nop
132
+ /* 13-byte small struct */
133
+ b,n L$smst13
134
+ nop
135
+ /* 12-byte small struct */
136
+ b,n L$smst12
137
+ nop
138
+ /* 11-byte small struct */
139
+ b,n L$smst11
140
+ nop
141
+ /* 10-byte small struct */
142
+ b,n L$smst10
143
+ nop
144
+ /* 9-byte small struct */
145
+ b,n L$smst9
146
+ nop
147
+ /* 8-byte small struct */
148
+ b,n L$smst8
149
+ nop
150
+ /* 7-byte small struct */
151
+ b,n L$smst7
152
+ nop
153
+ /* 6-byte small struct */
154
+ b,n L$smst6
155
+ nop
156
+ /* 5-byte small struct */
157
+ b,n L$smst5
158
+ nop
159
+ /* 4-byte small struct */
160
+ b,n L$smst4
161
+ nop
162
+ /* 3-byte small struct */
163
+ b,n L$smst3
164
+ nop
165
+ /* 2-byte small struct */
166
+ b,n L$smst2
167
+ nop
168
+ /* 1-byte small struct */
169
+ b,n L$smst1
170
+ nop
171
+ /* void */
172
+ b,n L$done
173
+ nop
174
+ /* int */
175
+ b L$done
176
+ std %ret0, 0(%r20)
177
+ /* float */
178
+ b L$done
179
+ fstw %fr4R, 0(%r20)
180
+ /* double */
181
+ b L$done
182
+ fstd %fr4, 0(%r20)
183
+ /* long double */
184
+ b,n L$longdouble
185
+ nop
186
+ /* unsigned int8 */
187
+ b L$done
188
+ std %ret0, 0(%r20)
189
+ /* signed int8 */
190
+ b L$done
191
+ std %ret0, 0(%r20)
192
+ /* unsigned int16 */
193
+ b L$done
194
+ std %ret0, 0(%r20)
195
+ /* signed int16 */
196
+ b L$done
197
+ std %ret0, 0(%r20)
198
+ /* unsigned int32 */
199
+ b L$done
200
+ std %ret0, 0(%r20)
201
+ /* signed int32 */
202
+ b L$done
203
+ std %ret0, 0(%r20)
204
+ /* unsigned int64 */
205
+ b L$done
206
+ std %ret0, 0(%r20)
207
+ /* signed int64 */
208
+ b L$done
209
+ std %ret0, 0(%r20)
210
+ /* large struct */
211
+ b,n L$done
212
+ nop
213
+ /* pointer */
214
+ b L$done
215
+ std %ret0, 0(%r20)
216
+ /* complex */
217
+ b,n L$done
218
+ nop
219
+
220
+ L$longdouble
221
+ std %ret0, 0(%r20)
222
+ b L$done
223
+ std %ret1, 8(%r20)
224
+
225
+ /* We need to copy byte-by-byte the exact number bytes
226
+ in the struct to avoid clobbering other data. */
227
+ L$smst1
228
+ extrd,u %ret0, 7, 8, %r22
229
+ b L$done
230
+ stb %r22, 0(%r20)
231
+
232
+ L$smst2
233
+ extrd,u %ret0, 7, 8, %r22
234
+ stb,ma %r22, 1(%r20)
235
+ extrd,u %ret0, 15, 8, %r22
236
+ b L$done
237
+ stb %r22, 0(%r20)
238
+
239
+ L$smst3
240
+ extrd,u %ret0, 7, 8, %r22
241
+ stb,ma %r22, 1(%r20)
242
+ extrd,u %ret0, 15, 8, %r22
243
+ stb,ma %r22, 1(%r20)
244
+ extrd,u %ret0, 23, 8, %r22
245
+ b L$done
246
+ stb %r22, 0(%r20)
247
+
248
+ L$smst4
249
+ extrd,u %ret0, 7, 8, %r22
250
+ stb,ma %r22, 1(%r20)
251
+ extrd,u %ret0, 15, 8, %r22
252
+ stb,ma %r22, 1(%r20)
253
+ extrd,u %ret0, 23, 8, %r22
254
+ stb,ma %r22, 1(%r20)
255
+ extrd,u %ret0, 31, 8, %r22
256
+ b L$done
257
+ stb %r22, 0(%r20)
258
+
259
+ L$smst5
260
+ extrd,u %ret0, 7, 8, %r22
261
+ stb,ma %r22, 1(%r20)
262
+ extrd,u %ret0, 15, 8, %r22
263
+ stb,ma %r22, 1(%r20)
264
+ extrd,u %ret0, 23, 8, %r22
265
+ stb,ma %r22, 1(%r20)
266
+ extrd,u %ret0, 31, 8, %r22
267
+ stb,ma %r22, 1(%r20)
268
+ extrd,u %ret0, 39, 8, %r22
269
+ b L$done
270
+ stb %r22, 0(%r20)
271
+
272
+ L$smst6
273
+ extrd,u %ret0, 7, 8, %r22
274
+ stb,ma %r22, 1(%r20)
275
+ extrd,u %ret0, 15, 8, %r22
276
+ stb,ma %r22, 1(%r20)
277
+ extrd,u %ret0, 23, 8, %r22
278
+ stb,ma %r22, 1(%r20)
279
+ extrd,u %ret0, 31, 8, %r22
280
+ stb,ma %r22, 1(%r20)
281
+ extrd,u %ret0, 39, 8, %r22
282
+ stb,ma %r22, 1(%r20)
283
+ extrd,u %ret0, 47, 8, %r22
284
+ b L$done
285
+ stb %r22, 0(%r20)
286
+
287
+ L$smst7
288
+ extrd,u %ret0, 7, 8, %r22
289
+ stb,ma %r22, 1(%r20)
290
+ extrd,u %ret0, 15, 8, %r22
291
+ stb,ma %r22, 1(%r20)
292
+ extrd,u %ret0, 23, 8, %r22
293
+ stb,ma %r22, 1(%r20)
294
+ extrd,u %ret0, 31, 8, %r22
295
+ stb,ma %r22, 1(%r20)
296
+ extrd,u %ret0, 39, 8, %r22
297
+ stb,ma %r22, 1(%r20)
298
+ extrd,u %ret0, 47, 8, %r22
299
+ stb,ma %r22, 1(%r20)
300
+ extrd,u %ret0, 55, 8, %r22
301
+ b L$done
302
+ stb %r22, 0(%r20)
303
+
304
+ L$smst8
305
+ extrd,u %ret0, 7, 8, %r22
306
+ stb,ma %r22, 1(%r20)
307
+ extrd,u %ret0, 15, 8, %r22
308
+ stb,ma %r22, 1(%r20)
309
+ extrd,u %ret0, 23, 8, %r22
310
+ stb,ma %r22, 1(%r20)
311
+ extrd,u %ret0, 31, 8, %r22
312
+ stb,ma %r22, 1(%r20)
313
+ extrd,u %ret0, 39, 8, %r22
314
+ stb,ma %r22, 1(%r20)
315
+ extrd,u %ret0, 47, 8, %r22
316
+ stb,ma %r22, 1(%r20)
317
+ extrd,u %ret0, 55, 8, %r22
318
+ stb,ma %r22, 1(%r20)
319
+ b L$done
320
+ stb %ret0, 0(%r20)
321
+
322
+ L$smst9
323
+ extrd,u %ret0, 7, 8, %r22
324
+ stb,ma %r22, 1(%r20)
325
+ extrd,u %ret0, 15, 8, %r22
326
+ stb,ma %r22, 1(%r20)
327
+ extrd,u %ret0, 23, 8, %r22
328
+ stb,ma %r22, 1(%r20)
329
+ extrd,u %ret0, 31, 8, %r22
330
+ stb,ma %r22, 1(%r20)
331
+ extrd,u %ret0, 39, 8, %r22
332
+ stb,ma %r22, 1(%r20)
333
+ extrd,u %ret0, 47, 8, %r22
334
+ stb,ma %r22, 1(%r20)
335
+ extrd,u %ret0, 55, 8, %r22
336
+ stb,ma %r22, 1(%r20)
337
+ stb,ma %ret0, 1(%r20)
338
+ extrd,u %ret1, 7, 8, %r22
339
+ b L$done
340
+ stb %r22, 0(%r20)
341
+
342
+ L$smst10
343
+ extrd,u %ret0, 7, 8, %r22
344
+ stb,ma %r22, 1(%r20)
345
+ extrd,u %ret0, 15, 8, %r22
346
+ stb,ma %r22, 1(%r20)
347
+ extrd,u %ret0, 23, 8, %r22
348
+ stb,ma %r22, 1(%r20)
349
+ extrd,u %ret0, 31, 8, %r22
350
+ stb,ma %r22, 1(%r20)
351
+ extrd,u %ret0, 39, 8, %r22
352
+ stb,ma %r22, 1(%r20)
353
+ extrd,u %ret0, 47, 8, %r22
354
+ stb,ma %r22, 1(%r20)
355
+ extrd,u %ret0, 55, 8, %r22
356
+ stb,ma %r22, 1(%r20)
357
+ stb,ma %ret0, 1(%r20)
358
+ extrd,u %ret1, 7, 8, %r22
359
+ stb,ma %r22, 1(%r20)
360
+ extrd,u %ret1, 15, 8, %r22
361
+ b L$done
362
+ stb %r22, 0(%r20)
363
+
364
+ L$smst11
365
+ extrd,u %ret0, 7, 8, %r22
366
+ stb,ma %r22, 1(%r20)
367
+ extrd,u %ret0, 15, 8, %r22
368
+ stb,ma %r22, 1(%r20)
369
+ extrd,u %ret0, 23, 8, %r22
370
+ stb,ma %r22, 1(%r20)
371
+ extrd,u %ret0, 31, 8, %r22
372
+ stb,ma %r22, 1(%r20)
373
+ extrd,u %ret0, 39, 8, %r22
374
+ stb,ma %r22, 1(%r20)
375
+ extrd,u %ret0, 47, 8, %r22
376
+ stb,ma %r22, 1(%r20)
377
+ extrd,u %ret0, 55, 8, %r22
378
+ stb,ma %r22, 1(%r20)
379
+ stb,ma %ret0, 1(%r20)
380
+ extrd,u %ret1, 7, 8, %r22
381
+ stb,ma %r22, 1(%r20)
382
+ extrd,u %ret1, 15, 8, %r22
383
+ stb,ma %r22, 1(%r20)
384
+ extrd,u %ret1, 23, 8, %r22
385
+ b L$done
386
+ stb %r22, 0(%r20)
387
+
388
+ L$smst12
389
+ extrd,u %ret0, 7, 8, %r22
390
+ stb,ma %r22, 1(%r20)
391
+ extrd,u %ret0, 15, 8, %r22
392
+ stb,ma %r22, 1(%r20)
393
+ extrd,u %ret0, 23, 8, %r22
394
+ stb,ma %r22, 1(%r20)
395
+ extrd,u %ret0, 31, 8, %r22
396
+ stb,ma %r22, 1(%r20)
397
+ extrd,u %ret0, 39, 8, %r22
398
+ stb,ma %r22, 1(%r20)
399
+ extrd,u %ret0, 47, 8, %r22
400
+ stb,ma %r22, 1(%r20)
401
+ extrd,u %ret0, 55, 8, %r22
402
+ stb,ma %r22, 1(%r20)
403
+ stb,ma %ret0, 1(%r20)
404
+ extrd,u %ret1, 7, 8, %r22
405
+ stb,ma %r22, 1(%r20)
406
+ extrd,u %ret1, 15, 8, %r22
407
+ stb,ma %r22, 1(%r20)
408
+ extrd,u %ret1, 23, 8, %r22
409
+ stb,ma %r22, 1(%r20)
410
+ extrd,u %ret1, 31, 8, %r22
411
+ b L$done
412
+ stb %r22, 0(%r20)
413
+
414
+ L$smst13
415
+ extrd,u %ret0, 7, 8, %r22
416
+ stb,ma %r22, 1(%r20)
417
+ extrd,u %ret0, 15, 8, %r22
418
+ stb,ma %r22, 1(%r20)
419
+ extrd,u %ret0, 23, 8, %r22
420
+ stb,ma %r22, 1(%r20)
421
+ extrd,u %ret0, 31, 8, %r22
422
+ stb,ma %r22, 1(%r20)
423
+ extrd,u %ret0, 39, 8, %r22
424
+ stb,ma %r22, 1(%r20)
425
+ extrd,u %ret0, 47, 8, %r22
426
+ stb,ma %r22, 1(%r20)
427
+ extrd,u %ret0, 55, 8, %r22
428
+ stb,ma %r22, 1(%r20)
429
+ stb,ma %ret0, 1(%r20)
430
+ extrd,u %ret1, 7, 8, %r22
431
+ stb,ma %r22, 1(%r20)
432
+ extrd,u %ret1, 15, 8, %r22
433
+ stb,ma %r22, 1(%r20)
434
+ extrd,u %ret1, 23, 8, %r22
435
+ stb,ma %r22, 1(%r20)
436
+ extrd,u %ret1, 31, 8, %r22
437
+ stb,ma %r22, 1(%r20)
438
+ extrd,u %ret1, 39, 8, %r22
439
+ b L$done
440
+ stb %r22, 0(%r20)
441
+
442
+ L$smst14
443
+ extrd,u %ret0, 7, 8, %r22
444
+ stb,ma %r22, 1(%r20)
445
+ extrd,u %ret0, 15, 8, %r22
446
+ stb,ma %r22, 1(%r20)
447
+ extrd,u %ret0, 23, 8, %r22
448
+ stb,ma %r22, 1(%r20)
449
+ extrd,u %ret0, 31, 8, %r22
450
+ stb,ma %r22, 1(%r20)
451
+ extrd,u %ret0, 39, 8, %r22
452
+ stb,ma %r22, 1(%r20)
453
+ extrd,u %ret0, 47, 8, %r22
454
+ stb,ma %r22, 1(%r20)
455
+ extrd,u %ret0, 55, 8, %r22
456
+ stb,ma %r22, 1(%r20)
457
+ stb,ma %ret0, 1(%r20)
458
+ extrd,u %ret1, 7, 8, %r22
459
+ stb,ma %r22, 1(%r20)
460
+ extrd,u %ret1, 15, 8, %r22
461
+ stb,ma %r22, 1(%r20)
462
+ extrd,u %ret1, 23, 8, %r22
463
+ stb,ma %r22, 1(%r20)
464
+ extrd,u %ret1, 31, 8, %r22
465
+ stb,ma %r22, 1(%r20)
466
+ extrd,u %ret1, 39, 8, %r22
467
+ stb,ma %r22, 1(%r20)
468
+ extrd,u %ret1, 47, 8, %r22
469
+ b L$done
470
+ stb %r22, 0(%r20)
471
+
472
+ L$smst15
473
+ extrd,u %ret0, 7, 8, %r22
474
+ stb,ma %r22, 1(%r20)
475
+ extrd,u %ret0, 15, 8, %r22
476
+ stb,ma %r22, 1(%r20)
477
+ extrd,u %ret0, 23, 8, %r22
478
+ stb,ma %r22, 1(%r20)
479
+ extrd,u %ret0, 31, 8, %r22
480
+ stb,ma %r22, 1(%r20)
481
+ extrd,u %ret0, 39, 8, %r22
482
+ stb,ma %r22, 1(%r20)
483
+ extrd,u %ret0, 47, 8, %r22
484
+ stb,ma %r22, 1(%r20)
485
+ extrd,u %ret0, 55, 8, %r22
486
+ stb,ma %r22, 1(%r20)
487
+ stb,ma %ret0, 1(%r20)
488
+ extrd,u %ret1, 7, 8, %r22
489
+ stb,ma %r22, 1(%r20)
490
+ extrd,u %ret1, 15, 8, %r22
491
+ stb,ma %r22, 1(%r20)
492
+ extrd,u %ret1, 23, 8, %r22
493
+ stb,ma %r22, 1(%r20)
494
+ extrd,u %ret1, 31, 8, %r22
495
+ stb,ma %r22, 1(%r20)
496
+ extrd,u %ret1, 39, 8, %r22
497
+ stb,ma %r22, 1(%r20)
498
+ extrd,u %ret1, 47, 8, %r22
499
+ stb,ma %r22, 1(%r20)
500
+ extrd,u %ret1, 55, 8, %r22
501
+ b L$done
502
+ stb %r22, 0(%r20)
503
+
504
+ L$smst16
505
+ extrd,u %ret0, 7, 8, %r22
506
+ stb,ma %r22, 1(%r20)
507
+ extrd,u %ret0, 15, 8, %r22
508
+ stb,ma %r22, 1(%r20)
509
+ extrd,u %ret0, 23, 8, %r22
510
+ stb,ma %r22, 1(%r20)
511
+ extrd,u %ret0, 31, 8, %r22
512
+ stb,ma %r22, 1(%r20)
513
+ extrd,u %ret0, 39, 8, %r22
514
+ stb,ma %r22, 1(%r20)
515
+ extrd,u %ret0, 47, 8, %r22
516
+ stb,ma %r22, 1(%r20)
517
+ extrd,u %ret0, 55, 8, %r22
518
+ stb,ma %r22, 1(%r20)
519
+ stb,ma %ret0, 1(%r20)
520
+ extrd,u %ret1, 7, 8, %r22
521
+ stb,ma %r22, 1(%r20)
522
+ extrd,u %ret1, 15, 8, %r22
523
+ stb,ma %r22, 1(%r20)
524
+ extrd,u %ret1, 23, 8, %r22
525
+ stb,ma %r22, 1(%r20)
526
+ extrd,u %ret1, 31, 8, %r22
527
+ stb,ma %r22, 1(%r20)
528
+ extrd,u %ret1, 39, 8, %r22
529
+ stb,ma %r22, 1(%r20)
530
+ extrd,u %ret1, 47, 8, %r22
531
+ stb,ma %r22, 1(%r20)
532
+ extrd,u %ret1, 55, 8, %r22
533
+ stb,ma %r22, 1(%r20)
534
+ stb %ret1, 0(%r20)
535
+
536
+ L$done
537
+ /* all done, restore registers and return */
538
+ copy %r4, %sp
539
+ ldd 8(%r3), %r4
540
+ ldd -16(%r3), %rp
541
+ bve (%rp)
542
+ ldd,mb -48(%sp), %r3
543
+ .exit
544
+ .procend
545
+ L$FE1
546
+ .size ffi_call_pa64, .-ffi_call_pa64
547
+
548
+ /* void ffi_closure_pa64(void);
549
+ Called with closure argument in %r21 */
550
+
551
+ .export ffi_closure_pa64,code
552
+ .import ffi_closure_inner_pa64,code
553
+ .align 4
554
+ L$FB2
555
+ ffi_closure_pa64
556
+ .proc
557
+ .callinfo FRAME=128,CALLS,SAVE_RP,ENTRY_GR=3
558
+ .entry
559
+
560
+ std %rp, -16(%sp)
561
+ copy %r3, %r1
562
+ L$CFI21
563
+ copy %sp, %r3
564
+ L$CFI22
565
+ std,ma %r1, 128(%sp)
566
+ L$CFI23
567
+
568
+ /* Put arguments onto the stack and call ffi_closure_inner. */
569
+ std %r26, -64(%r29)
570
+ std %r25, -56(%r29)
571
+ std %r24, -48(%r29)
572
+ std %r23, -40(%r29)
573
+ std %r22, -32(%r29)
574
+ std %r21, -24(%r29)
575
+ std %r20, -16(%r29)
576
+ std %r19, -8(%r29)
577
+
578
+ /* Load and save start of argument stack. */
579
+ ldo -64(%r29), %r25
580
+ std %r25, 8(%r3)
581
+
582
+ /* Setup arg pointer. */
583
+ ldo -16(%sp), %ret1
584
+
585
+ /* Retrieve closure pointer and real gp. */
586
+ copy %dp, %r26
587
+ bl ffi_closure_inner_pa64, %r2
588
+ ldd 0(%dp), %dp
589
+
590
+ /* Retrieve start of argument stack. */
591
+ ldd 8(%r3), %r1
592
+
593
+ /* Restore r3 and op stack. */
594
+ ldd,mb -128(%sp), %r3
595
+
596
+ /* Load return address. */
597
+ ldd -16(%sp), %rp
598
+
599
+ /* Load return values from first and second stack slots. */
600
+ ldd 0(%r1), %ret0
601
+ bve (%rp)
602
+ ldd 8(%r1), %ret1
603
+
604
+ .exit
605
+ .procend
606
+ .end
607
+ L$FE2:
608
+ .size ffi_closure_pa64, .-ffi_closure_pa64
609
+
610
+ .section .eh_frame,"aw",@progbits
611
+ L$frame1:
612
+ .word L$ECIE1-L$SCIE1 ;# Length of Common Information Entry
613
+ L$SCIE1:
614
+ .word 0x0 ;# CIE Identifier Tag
615
+ .byte 0x3 ;# CIE Version
616
+ .stringz "" ;# CIE Augmentation
617
+ .uleb128 0x1 ;# CIE Code Alignment Factor
618
+ .sleb128 8 ;# CIE Data Alignment Factor
619
+ .byte 0x2 ;# CIE RA Column
620
+ .byte 0xc ;# DW_CFA_def_cfa
621
+ .uleb128 0x1e
622
+ .uleb128 0x0
623
+ .align 8
624
+ L$ECIE1:
625
+ L$SFDE1:
626
+ .word L$EFDE1-L$ASFDE1 ;# FDE Length
627
+ L$ASFDE1:
628
+ .word L$ASFDE1-L$frame1 ;# FDE CIE offset
629
+ .dword L$FB1 ;# FDE initial location
630
+ .dword L$FE1-L$FB1 ;# FDE address range
631
+
632
+ .byte 0x4 ;# DW_CFA_advance_loc4
633
+ .word L$CFI11-L$FB1
634
+ .byte 0x9 ;# DW_CFA_register: r3 in r1
635
+ .uleb128 0x3
636
+ .uleb128 0x1
637
+ .byte 0x11 ;# DW_CFA_offset_extended_sf: r2 at cfa-16
638
+ .uleb128 0x2
639
+ .sleb128 -2
640
+ .byte 0x4 ;# DW_CFA_advance_loc4
641
+ .word L$CFI12-L$CFI11
642
+ .byte 0xd ;# DW_CFA_def_cfa_register: r3
643
+ .uleb128 0x3
644
+
645
+ .byte 0x4 ;# DW_CFA_advance_loc4
646
+ .word L$CFI13-L$CFI12
647
+ .byte 0x83 ;# DW_CFA_offset: r3 at cfa+0
648
+ .uleb128 0
649
+ .byte 0x84 ;# DW_CFA_offset: r4 at cfa+8
650
+ .uleb128 1
651
+
652
+ .align 8
653
+ L$EFDE1:
654
+
655
+ L$SFDE2:
656
+ .word L$EFDE2-L$ASFDE2 ;# FDE Length
657
+ L$ASFDE2:
658
+ .word L$ASFDE2-L$frame1 ;# FDE CIE offset
659
+ .dword L$FB2 ;# FDE initial location
660
+ .dword L$FE2-L$FB2 ;# FDE address range
661
+ .byte 0x4 ;# DW_CFA_advance_loc4
662
+ .word L$CFI21-L$FB2
663
+ .byte 0x9 ;# DW_CFA_register: r3 in r1
664
+ .uleb128 0x3
665
+ .uleb128 0x1
666
+ .byte 0x11 ;# DW_CFA_offset_extended_sf: r2 at cfa-16
667
+ .uleb128 0x2
668
+ .sleb128 -2
669
+
670
+ .byte 0x4 ;# DW_CFA_advance_loc4
671
+ .word L$CFI22-L$CFI21
672
+ .byte 0xd ;# DW_CFA_def_cfa_register: r3
673
+ .uleb128 0x3
674
+
675
+ .byte 0x4 ;# DW_CFA_advance_loc4
676
+ .word L$CFI23-L$CFI22
677
+ .byte 0x83 ;# DW_CFA_offset: r3 at cfa+0
678
+ .uleb128 0
679
+
680
+ .align 8
681
+ L$EFDE2: