minilab 1.1.0-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (492) hide show
  1. data/CHANGES +8 -0
  2. data/LICENSE +19 -0
  3. data/README +105 -0
  4. data/Rakefile +83 -0
  5. data/config/environment.rb +23 -0
  6. data/config/objects.yml +23 -0
  7. data/lib/analog_io.rb +23 -0
  8. data/lib/connection_state.rb +13 -0
  9. data/lib/digital_auxport_io.rb +34 -0
  10. data/lib/digital_configuration.rb +53 -0
  11. data/lib/digital_port_io.rb +39 -0
  12. data/lib/library_translator.rb +46 -0
  13. data/lib/minilab.rb +130 -0
  14. data/lib/minilab_constants.rb +20 -0
  15. data/lib/minilab_context.rb +14 -0
  16. data/lib/minilab_hardware.rb +112 -0
  17. data/lib/minilab_wrapper.rb +12 -0
  18. data/test/system/analog_input.test +3 -0
  19. data/test/system/analog_output.test +37 -0
  20. data/test/system/digital_port_input.test +5 -0
  21. data/test/system/digital_port_output.test +39 -0
  22. data/test/system/digital_port_read_byte.test +26 -0
  23. data/test/system/digital_screw_terminals_input.test +2 -0
  24. data/test/system/digital_screw_terminals_output.test +11 -0
  25. data/test/system/minilab_driver.rb +83 -0
  26. data/test/test_helper.rb +15 -0
  27. data/test/unit/analog_io_test.rb +54 -0
  28. data/test/unit/connection_state_test.rb +18 -0
  29. data/test/unit/digital_auxport_io_test.rb +102 -0
  30. data/test/unit/digital_configuration_test.rb +100 -0
  31. data/test/unit/digital_port_io_test.rb +67 -0
  32. data/test/unit/library_translator_test.rb +98 -0
  33. data/test/unit/minilab_context_test.rb +23 -0
  34. data/test/unit/minilab_hardware_test.rb +33 -0
  35. data/test/unit/minilab_test.rb +115 -0
  36. data/test/unit/minilab_wrapper_test.rb +24 -0
  37. data/vendor/behaviors/lib/behaviors.rb +50 -0
  38. data/vendor/behaviors/tasks/behaviors_tasks.rake +140 -0
  39. data/vendor/behaviors/test/behaviors_tasks_test.rb +71 -0
  40. data/vendor/behaviors/test/behaviors_test.rb +50 -0
  41. data/vendor/behaviors/test/tasks_test/Rakefile +16 -0
  42. data/vendor/behaviors/test/tasks_test/doc/behaviors.html +55 -0
  43. data/vendor/behaviors/test/tasks_test/lib/user.rb +2 -0
  44. data/vendor/behaviors/test/tasks_test/test/user_test.rb +17 -0
  45. data/vendor/constructor-1.0.2/History.txt +11 -0
  46. data/vendor/constructor-1.0.2/Manifest.txt +6 -0
  47. data/vendor/constructor-1.0.2/README.txt +77 -0
  48. data/vendor/constructor-1.0.2/Rakefile +33 -0
  49. data/vendor/constructor-1.0.2/lib/constructor.rb +119 -0
  50. data/vendor/constructor-1.0.2/specs/constructor_spec.rb +345 -0
  51. data/vendor/diy-1.1.1/History.txt +23 -0
  52. data/vendor/diy-1.1.1/Manifest.txt +88 -0
  53. data/vendor/diy-1.1.1/README.txt +220 -0
  54. data/vendor/diy-1.1.1/Rakefile +29 -0
  55. data/vendor/diy-1.1.1/TODO.txt +9 -0
  56. data/vendor/diy-1.1.1/homepage/Notes.txt +27 -0
  57. data/vendor/diy-1.1.1/homepage/Rakefile +14 -0
  58. data/vendor/diy-1.1.1/homepage/diy_example.png +0 -0
  59. data/vendor/diy-1.1.1/homepage/index.erb +36 -0
  60. data/vendor/diy-1.1.1/homepage/index.html +45 -0
  61. data/vendor/diy-1.1.1/homepage/objects_yml.png +0 -0
  62. data/vendor/diy-1.1.1/homepage/page_header.graffle +0 -0
  63. data/vendor/diy-1.1.1/homepage/page_header.html +9 -0
  64. data/vendor/diy-1.1.1/homepage/page_header.png +0 -0
  65. data/vendor/diy-1.1.1/lib/diy.rb +365 -0
  66. data/vendor/diy-1.1.1/sample_code/car.rb +7 -0
  67. data/vendor/diy-1.1.1/sample_code/chassis.rb +5 -0
  68. data/vendor/diy-1.1.1/sample_code/diy_example.rb +26 -0
  69. data/vendor/diy-1.1.1/sample_code/engine.rb +5 -0
  70. data/vendor/diy-1.1.1/sample_code/objects.yml +10 -0
  71. data/vendor/diy-1.1.1/test/constructor.rb +119 -0
  72. data/vendor/diy-1.1.1/test/diy_test.rb +604 -0
  73. data/vendor/diy-1.1.1/test/files/broken_construction.yml +7 -0
  74. data/vendor/diy-1.1.1/test/files/cat/cat.rb +3 -0
  75. data/vendor/diy-1.1.1/test/files/cat/extra_conflict.yml +5 -0
  76. data/vendor/diy-1.1.1/test/files/cat/heritage.rb +2 -0
  77. data/vendor/diy-1.1.1/test/files/cat/needs_input.yml +3 -0
  78. data/vendor/diy-1.1.1/test/files/cat/the_cat_lineage.rb +1 -0
  79. data/vendor/diy-1.1.1/test/files/dog/dog_model.rb +3 -0
  80. data/vendor/diy-1.1.1/test/files/dog/dog_presenter.rb +3 -0
  81. data/vendor/diy-1.1.1/test/files/dog/dog_view.rb +2 -0
  82. data/vendor/diy-1.1.1/test/files/dog/file_resolver.rb +2 -0
  83. data/vendor/diy-1.1.1/test/files/dog/other_thing.rb +2 -0
  84. data/vendor/diy-1.1.1/test/files/dog/simple.yml +11 -0
  85. data/vendor/diy-1.1.1/test/files/donkey/foo.rb +8 -0
  86. data/vendor/diy-1.1.1/test/files/donkey/foo/bar/qux.rb +7 -0
  87. data/vendor/diy-1.1.1/test/files/fud/objects.yml +13 -0
  88. data/vendor/diy-1.1.1/test/files/fud/toy.rb +14 -0
  89. data/vendor/diy-1.1.1/test/files/functions/invalid_method.yml +5 -0
  90. data/vendor/diy-1.1.1/test/files/functions/method_extractor.rb +3 -0
  91. data/vendor/diy-1.1.1/test/files/functions/nonsingleton_objects.yml +6 -0
  92. data/vendor/diy-1.1.1/test/files/functions/objects.yml +11 -0
  93. data/vendor/diy-1.1.1/test/files/functions/thing.rb +3 -0
  94. data/vendor/diy-1.1.1/test/files/functions/thing_builder.rb +21 -0
  95. data/vendor/diy-1.1.1/test/files/functions/things_builder.rb +3 -0
  96. data/vendor/diy-1.1.1/test/files/gnu/objects.yml +14 -0
  97. data/vendor/diy-1.1.1/test/files/gnu/thinger.rb +7 -0
  98. data/vendor/diy-1.1.1/test/files/goat/base.rb +8 -0
  99. data/vendor/diy-1.1.1/test/files/goat/can.rb +6 -0
  100. data/vendor/diy-1.1.1/test/files/goat/goat.rb +6 -0
  101. data/vendor/diy-1.1.1/test/files/goat/objects.yml +12 -0
  102. data/vendor/diy-1.1.1/test/files/goat/paper.rb +6 -0
  103. data/vendor/diy-1.1.1/test/files/goat/plane.rb +7 -0
  104. data/vendor/diy-1.1.1/test/files/goat/shirt.rb +6 -0
  105. data/vendor/diy-1.1.1/test/files/goat/wings.rb +8 -0
  106. data/vendor/diy-1.1.1/test/files/horse/holder_thing.rb +3 -0
  107. data/vendor/diy-1.1.1/test/files/horse/objects.yml +7 -0
  108. data/vendor/diy-1.1.1/test/files/namespace/animal/bird.rb +5 -0
  109. data/vendor/diy-1.1.1/test/files/namespace/animal/cat.rb +5 -0
  110. data/vendor/diy-1.1.1/test/files/namespace/animal/reptile/hardshell/turtle.rb +8 -0
  111. data/vendor/diy-1.1.1/test/files/namespace/animal/reptile/lizard.rb +7 -0
  112. data/vendor/diy-1.1.1/test/files/namespace/bad_module_specified.yml +8 -0
  113. data/vendor/diy-1.1.1/test/files/namespace/class_name_combine.yml +8 -0
  114. data/vendor/diy-1.1.1/test/files/namespace/hello.txt +1 -0
  115. data/vendor/diy-1.1.1/test/files/namespace/no_module_specified.yml +8 -0
  116. data/vendor/diy-1.1.1/test/files/namespace/objects.yml +21 -0
  117. data/vendor/diy-1.1.1/test/files/namespace/road.rb +2 -0
  118. data/vendor/diy-1.1.1/test/files/namespace/sky.rb +2 -0
  119. data/vendor/diy-1.1.1/test/files/namespace/subcontext.yml +22 -0
  120. data/vendor/diy-1.1.1/test/files/non_singleton/air.rb +2 -0
  121. data/vendor/diy-1.1.1/test/files/non_singleton/fat_cat.rb +3 -0
  122. data/vendor/diy-1.1.1/test/files/non_singleton/objects.yml +19 -0
  123. data/vendor/diy-1.1.1/test/files/non_singleton/pig.rb +3 -0
  124. data/vendor/diy-1.1.1/test/files/non_singleton/thread_spinner.rb +3 -0
  125. data/vendor/diy-1.1.1/test/files/non_singleton/tick.rb +3 -0
  126. data/vendor/diy-1.1.1/test/files/non_singleton/yard.rb +2 -0
  127. data/vendor/diy-1.1.1/test/files/yak/core_model.rb +3 -0
  128. data/vendor/diy-1.1.1/test/files/yak/core_presenter.rb +3 -0
  129. data/vendor/diy-1.1.1/test/files/yak/core_view.rb +1 -0
  130. data/vendor/diy-1.1.1/test/files/yak/data_source.rb +1 -0
  131. data/vendor/diy-1.1.1/test/files/yak/fringe_model.rb +3 -0
  132. data/vendor/diy-1.1.1/test/files/yak/fringe_presenter.rb +3 -0
  133. data/vendor/diy-1.1.1/test/files/yak/fringe_view.rb +1 -0
  134. data/vendor/diy-1.1.1/test/files/yak/giant_squid.rb +3 -0
  135. data/vendor/diy-1.1.1/test/files/yak/krill.rb +2 -0
  136. data/vendor/diy-1.1.1/test/files/yak/my_objects.yml +21 -0
  137. data/vendor/diy-1.1.1/test/files/yak/sub_sub_context_test.yml +27 -0
  138. data/vendor/diy-1.1.1/test/test_helper.rb +39 -0
  139. data/vendor/ffi-0.4.0-x86-mswin32/LICENSE +51 -0
  140. data/vendor/ffi-0.4.0-x86-mswin32/Rakefile +142 -0
  141. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/AbstractMemory.c +412 -0
  142. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/AbstractMemory.h +68 -0
  143. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/AutoPointer.c +60 -0
  144. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/AutoPointer.h +18 -0
  145. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Buffer.c +171 -0
  146. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Callback.c +374 -0
  147. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Callback.h +47 -0
  148. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/DynamicLibrary.c +213 -0
  149. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/DynamicLibrary.h +22 -0
  150. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Invoker.c +962 -0
  151. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/LastError.c +135 -0
  152. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/LastError.h +18 -0
  153. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/MemoryPointer.c +156 -0
  154. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/MemoryPointer.h +20 -0
  155. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/NullPointer.c +143 -0
  156. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Platform.c +59 -0
  157. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Platform.h +16 -0
  158. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Pointer.c +164 -0
  159. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Pointer.h +25 -0
  160. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Struct.c +477 -0
  161. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Struct.h +26 -0
  162. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Type.c +230 -0
  163. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Type.h +28 -0
  164. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Types.c +118 -0
  165. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/Types.h +54 -0
  166. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/compat.h +22 -0
  167. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/endian.h +40 -0
  168. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/extconf.rb +31 -0
  169. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/ffi.c +76 -0
  170. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi.bsd.mk +34 -0
  171. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi.darwin.mk +75 -0
  172. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi.gnu.mk +29 -0
  173. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi.mk +13 -0
  174. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ChangeLog +3243 -0
  175. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ChangeLog.libffi +347 -0
  176. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ChangeLog.libgcj +40 -0
  177. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ChangeLog.v1 +764 -0
  178. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/LICENSE +21 -0
  179. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/Makefile.am +177 -0
  180. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/Makefile.in +1640 -0
  181. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/README +328 -0
  182. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/TODO +1 -0
  183. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/acinclude.m4 +92 -0
  184. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/aclocal.m4 +7516 -0
  185. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/compile +142 -0
  186. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/config.guess +1516 -0
  187. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/config.sub +1626 -0
  188. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/configure +24414 -0
  189. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/configure.ac +365 -0
  190. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/configure.host +11 -0
  191. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/depcomp +584 -0
  192. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/doc/libffi.info +533 -0
  193. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/doc/libffi.texi +541 -0
  194. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/doc/stamp-vti +4 -0
  195. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/doc/version.texi +4 -0
  196. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/fficonfig.h.in +160 -0
  197. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/include/Makefile.am +9 -0
  198. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/include/Makefile.in +422 -0
  199. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/include/ffi.h.in +393 -0
  200. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/include/ffi_common.h +98 -0
  201. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/install-sh +323 -0
  202. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/libffi.pc.in +10 -0
  203. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/libtool-version +29 -0
  204. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ltcf-c.sh +861 -0
  205. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ltcf-cxx.sh +1069 -0
  206. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ltcf-gcj.sh +700 -0
  207. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ltconfig +2862 -0
  208. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/ltmain.sh +6930 -0
  209. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/man/Makefile.am +8 -0
  210. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/man/Makefile.in +395 -0
  211. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/man/ffi.3 +31 -0
  212. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/man/ffi_call.3 +103 -0
  213. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/man/ffi_prep_cif.3 +66 -0
  214. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/mdate-sh +201 -0
  215. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/missing +353 -0
  216. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/mkinstalldirs +158 -0
  217. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/alpha/ffi.c +284 -0
  218. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/alpha/ffitarget.h +48 -0
  219. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/alpha/osf.S +366 -0
  220. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/arm/ffi.c +309 -0
  221. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/arm/ffitarget.h +49 -0
  222. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/arm/sysv.S +299 -0
  223. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/closures.c +596 -0
  224. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/cris/ffi.c +383 -0
  225. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/cris/ffitarget.h +51 -0
  226. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/cris/sysv.S +215 -0
  227. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/debug.c +59 -0
  228. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/dlmalloc.c +5099 -0
  229. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/frv/eabi.S +128 -0
  230. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/frv/ffi.c +292 -0
  231. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/frv/ffitarget.h +61 -0
  232. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/ia64/ffi.c +580 -0
  233. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/ia64/ffitarget.h +50 -0
  234. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/ia64/ia64_flags.h +40 -0
  235. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/ia64/unix.S +560 -0
  236. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/java_raw_api.c +359 -0
  237. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/m32r/ffi.c +232 -0
  238. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/m32r/ffitarget.h +48 -0
  239. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/m32r/sysv.S +121 -0
  240. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/m68k/ffi.c +278 -0
  241. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/m68k/ffitarget.h +49 -0
  242. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/m68k/sysv.S +234 -0
  243. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/mips/ffi.c +926 -0
  244. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/mips/ffitarget.h +202 -0
  245. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/mips/n32.S +534 -0
  246. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/mips/o32.S +381 -0
  247. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/pa/ffi.c +709 -0
  248. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/pa/ffitarget.h +77 -0
  249. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/pa/hpux32.S +368 -0
  250. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/pa/linux.S +357 -0
  251. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/aix.S +225 -0
  252. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/aix_closure.S +247 -0
  253. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/asm.h +125 -0
  254. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/darwin.S +245 -0
  255. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +317 -0
  256. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/ffi.c +1429 -0
  257. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +800 -0
  258. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/ffitarget.h +118 -0
  259. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/linux64.S +187 -0
  260. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +236 -0
  261. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +327 -0
  262. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/powerpc/sysv.S +230 -0
  263. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/prep_cif.c +174 -0
  264. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/raw_api.c +254 -0
  265. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/s390/ffi.c +780 -0
  266. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/s390/ffitarget.h +60 -0
  267. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/s390/sysv.S +434 -0
  268. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sh/ffi.c +716 -0
  269. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sh/ffitarget.h +49 -0
  270. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sh/sysv.S +850 -0
  271. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sh64/ffi.c +453 -0
  272. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sh64/ffitarget.h +53 -0
  273. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sh64/sysv.S +530 -0
  274. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sparc/ffi.c +610 -0
  275. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sparc/ffitarget.h +66 -0
  276. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sparc/v8.S +272 -0
  277. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/sparc/v9.S +307 -0
  278. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/types.c +77 -0
  279. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/darwin.S +443 -0
  280. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/darwin64.S +416 -0
  281. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/ffi.c +475 -0
  282. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/ffi64.c +572 -0
  283. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/ffitarget.h +90 -0
  284. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/freebsd.S +458 -0
  285. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/sysv.S +437 -0
  286. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/unix64.S +418 -0
  287. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/src/x86/win32.S +391 -0
  288. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/Makefile.am +71 -0
  289. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/Makefile.in +447 -0
  290. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/config/default.exp +1 -0
  291. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +289 -0
  292. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +263 -0
  293. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +45 -0
  294. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +36 -0
  295. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +97 -0
  296. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +89 -0
  297. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +89 -0
  298. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +90 -0
  299. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +97 -0
  300. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +99 -0
  301. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +98 -0
  302. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/closure_stdcall.c +72 -0
  303. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +102 -0
  304. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +103 -0
  305. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +104 -0
  306. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +110 -0
  307. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +97 -0
  308. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +99 -0
  309. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +101 -0
  310. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +121 -0
  311. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +98 -0
  312. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +103 -0
  313. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +98 -0
  314. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +98 -0
  315. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +106 -0
  316. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +98 -0
  317. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +117 -0
  318. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +106 -0
  319. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +132 -0
  320. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +121 -0
  321. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +107 -0
  322. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +125 -0
  323. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +105 -0
  324. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +96 -0
  325. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +98 -0
  326. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +99 -0
  327. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +101 -0
  328. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +99 -0
  329. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +100 -0
  330. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +101 -0
  331. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +99 -0
  332. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +99 -0
  333. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +99 -0
  334. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +99 -0
  335. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +99 -0
  336. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +100 -0
  337. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +51 -0
  338. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +51 -0
  339. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +82 -0
  340. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +82 -0
  341. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +94 -0
  342. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +99 -0
  343. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +82 -0
  344. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +94 -0
  345. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +52 -0
  346. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +50 -0
  347. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +50 -0
  348. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +50 -0
  349. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +51 -0
  350. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +54 -0
  351. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +51 -0
  352. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +86 -0
  353. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/float.c +59 -0
  354. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +58 -0
  355. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +57 -0
  356. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +72 -0
  357. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +62 -0
  358. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/many.c +69 -0
  359. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +63 -0
  360. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +53 -0
  361. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +160 -0
  362. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +169 -0
  363. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +141 -0
  364. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +118 -0
  365. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +119 -0
  366. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +119 -0
  367. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +120 -0
  368. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +139 -0
  369. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +119 -0
  370. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +139 -0
  371. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +139 -0
  372. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +98 -0
  373. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +59 -0
  374. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +114 -0
  375. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +35 -0
  376. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +43 -0
  377. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +42 -0
  378. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +35 -0
  379. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +36 -0
  380. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +49 -0
  381. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +42 -0
  382. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +34 -0
  383. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +41 -0
  384. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +42 -0
  385. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +36 -0
  386. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +38 -0
  387. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +38 -0
  388. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +38 -0
  389. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +44 -0
  390. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +44 -0
  391. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +65 -0
  392. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +67 -0
  393. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +59 -0
  394. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +63 -0
  395. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +65 -0
  396. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +64 -0
  397. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +74 -0
  398. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +80 -0
  399. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +67 -0
  400. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +86 -0
  401. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +38 -0
  402. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest.cc +123 -0
  403. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc +53 -0
  404. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/libffi/texinfo.tex +7482 -0
  405. data/vendor/ffi-0.4.0-x86-mswin32/ext/ffi_c/rbffi.h +23 -0
  406. data/vendor/ffi-0.4.0-x86-mswin32/gen/Rakefile +12 -0
  407. data/vendor/ffi-0.4.0-x86-mswin32/lib/1.8/ffi_c.so +0 -0
  408. data/vendor/ffi-0.4.0-x86-mswin32/lib/1.9/ffi_c.so +0 -0
  409. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi.rb +11 -0
  410. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/autopointer.rb +61 -0
  411. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/buffer.rb +0 -0
  412. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/callback.rb +10 -0
  413. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/enum.rb +78 -0
  414. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/errno.rb +8 -0
  415. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/ffi.rb +96 -0
  416. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/io.rb +21 -0
  417. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/library.rb +243 -0
  418. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/managedstruct.rb +55 -0
  419. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/memorypointer.rb +73 -0
  420. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/platform.rb +78 -0
  421. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/pointer.rb +119 -0
  422. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/struct.rb +354 -0
  423. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/tools/const_generator.rb +177 -0
  424. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/tools/generator.rb +58 -0
  425. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/tools/generator_task.rb +35 -0
  426. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/tools/struct_generator.rb +194 -0
  427. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/tools/types_generator.rb +123 -0
  428. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/types.rb +153 -0
  429. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/union.rb +17 -0
  430. data/vendor/ffi-0.4.0-x86-mswin32/lib/ffi/variadic.rb +30 -0
  431. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/bool_spec.rb +24 -0
  432. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/buffer_spec.rb +196 -0
  433. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/callback_spec.rb +560 -0
  434. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/enum_spec.rb +164 -0
  435. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/errno_spec.rb +13 -0
  436. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/library_spec.rb +144 -0
  437. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/managed_struct_spec.rb +56 -0
  438. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/number_spec.rb +231 -0
  439. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/pointer_spec.rb +195 -0
  440. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/rbx/attach_function_spec.rb +27 -0
  441. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/rbx/memory_pointer_spec.rb +102 -0
  442. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/rbx/spec_helper.rb +1 -0
  443. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/rbx/struct_spec.rb +13 -0
  444. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/spec_helper.rb +17 -0
  445. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/string_spec.rb +103 -0
  446. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/struct_callback_spec.rb +41 -0
  447. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/struct_initialize_spec.rb +30 -0
  448. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/struct_spec.rb +476 -0
  449. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/typedef_spec.rb +48 -0
  450. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/union_spec.rb +60 -0
  451. data/vendor/ffi-0.4.0-x86-mswin32/spec/ffi/variadic_spec.rb +84 -0
  452. data/vendor/ffi-0.4.0-x86-mswin32/spec/spec.opts +4 -0
  453. data/vendor/hardmock-1.3.7/CHANGES +78 -0
  454. data/vendor/hardmock-1.3.7/LICENSE +7 -0
  455. data/vendor/hardmock-1.3.7/README +70 -0
  456. data/vendor/hardmock-1.3.7/Rakefile +8 -0
  457. data/vendor/hardmock-1.3.7/config/environment.rb +12 -0
  458. data/vendor/hardmock-1.3.7/lib/assert_error.rb +23 -0
  459. data/vendor/hardmock-1.3.7/lib/extend_test_unit.rb +14 -0
  460. data/vendor/hardmock-1.3.7/lib/hardmock.rb +86 -0
  461. data/vendor/hardmock-1.3.7/lib/hardmock/errors.rb +22 -0
  462. data/vendor/hardmock-1.3.7/lib/hardmock/expectation.rb +229 -0
  463. data/vendor/hardmock-1.3.7/lib/hardmock/expectation_builder.rb +9 -0
  464. data/vendor/hardmock-1.3.7/lib/hardmock/expector.rb +26 -0
  465. data/vendor/hardmock-1.3.7/lib/hardmock/method_cleanout.rb +33 -0
  466. data/vendor/hardmock-1.3.7/lib/hardmock/mock.rb +180 -0
  467. data/vendor/hardmock-1.3.7/lib/hardmock/mock_control.rb +53 -0
  468. data/vendor/hardmock-1.3.7/lib/hardmock/stubbing.rb +210 -0
  469. data/vendor/hardmock-1.3.7/lib/hardmock/trapper.rb +31 -0
  470. data/vendor/hardmock-1.3.7/lib/hardmock/utils.rb +9 -0
  471. data/vendor/hardmock-1.3.7/lib/test_unit_before_after.rb +169 -0
  472. data/vendor/hardmock-1.3.7/rake_tasks/test.rake +22 -0
  473. data/vendor/hardmock-1.3.7/test/functional/assert_error_test.rb +52 -0
  474. data/vendor/hardmock-1.3.7/test/functional/auto_verify_test.rb +178 -0
  475. data/vendor/hardmock-1.3.7/test/functional/direct_mock_usage_test.rb +396 -0
  476. data/vendor/hardmock-1.3.7/test/functional/hardmock_test.rb +434 -0
  477. data/vendor/hardmock-1.3.7/test/functional/stubbing_test.rb +479 -0
  478. data/vendor/hardmock-1.3.7/test/test_helper.rb +43 -0
  479. data/vendor/hardmock-1.3.7/test/unit/expectation_builder_test.rb +19 -0
  480. data/vendor/hardmock-1.3.7/test/unit/expectation_test.rb +372 -0
  481. data/vendor/hardmock-1.3.7/test/unit/expector_test.rb +57 -0
  482. data/vendor/hardmock-1.3.7/test/unit/method_cleanout_test.rb +36 -0
  483. data/vendor/hardmock-1.3.7/test/unit/mock_control_test.rb +175 -0
  484. data/vendor/hardmock-1.3.7/test/unit/mock_test.rb +279 -0
  485. data/vendor/hardmock-1.3.7/test/unit/test_unit_before_after_test.rb +452 -0
  486. data/vendor/hardmock-1.3.7/test/unit/trapper_test.rb +62 -0
  487. data/vendor/hardmock-1.3.7/test/unit/verify_error_test.rb +40 -0
  488. data/vendor/mcc/cbw32.dll +0 -0
  489. data/vendor/systir/systir.rb +403 -0
  490. data/vendor/systir/test/unit/ui/xml/testrunner.rb +192 -0
  491. data/vendor/systir/test/unit/ui/xml/xmltestrunner.xslt +109 -0
  492. metadata +561 -0
@@ -0,0 +1,234 @@
1
+ /* -----------------------------------------------------------------------
2
+ sysv.S - Copyright (c) 1998 Andreas Schwab
3
+ Copyright (c) 2008 Red Hat, Inc.
4
+
5
+ m68k 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,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
+ DEALINGS IN THE SOFTWARE.
26
+ ----------------------------------------------------------------------- */
27
+
28
+ #define LIBFFI_ASM
29
+ #include <fficonfig.h>
30
+ #include <ffi.h>
31
+
32
+ #ifdef HAVE_AS_CFI_PSEUDO_OP
33
+ #define CFI_STARTPROC() .cfi_startproc
34
+ #define CFI_OFFSET(reg,off) .cfi_offset reg,off
35
+ #define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off
36
+ #define CFI_ENDPROC() .cfi_endproc
37
+ #else
38
+ #define CFI_STARTPROC()
39
+ #define CFI_OFFSET(reg,off)
40
+ #define CFI_DEF_CFA(reg,off)
41
+ #define CFI_ENDPROC()
42
+ #endif
43
+
44
+ .text
45
+
46
+ .globl ffi_call_SYSV
47
+ .type ffi_call_SYSV,@function
48
+ .align 4
49
+
50
+ ffi_call_SYSV:
51
+ CFI_STARTPROC()
52
+ link %fp,#0
53
+ CFI_OFFSET(14,-8)
54
+ CFI_DEF_CFA(14,8)
55
+ move.l %d2,-(%sp)
56
+ CFI_OFFSET(2,-12)
57
+
58
+ | Make room for all of the new args.
59
+ sub.l 12(%fp),%sp
60
+
61
+ | Call ffi_prep_args
62
+ move.l 8(%fp),-(%sp)
63
+ pea 4(%sp)
64
+ #if !defined __PIC__
65
+ jsr ffi_prep_args
66
+ #else
67
+ bsr.l ffi_prep_args@PLTPC
68
+ #endif
69
+ addq.l #8,%sp
70
+
71
+ | Pass pointer to struct value, if any
72
+ move.l %a0,%a1
73
+
74
+ | Call the function
75
+ move.l 24(%fp),%a0
76
+ jsr (%a0)
77
+
78
+ | Remove the space we pushed for the args
79
+ add.l 12(%fp),%sp
80
+
81
+ | Load the pointer to storage for the return value
82
+ move.l 20(%fp),%a1
83
+
84
+ | Load the return type code
85
+ move.l 16(%fp),%d2
86
+
87
+ | If the return value pointer is NULL, assume no return value.
88
+ tst.l %a1
89
+ jbeq noretval
90
+
91
+ btst #0,%d2
92
+ jbeq retlongint
93
+ move.l %d0,(%a1)
94
+ jbra epilogue
95
+
96
+ retlongint:
97
+ btst #1,%d2
98
+ jbeq retfloat
99
+ move.l %d0,(%a1)
100
+ move.l %d1,4(%a1)
101
+ jbra epilogue
102
+
103
+ retfloat:
104
+ btst #2,%d2
105
+ jbeq retdouble
106
+ fmove.s %fp0,(%a1)
107
+ jbra epilogue
108
+
109
+ retdouble:
110
+ btst #3,%d2
111
+ jbeq retlongdouble
112
+ fmove.d %fp0,(%a1)
113
+ jbra epilogue
114
+
115
+ retlongdouble:
116
+ btst #4,%d2
117
+ jbeq retpointer
118
+ fmove.x %fp0,(%a1)
119
+ jbra epilogue
120
+
121
+ retpointer:
122
+ btst #5,%d2
123
+ jbeq retstruct1
124
+ move.l %a0,(%a1)
125
+ jbra epilogue
126
+
127
+ retstruct1:
128
+ btst #6,%d2
129
+ jbeq retstruct2
130
+ move.b %d0,(%a1)
131
+ jbra epilogue
132
+
133
+ retstruct2:
134
+ btst #7,%d2
135
+ jbeq noretval
136
+ move.w %d0,(%a1)
137
+
138
+ noretval:
139
+ epilogue:
140
+ move.l (%sp)+,%d2
141
+ unlk %fp
142
+ rts
143
+ CFI_ENDPROC()
144
+ .size ffi_call_SYSV,.-ffi_call_SYSV
145
+
146
+ .globl ffi_closure_SYSV
147
+ .type ffi_closure_SYSV, @function
148
+ .align 4
149
+
150
+ ffi_closure_SYSV:
151
+ CFI_STARTPROC()
152
+ link %fp,#-12
153
+ CFI_OFFSET(14,-8)
154
+ CFI_DEF_CFA(14,8)
155
+ move.l %sp,-12(%fp)
156
+ pea 8(%fp)
157
+ pea -12(%fp)
158
+ move.l %a0,-(%sp)
159
+ #if !defined __PIC__
160
+ jsr ffi_closure_SYSV_inner
161
+ #else
162
+ bsr.l ffi_closure_SYSV_inner@PLTPC
163
+ #endif
164
+
165
+ lsr.l #1,%d0
166
+ jne 1f
167
+ jcc .Lcls_epilogue
168
+ move.l -12(%fp),%d0
169
+ .Lcls_epilogue:
170
+ unlk %fp
171
+ rts
172
+ 1:
173
+ lea -12(%fp),%a0
174
+ lsr.l #2,%d0
175
+ jne 1f
176
+ jcs .Lcls_ret_float
177
+ move.l (%a0)+,%d0
178
+ move.l (%a0),%d1
179
+ jra .Lcls_epilogue
180
+ .Lcls_ret_float:
181
+ fmove.s (%a0),%fp0
182
+ jra .Lcls_epilogue
183
+ 1:
184
+ lsr.l #2,%d0
185
+ jne 1f
186
+ jcs .Lcls_ret_ldouble
187
+ fmove.d (%a0),%fp0
188
+ jra .Lcls_epilogue
189
+ .Lcls_ret_ldouble:
190
+ fmove.x (%a0),%fp0
191
+ jra .Lcls_epilogue
192
+ 1:
193
+ lsr.l #2,%d0
194
+ jne .Lcls_ret_struct2
195
+ jcs .Lcls_ret_struct1
196
+ move.l (%a0),%a0
197
+ move.l %a0,%d0
198
+ jra .Lcls_epilogue
199
+ .Lcls_ret_struct1:
200
+ move.b (%a0),%d0
201
+ jra .Lcls_epilogue
202
+ .Lcls_ret_struct2:
203
+ move.w (%a0),%d0
204
+ jra .Lcls_epilogue
205
+ CFI_ENDPROC()
206
+
207
+ .size ffi_closure_SYSV,.-ffi_closure_SYSV
208
+
209
+ .globl ffi_closure_struct_SYSV
210
+ .type ffi_closure_struct_SYSV, @function
211
+ .align 4
212
+
213
+ ffi_closure_struct_SYSV:
214
+ CFI_STARTPROC()
215
+ link %fp,#0
216
+ CFI_OFFSET(14,-8)
217
+ CFI_DEF_CFA(14,8)
218
+ move.l %sp,-12(%fp)
219
+ pea 8(%fp)
220
+ move.l %a1,-(%sp)
221
+ move.l %a0,-(%sp)
222
+ #if !defined __PIC__
223
+ jsr ffi_closure_SYSV_inner
224
+ #else
225
+ bsr.l ffi_closure_SYSV_inner@PLTPC
226
+ #endif
227
+ unlk %fp
228
+ rts
229
+ CFI_ENDPROC()
230
+ .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
231
+
232
+ #if defined __ELF__ && defined __linux__
233
+ .section .note.GNU-stack,"",@progbits
234
+ #endif
@@ -0,0 +1,926 @@
1
+ /* -----------------------------------------------------------------------
2
+ ffi.c - Copyright (c) 1996, 2007, 2008 Red Hat, Inc.
3
+ Copyright (c) 2008 David Daney
4
+
5
+ MIPS 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,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
+ DEALINGS IN THE SOFTWARE.
26
+ ----------------------------------------------------------------------- */
27
+
28
+ #include <ffi.h>
29
+ #include <ffi_common.h>
30
+
31
+ #include <stdlib.h>
32
+
33
+ #ifdef __GNUC__
34
+ # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
35
+ # define USE__BUILTIN___CLEAR_CACHE 1
36
+ # endif
37
+ #endif
38
+
39
+ #ifndef USE__BUILTIN___CLEAR_CACHE
40
+ #include <sys/cachectl.h>
41
+ #endif
42
+
43
+ #ifdef FFI_DEBUG
44
+ # define FFI_MIPS_STOP_HERE() ffi_stop_here()
45
+ #else
46
+ # define FFI_MIPS_STOP_HERE() do {} while(0)
47
+ #endif
48
+
49
+ #ifdef FFI_MIPS_N32
50
+ #define FIX_ARGP \
51
+ FFI_ASSERT(argp <= &stack[bytes]); \
52
+ if (argp == &stack[bytes]) \
53
+ { \
54
+ argp = stack; \
55
+ FFI_MIPS_STOP_HERE(); \
56
+ }
57
+ #else
58
+ #define FIX_ARGP
59
+ #endif
60
+
61
+
62
+ /* ffi_prep_args is called by the assembly routine once stack space
63
+ has been allocated for the function's arguments */
64
+
65
+ static void ffi_prep_args(char *stack,
66
+ extended_cif *ecif,
67
+ int bytes,
68
+ int flags)
69
+ {
70
+ int i;
71
+ void **p_argv;
72
+ char *argp;
73
+ ffi_type **p_arg;
74
+
75
+ #ifdef FFI_MIPS_N32
76
+ /* If more than 8 double words are used, the remainder go
77
+ on the stack. We reorder stuff on the stack here to
78
+ support this easily. */
79
+ if (bytes > 8 * sizeof(ffi_arg))
80
+ argp = &stack[bytes - (8 * sizeof(ffi_arg))];
81
+ else
82
+ argp = stack;
83
+ #else
84
+ argp = stack;
85
+ #endif
86
+
87
+ memset(stack, 0, bytes);
88
+
89
+ #ifdef FFI_MIPS_N32
90
+ if ( ecif->cif->rstruct_flag != 0 )
91
+ #else
92
+ if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT )
93
+ #endif
94
+ {
95
+ *(ffi_arg *) argp = (ffi_arg) ecif->rvalue;
96
+ argp += sizeof(ffi_arg);
97
+ FIX_ARGP;
98
+ }
99
+
100
+ p_argv = ecif->avalue;
101
+
102
+ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
103
+ {
104
+ size_t z;
105
+ unsigned int a;
106
+
107
+ /* Align if necessary. */
108
+ a = (*p_arg)->alignment;
109
+ if (a < sizeof(ffi_arg))
110
+ a = sizeof(ffi_arg);
111
+
112
+ if ((a - 1) & (unsigned long) argp)
113
+ {
114
+ argp = (char *) ALIGN(argp, a);
115
+ FIX_ARGP;
116
+ }
117
+
118
+ z = (*p_arg)->size;
119
+ if (z <= sizeof(ffi_arg))
120
+ {
121
+ int type = (*p_arg)->type;
122
+ z = sizeof(ffi_arg);
123
+
124
+ /* The size of a pointer depends on the ABI */
125
+ if (type == FFI_TYPE_POINTER)
126
+ type =
127
+ (ecif->cif->abi == FFI_N64) ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
128
+
129
+ switch (type)
130
+ {
131
+ case FFI_TYPE_SINT8:
132
+ *(ffi_arg *)argp = *(SINT8 *)(* p_argv);
133
+ break;
134
+
135
+ case FFI_TYPE_UINT8:
136
+ *(ffi_arg *)argp = *(UINT8 *)(* p_argv);
137
+ break;
138
+
139
+ case FFI_TYPE_SINT16:
140
+ *(ffi_arg *)argp = *(SINT16 *)(* p_argv);
141
+ break;
142
+
143
+ case FFI_TYPE_UINT16:
144
+ *(ffi_arg *)argp = *(UINT16 *)(* p_argv);
145
+ break;
146
+
147
+ case FFI_TYPE_SINT32:
148
+ *(ffi_arg *)argp = *(SINT32 *)(* p_argv);
149
+ break;
150
+
151
+ case FFI_TYPE_UINT32:
152
+ *(ffi_arg *)argp = *(UINT32 *)(* p_argv);
153
+ break;
154
+
155
+ /* This can only happen with 64bit slots. */
156
+ case FFI_TYPE_FLOAT:
157
+ *(float *) argp = *(float *)(* p_argv);
158
+ break;
159
+
160
+ /* Handle structures. */
161
+ default:
162
+ memcpy(argp, *p_argv, (*p_arg)->size);
163
+ break;
164
+ }
165
+ }
166
+ else
167
+ {
168
+ #ifdef FFI_MIPS_O32
169
+ memcpy(argp, *p_argv, z);
170
+ #else
171
+ {
172
+ unsigned long end = (unsigned long) argp + z;
173
+ unsigned long cap = (unsigned long) stack + bytes;
174
+
175
+ /* Check if the data will fit within the register space.
176
+ Handle it if it doesn't. */
177
+
178
+ if (end <= cap)
179
+ memcpy(argp, *p_argv, z);
180
+ else
181
+ {
182
+ unsigned long portion = cap - (unsigned long)argp;
183
+
184
+ memcpy(argp, *p_argv, portion);
185
+ argp = stack;
186
+ z -= portion;
187
+ memcpy(argp, (void*)((unsigned long)(*p_argv) + portion),
188
+ z);
189
+ }
190
+ }
191
+ #endif
192
+ }
193
+ p_argv++;
194
+ argp += z;
195
+ FIX_ARGP;
196
+ }
197
+ }
198
+
199
+ #ifdef FFI_MIPS_N32
200
+
201
+ /* The n32 spec says that if "a chunk consists solely of a double
202
+ float field (but not a double, which is part of a union), it
203
+ is passed in a floating point register. Any other chunk is
204
+ passed in an integer register". This code traverses structure
205
+ definitions and generates the appropriate flags. */
206
+
207
+ static unsigned
208
+ calc_n32_struct_flags(ffi_type *arg, unsigned *loc, unsigned *arg_reg)
209
+ {
210
+ unsigned flags = 0;
211
+ unsigned index = 0;
212
+
213
+ ffi_type *e;
214
+
215
+ while ((e = arg->elements[index]))
216
+ {
217
+ /* Align this object. */
218
+ *loc = ALIGN(*loc, e->alignment);
219
+ if (e->type == FFI_TYPE_DOUBLE)
220
+ {
221
+ /* Already aligned to FFI_SIZEOF_ARG. */
222
+ *arg_reg = *loc / FFI_SIZEOF_ARG;
223
+ if (*arg_reg > 7)
224
+ break;
225
+ flags += (FFI_TYPE_DOUBLE << (*arg_reg * FFI_FLAG_BITS));
226
+ *loc += e->size;
227
+ }
228
+ else
229
+ *loc += e->size;
230
+ index++;
231
+ }
232
+ /* Next Argument register at alignment of FFI_SIZEOF_ARG. */
233
+ *arg_reg = ALIGN(*loc, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
234
+
235
+ return flags;
236
+ }
237
+
238
+ static unsigned
239
+ calc_n32_return_struct_flags(ffi_type *arg)
240
+ {
241
+ unsigned flags = 0;
242
+ unsigned small = FFI_TYPE_SMALLSTRUCT;
243
+ ffi_type *e;
244
+
245
+ /* Returning structures under n32 is a tricky thing.
246
+ A struct with only one or two floating point fields
247
+ is returned in $f0 (and $f2 if necessary). Any other
248
+ struct results at most 128 bits are returned in $2
249
+ (the first 64 bits) and $3 (remainder, if necessary).
250
+ Larger structs are handled normally. */
251
+
252
+ if (arg->size > 16)
253
+ return 0;
254
+
255
+ if (arg->size > 8)
256
+ small = FFI_TYPE_SMALLSTRUCT2;
257
+
258
+ e = arg->elements[0];
259
+ if (e->type == FFI_TYPE_DOUBLE)
260
+ flags = FFI_TYPE_DOUBLE;
261
+ else if (e->type == FFI_TYPE_FLOAT)
262
+ flags = FFI_TYPE_FLOAT;
263
+
264
+ if (flags && (e = arg->elements[1]))
265
+ {
266
+ if (e->type == FFI_TYPE_DOUBLE)
267
+ flags += FFI_TYPE_DOUBLE << FFI_FLAG_BITS;
268
+ else if (e->type == FFI_TYPE_FLOAT)
269
+ flags += FFI_TYPE_FLOAT << FFI_FLAG_BITS;
270
+ else
271
+ return small;
272
+
273
+ if (flags && (arg->elements[2]))
274
+ {
275
+ /* There are three arguments and the first two are
276
+ floats! This must be passed the old way. */
277
+ return small;
278
+ }
279
+ }
280
+ else
281
+ if (!flags)
282
+ return small;
283
+
284
+ return flags;
285
+ }
286
+
287
+ #endif
288
+
289
+ /* Perform machine dependent cif processing */
290
+ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
291
+ {
292
+ cif->flags = 0;
293
+
294
+ #ifdef FFI_MIPS_O32
295
+ /* Set the flags necessary for O32 processing. FFI_O32_SOFT_FLOAT
296
+ * does not have special handling for floating point args.
297
+ */
298
+
299
+ if (cif->rtype->type != FFI_TYPE_STRUCT && cif->abi == FFI_O32)
300
+ {
301
+ if (cif->nargs > 0)
302
+ {
303
+ switch ((cif->arg_types)[0]->type)
304
+ {
305
+ case FFI_TYPE_FLOAT:
306
+ case FFI_TYPE_DOUBLE:
307
+ cif->flags += (cif->arg_types)[0]->type;
308
+ break;
309
+
310
+ default:
311
+ break;
312
+ }
313
+
314
+ if (cif->nargs > 1)
315
+ {
316
+ /* Only handle the second argument if the first
317
+ is a float or double. */
318
+ if (cif->flags)
319
+ {
320
+ switch ((cif->arg_types)[1]->type)
321
+ {
322
+ case FFI_TYPE_FLOAT:
323
+ case FFI_TYPE_DOUBLE:
324
+ cif->flags += (cif->arg_types)[1]->type << FFI_FLAG_BITS;
325
+ break;
326
+
327
+ default:
328
+ break;
329
+ }
330
+ }
331
+ }
332
+ }
333
+ }
334
+
335
+ /* Set the return type flag */
336
+
337
+ if (cif->abi == FFI_O32_SOFT_FLOAT)
338
+ {
339
+ switch (cif->rtype->type)
340
+ {
341
+ case FFI_TYPE_VOID:
342
+ case FFI_TYPE_STRUCT:
343
+ cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2);
344
+ break;
345
+
346
+ case FFI_TYPE_SINT64:
347
+ case FFI_TYPE_UINT64:
348
+ case FFI_TYPE_DOUBLE:
349
+ cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2);
350
+ break;
351
+
352
+ case FFI_TYPE_FLOAT:
353
+ default:
354
+ cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2);
355
+ break;
356
+ }
357
+ }
358
+ else
359
+ {
360
+ /* FFI_O32 */
361
+ switch (cif->rtype->type)
362
+ {
363
+ case FFI_TYPE_VOID:
364
+ case FFI_TYPE_STRUCT:
365
+ case FFI_TYPE_FLOAT:
366
+ case FFI_TYPE_DOUBLE:
367
+ cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2);
368
+ break;
369
+
370
+ case FFI_TYPE_SINT64:
371
+ case FFI_TYPE_UINT64:
372
+ cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2);
373
+ break;
374
+
375
+ default:
376
+ cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2);
377
+ break;
378
+ }
379
+ }
380
+ #endif
381
+
382
+ #ifdef FFI_MIPS_N32
383
+ /* Set the flags necessary for N32 processing */
384
+ {
385
+ unsigned arg_reg = 0;
386
+ unsigned loc = 0;
387
+ unsigned count = (cif->nargs < 8) ? cif->nargs : 8;
388
+ unsigned index = 0;
389
+
390
+ unsigned struct_flags = 0;
391
+
392
+ if (cif->rtype->type == FFI_TYPE_STRUCT)
393
+ {
394
+ struct_flags = calc_n32_return_struct_flags(cif->rtype);
395
+
396
+ if (struct_flags == 0)
397
+ {
398
+ /* This means that the structure is being passed as
399
+ a hidden argument */
400
+
401
+ arg_reg = 1;
402
+ count = (cif->nargs < 7) ? cif->nargs : 7;
403
+
404
+ cif->rstruct_flag = !0;
405
+ }
406
+ else
407
+ cif->rstruct_flag = 0;
408
+ }
409
+ else
410
+ cif->rstruct_flag = 0;
411
+
412
+ while (count-- > 0 && arg_reg < 8)
413
+ {
414
+ switch ((cif->arg_types)[index]->type)
415
+ {
416
+ case FFI_TYPE_FLOAT:
417
+ case FFI_TYPE_DOUBLE:
418
+ cif->flags +=
419
+ ((cif->arg_types)[index]->type << (arg_reg * FFI_FLAG_BITS));
420
+ arg_reg++;
421
+ break;
422
+ case FFI_TYPE_LONGDOUBLE:
423
+ /* Align it. */
424
+ arg_reg = ALIGN(arg_reg, 2);
425
+ /* Treat it as two adjacent doubles. */
426
+ cif->flags +=
427
+ (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
428
+ arg_reg++;
429
+ cif->flags +=
430
+ (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
431
+ arg_reg++;
432
+ break;
433
+
434
+ case FFI_TYPE_STRUCT:
435
+ loc = arg_reg * FFI_SIZEOF_ARG;
436
+ cif->flags += calc_n32_struct_flags((cif->arg_types)[index],
437
+ &loc, &arg_reg);
438
+ break;
439
+
440
+ default:
441
+ arg_reg++;
442
+ break;
443
+ }
444
+
445
+ index++;
446
+ }
447
+
448
+ /* Set the return type flag */
449
+ switch (cif->rtype->type)
450
+ {
451
+ case FFI_TYPE_STRUCT:
452
+ {
453
+ if (struct_flags == 0)
454
+ {
455
+ /* The structure is returned through a hidden
456
+ first argument. Do nothing, 'cause FFI_TYPE_VOID
457
+ is 0 */
458
+ }
459
+ else
460
+ {
461
+ /* The structure is returned via some tricky
462
+ mechanism */
463
+ cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
464
+ cif->flags += struct_flags << (4 + (FFI_FLAG_BITS * 8));
465
+ }
466
+ break;
467
+ }
468
+
469
+ case FFI_TYPE_VOID:
470
+ /* Do nothing, 'cause FFI_TYPE_VOID is 0 */
471
+ break;
472
+
473
+ case FFI_TYPE_FLOAT:
474
+ case FFI_TYPE_DOUBLE:
475
+ cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8);
476
+ break;
477
+ case FFI_TYPE_LONGDOUBLE:
478
+ /* Long double is returned as if it were a struct containing
479
+ two doubles. */
480
+ cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
481
+ cif->flags += (FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
482
+ << (4 + (FFI_FLAG_BITS * 8));
483
+ break;
484
+ default:
485
+ cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
486
+ break;
487
+ }
488
+ }
489
+ #endif
490
+
491
+ return FFI_OK;
492
+ }
493
+
494
+ /* Low level routine for calling O32 functions */
495
+ extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int),
496
+ extended_cif *, unsigned,
497
+ unsigned, unsigned *, void (*)(void));
498
+
499
+ /* Low level routine for calling N32 functions */
500
+ extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int),
501
+ extended_cif *, unsigned,
502
+ unsigned, unsigned *, void (*)(void));
503
+
504
+ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
505
+ {
506
+ extended_cif ecif;
507
+
508
+ ecif.cif = cif;
509
+ ecif.avalue = avalue;
510
+
511
+ /* If the return value is a struct and we don't have a return */
512
+ /* value address then we need to make one */
513
+
514
+ if ((rvalue == NULL) &&
515
+ (cif->rtype->type == FFI_TYPE_STRUCT))
516
+ ecif.rvalue = alloca(cif->rtype->size);
517
+ else
518
+ ecif.rvalue = rvalue;
519
+
520
+ switch (cif->abi)
521
+ {
522
+ #ifdef FFI_MIPS_O32
523
+ case FFI_O32:
524
+ case FFI_O32_SOFT_FLOAT:
525
+ ffi_call_O32(ffi_prep_args, &ecif, cif->bytes,
526
+ cif->flags, ecif.rvalue, fn);
527
+ break;
528
+ #endif
529
+
530
+ #ifdef FFI_MIPS_N32
531
+ case FFI_N32:
532
+ case FFI_N64:
533
+ {
534
+ int copy_rvalue = 0;
535
+ void *rvalue_copy = ecif.rvalue;
536
+ if (cif->rtype->type == FFI_TYPE_STRUCT && cif->rtype->size < 16)
537
+ {
538
+ /* For structures smaller than 16 bytes we clobber memory
539
+ in 8 byte increments. Make a copy so we don't clobber
540
+ the callers memory outside of the struct bounds. */
541
+ rvalue_copy = alloca(16);
542
+ copy_rvalue = 1;
543
+ }
544
+ ffi_call_N32(ffi_prep_args, &ecif, cif->bytes,
545
+ cif->flags, rvalue_copy, fn);
546
+ if (copy_rvalue)
547
+ memcpy(ecif.rvalue, rvalue_copy, cif->rtype->size);
548
+ }
549
+ break;
550
+ #endif
551
+
552
+ default:
553
+ FFI_ASSERT(0);
554
+ break;
555
+ }
556
+ }
557
+
558
+ #if FFI_CLOSURES
559
+ #if defined(FFI_MIPS_O32)
560
+ extern void ffi_closure_O32(void);
561
+ #else
562
+ extern void ffi_closure_N32(void);
563
+ #endif /* FFI_MIPS_O32 */
564
+
565
+ ffi_status
566
+ ffi_prep_closure_loc (ffi_closure *closure,
567
+ ffi_cif *cif,
568
+ void (*fun)(ffi_cif*,void*,void**,void*),
569
+ void *user_data,
570
+ void *codeloc)
571
+ {
572
+ unsigned int *tramp = (unsigned int *) &closure->tramp[0];
573
+ void * fn;
574
+ char *clear_location = (char *) codeloc;
575
+
576
+ #if defined(FFI_MIPS_O32)
577
+ FFI_ASSERT(cif->abi == FFI_O32 || cif->abi == FFI_O32_SOFT_FLOAT);
578
+ fn = ffi_closure_O32;
579
+ #else /* FFI_MIPS_N32 */
580
+ FFI_ASSERT(cif->abi == FFI_N32 || cif->abi == FFI_N64);
581
+ fn = ffi_closure_N32;
582
+ #endif /* FFI_MIPS_O32 */
583
+
584
+ #if defined(FFI_MIPS_O32) || (_MIPS_SIM ==_ABIN32)
585
+ /* lui $25,high(fn) */
586
+ tramp[0] = 0x3c190000 | ((unsigned)fn >> 16);
587
+ /* ori $25,low(fn) */
588
+ tramp[1] = 0x37390000 | ((unsigned)fn & 0xffff);
589
+ /* lui $12,high(codeloc) */
590
+ tramp[2] = 0x3c0c0000 | ((unsigned)codeloc >> 16);
591
+ /* jr $25 */
592
+ tramp[3] = 0x03200008;
593
+ /* ori $12,low(codeloc) */
594
+ tramp[4] = 0x358c0000 | ((unsigned)codeloc & 0xffff);
595
+ #else
596
+ /* N64 has a somewhat larger trampoline. */
597
+ /* lui $25,high(fn) */
598
+ tramp[0] = 0x3c190000 | ((unsigned long)fn >> 48);
599
+ /* lui $12,high(codeloc) */
600
+ tramp[1] = 0x3c0c0000 | ((unsigned long)codeloc >> 48);
601
+ /* ori $25,mid-high(fn) */
602
+ tramp[2] = 0x37390000 | (((unsigned long)fn >> 32 ) & 0xffff);
603
+ /* ori $12,mid-high(codeloc) */
604
+ tramp[3] = 0x358c0000 | (((unsigned long)codeloc >> 32) & 0xffff);
605
+ /* dsll $25,$25,16 */
606
+ tramp[4] = 0x0019cc38;
607
+ /* dsll $12,$12,16 */
608
+ tramp[5] = 0x000c6438;
609
+ /* ori $25,mid-low(fn) */
610
+ tramp[6] = 0x37390000 | (((unsigned long)fn >> 16 ) & 0xffff);
611
+ /* ori $12,mid-low(codeloc) */
612
+ tramp[7] = 0x358c0000 | (((unsigned long)codeloc >> 16) & 0xffff);
613
+ /* dsll $25,$25,16 */
614
+ tramp[8] = 0x0019cc38;
615
+ /* dsll $12,$12,16 */
616
+ tramp[9] = 0x000c6438;
617
+ /* ori $25,low(fn) */
618
+ tramp[10] = 0x37390000 | ((unsigned long)fn & 0xffff);
619
+ /* jr $25 */
620
+ tramp[11] = 0x03200008;
621
+ /* ori $12,low(codeloc) */
622
+ tramp[12] = 0x358c0000 | ((unsigned long)codeloc & 0xffff);
623
+
624
+ #endif
625
+
626
+ closure->cif = cif;
627
+ closure->fun = fun;
628
+ closure->user_data = user_data;
629
+
630
+ #ifdef USE__BUILTIN___CLEAR_CACHE
631
+ __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE);
632
+ #else
633
+ cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE);
634
+ #endif
635
+ return FFI_OK;
636
+ }
637
+
638
+ /*
639
+ * Decodes the arguments to a function, which will be stored on the
640
+ * stack. AR is the pointer to the beginning of the integer arguments
641
+ * (and, depending upon the arguments, some floating-point arguments
642
+ * as well). FPR is a pointer to the area where floating point
643
+ * registers have been saved, if any.
644
+ *
645
+ * RVALUE is the location where the function return value will be
646
+ * stored. CLOSURE is the prepared closure to invoke.
647
+ *
648
+ * This function should only be called from assembly, which is in
649
+ * turn called from a trampoline.
650
+ *
651
+ * Returns the function return type.
652
+ *
653
+ * Based on the similar routine for sparc.
654
+ */
655
+ int
656
+ ffi_closure_mips_inner_O32 (ffi_closure *closure,
657
+ void *rvalue, ffi_arg *ar,
658
+ double *fpr)
659
+ {
660
+ ffi_cif *cif;
661
+ void **avaluep;
662
+ ffi_arg *avalue;
663
+ ffi_type **arg_types;
664
+ int i, avn, argn, seen_int;
665
+
666
+ cif = closure->cif;
667
+ avalue = alloca (cif->nargs * sizeof (ffi_arg));
668
+ avaluep = alloca (cif->nargs * sizeof (ffi_arg));
669
+
670
+ seen_int = (cif->abi == FFI_O32_SOFT_FLOAT);
671
+ argn = 0;
672
+
673
+ if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_STRUCT)
674
+ {
675
+ rvalue = (void *)(UINT32)ar[0];
676
+ argn = 1;
677
+ }
678
+
679
+ i = 0;
680
+ avn = cif->nargs;
681
+ arg_types = cif->arg_types;
682
+
683
+ while (i < avn)
684
+ {
685
+ if (i < 2 && !seen_int &&
686
+ (arg_types[i]->type == FFI_TYPE_FLOAT ||
687
+ arg_types[i]->type == FFI_TYPE_DOUBLE))
688
+ {
689
+ #ifdef __MIPSEB__
690
+ if (arg_types[i]->type == FFI_TYPE_FLOAT)
691
+ avaluep[i] = ((char *) &fpr[i]) + sizeof (float);
692
+ else
693
+ #endif
694
+ avaluep[i] = (char *) &fpr[i];
695
+ }
696
+ else
697
+ {
698
+ if (arg_types[i]->alignment == 8 && (argn & 0x1))
699
+ argn++;
700
+ switch (arg_types[i]->type)
701
+ {
702
+ case FFI_TYPE_SINT8:
703
+ avaluep[i] = &avalue[i];
704
+ *(SINT8 *) &avalue[i] = (SINT8) ar[argn];
705
+ break;
706
+
707
+ case FFI_TYPE_UINT8:
708
+ avaluep[i] = &avalue[i];
709
+ *(UINT8 *) &avalue[i] = (UINT8) ar[argn];
710
+ break;
711
+
712
+ case FFI_TYPE_SINT16:
713
+ avaluep[i] = &avalue[i];
714
+ *(SINT16 *) &avalue[i] = (SINT16) ar[argn];
715
+ break;
716
+
717
+ case FFI_TYPE_UINT16:
718
+ avaluep[i] = &avalue[i];
719
+ *(UINT16 *) &avalue[i] = (UINT16) ar[argn];
720
+ break;
721
+
722
+ default:
723
+ avaluep[i] = (char *) &ar[argn];
724
+ break;
725
+ }
726
+ seen_int = 1;
727
+ }
728
+ argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
729
+ i++;
730
+ }
731
+
732
+ /* Invoke the closure. */
733
+ (closure->fun) (cif, rvalue, avaluep, closure->user_data);
734
+
735
+ if (cif->abi == FFI_O32_SOFT_FLOAT)
736
+ {
737
+ switch (cif->rtype->type)
738
+ {
739
+ case FFI_TYPE_FLOAT:
740
+ return FFI_TYPE_INT;
741
+ case FFI_TYPE_DOUBLE:
742
+ return FFI_TYPE_UINT64;
743
+ default:
744
+ return cif->rtype->type;
745
+ }
746
+ }
747
+ else
748
+ {
749
+ return cif->rtype->type;
750
+ }
751
+ }
752
+
753
+ #if defined(FFI_MIPS_N32)
754
+
755
+ static void
756
+ copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type,
757
+ int argn, unsigned arg_offset, ffi_arg *ar,
758
+ ffi_arg *fpr)
759
+ {
760
+ ffi_type **elt_typep = type->elements;
761
+ while(*elt_typep)
762
+ {
763
+ ffi_type *elt_type = *elt_typep;
764
+ unsigned o;
765
+ char *tp;
766
+ char *argp;
767
+ char *fpp;
768
+
769
+ o = ALIGN(offset, elt_type->alignment);
770
+ arg_offset += o - offset;
771
+ offset = o;
772
+ argn += arg_offset / sizeof(ffi_arg);
773
+ arg_offset = arg_offset % sizeof(ffi_arg);
774
+
775
+ argp = (char *)(ar + argn);
776
+ fpp = (char *)(argn >= 8 ? ar + argn : fpr + argn);
777
+
778
+ tp = target + offset;
779
+
780
+ if (elt_type->type == FFI_TYPE_DOUBLE)
781
+ *(double *)tp = *(double *)fpp;
782
+ else
783
+ memcpy(tp, argp + arg_offset, elt_type->size);
784
+
785
+ offset += elt_type->size;
786
+ arg_offset += elt_type->size;
787
+ elt_typep++;
788
+ argn += arg_offset / sizeof(ffi_arg);
789
+ arg_offset = arg_offset % sizeof(ffi_arg);
790
+ }
791
+ }
792
+
793
+ /*
794
+ * Decodes the arguments to a function, which will be stored on the
795
+ * stack. AR is the pointer to the beginning of the integer
796
+ * arguments. FPR is a pointer to the area where floating point
797
+ * registers have been saved.
798
+ *
799
+ * RVALUE is the location where the function return value will be
800
+ * stored. CLOSURE is the prepared closure to invoke.
801
+ *
802
+ * This function should only be called from assembly, which is in
803
+ * turn called from a trampoline.
804
+ *
805
+ * Returns the function return flags.
806
+ *
807
+ */
808
+ int
809
+ ffi_closure_mips_inner_N32 (ffi_closure *closure,
810
+ void *rvalue, ffi_arg *ar,
811
+ ffi_arg *fpr)
812
+ {
813
+ ffi_cif *cif;
814
+ void **avaluep;
815
+ ffi_arg *avalue;
816
+ ffi_type **arg_types;
817
+ int i, avn, argn;
818
+
819
+ cif = closure->cif;
820
+ avalue = alloca (cif->nargs * sizeof (ffi_arg));
821
+ avaluep = alloca (cif->nargs * sizeof (ffi_arg));
822
+
823
+ argn = 0;
824
+
825
+ if (cif->rstruct_flag)
826
+ {
827
+ #if _MIPS_SIM==_ABIN32
828
+ rvalue = (void *)(UINT32)ar[0];
829
+ #else /* N64 */
830
+ rvalue = (void *)ar[0];
831
+ #endif
832
+ argn = 1;
833
+ }
834
+
835
+ i = 0;
836
+ avn = cif->nargs;
837
+ arg_types = cif->arg_types;
838
+
839
+ while (i < avn)
840
+ {
841
+ if (arg_types[i]->type == FFI_TYPE_FLOAT
842
+ || arg_types[i]->type == FFI_TYPE_DOUBLE)
843
+ {
844
+ ffi_arg *argp = argn >= 8 ? ar + argn : fpr + argn;
845
+ #ifdef __MIPSEB__
846
+ if (arg_types[i]->type == FFI_TYPE_FLOAT && argn < 8)
847
+ avaluep[i] = ((char *) argp) + sizeof (float);
848
+ else
849
+ #endif
850
+ avaluep[i] = (char *) argp;
851
+ }
852
+ else
853
+ {
854
+ unsigned type = arg_types[i]->type;
855
+
856
+ if (arg_types[i]->alignment > sizeof(ffi_arg))
857
+ argn = ALIGN(argn, arg_types[i]->alignment / sizeof(ffi_arg));
858
+
859
+ ffi_arg *argp = ar + argn;
860
+
861
+ /* The size of a pointer depends on the ABI */
862
+ if (type == FFI_TYPE_POINTER)
863
+ type = (cif->abi == FFI_N64) ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
864
+
865
+ switch (type)
866
+ {
867
+ case FFI_TYPE_SINT8:
868
+ avaluep[i] = &avalue[i];
869
+ *(SINT8 *) &avalue[i] = (SINT8) *argp;
870
+ break;
871
+
872
+ case FFI_TYPE_UINT8:
873
+ avaluep[i] = &avalue[i];
874
+ *(UINT8 *) &avalue[i] = (UINT8) *argp;
875
+ break;
876
+
877
+ case FFI_TYPE_SINT16:
878
+ avaluep[i] = &avalue[i];
879
+ *(SINT16 *) &avalue[i] = (SINT16) *argp;
880
+ break;
881
+
882
+ case FFI_TYPE_UINT16:
883
+ avaluep[i] = &avalue[i];
884
+ *(UINT16 *) &avalue[i] = (UINT16) *argp;
885
+ break;
886
+
887
+ case FFI_TYPE_SINT32:
888
+ avaluep[i] = &avalue[i];
889
+ *(SINT32 *) &avalue[i] = (SINT32) *argp;
890
+ break;
891
+
892
+ case FFI_TYPE_UINT32:
893
+ avaluep[i] = &avalue[i];
894
+ *(UINT32 *) &avalue[i] = (UINT32) *argp;
895
+ break;
896
+
897
+ case FFI_TYPE_STRUCT:
898
+ if (argn < 8)
899
+ {
900
+ /* Allocate space for the struct as at least part of
901
+ it was passed in registers. */
902
+ avaluep[i] = alloca(arg_types[i]->size);
903
+ copy_struct_N32(avaluep[i], 0, cif->abi, arg_types[i],
904
+ argn, 0, ar, fpr);
905
+
906
+ break;
907
+ }
908
+ /* Else fall through. */
909
+ default:
910
+ avaluep[i] = (char *) argp;
911
+ break;
912
+ }
913
+ }
914
+ argn += ALIGN(arg_types[i]->size, sizeof(ffi_arg)) / sizeof(ffi_arg);
915
+ i++;
916
+ }
917
+
918
+ /* Invoke the closure. */
919
+ (closure->fun) (cif, rvalue, avaluep, closure->user_data);
920
+
921
+ return cif->flags >> (FFI_FLAG_BITS * 8);
922
+ }
923
+
924
+ #endif /* FFI_MIPS_N32 */
925
+
926
+ #endif /* FFI_CLOSURES */