rbdc 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. data/bindings/ruby/rbdc/extconf.rb +57 -0
  2. data/bindings/ruby/rbdc/rbdc.c +304 -0
  3. data/dyncall/AUTHORS +4 -0
  4. data/dyncall/BUGS +3 -0
  5. data/dyncall/CMakeLists.txt +79 -0
  6. data/dyncall/ChangeLog +165 -0
  7. data/dyncall/LICENSE +15 -0
  8. data/dyncall/Makefile.M +15 -0
  9. data/dyncall/Makefile.embedded +71 -0
  10. data/dyncall/Makefile.generic +36 -0
  11. data/dyncall/Nmakefile +45 -0
  12. data/dyncall/README +92 -0
  13. data/dyncall/ToDo +114 -0
  14. data/dyncall/autovar/LICENSE.txt +15 -0
  15. data/dyncall/autovar/README.txt +69 -0
  16. data/dyncall/autovar/autovar_ABI.h +44 -0
  17. data/dyncall/autovar/autovar_ARCH.h +56 -0
  18. data/dyncall/autovar/autovar_CC.h +46 -0
  19. data/dyncall/autovar/autovar_OS.h +78 -0
  20. data/dyncall/autovar/autovar_OSFAMILY.h +39 -0
  21. data/dyncall/buildsys/cmake/Modules/FindDynCall.cmake +43 -0
  22. data/dyncall/buildsys/cmake/Modules/FindDynCallback.cmake +43 -0
  23. data/dyncall/buildsys/cmake/Modules/FindDynLoad.cmake +45 -0
  24. data/dyncall/buildsys/cmake/Modules/UseLATEX.cmake +811 -0
  25. data/dyncall/buildsys/dynmake/Makefile.base.M +82 -0
  26. data/dyncall/buildsys/dynmake/dynmake.bat +2 -0
  27. data/dyncall/buildsys/dynmake/dynmake.sh +4 -0
  28. data/dyncall/buildsys/lua/Makefile +10 -0
  29. data/dyncall/buildsys/lua/README.txt +4 -0
  30. data/dyncall/buildsys/lua/bootstrap.sh +34 -0
  31. data/dyncall/buildsys/lua/cleanup.sh +6 -0
  32. data/dyncall/buildsys/lua/mkfile +34 -0
  33. data/dyncall/buildsys/lua/setenv.sh +4 -0
  34. data/dyncall/buildsys/mk/app.mk +30 -0
  35. data/dyncall/buildsys/mk/dirs.mk +27 -0
  36. data/dyncall/buildsys/mk/epilog.mk +30 -0
  37. data/dyncall/buildsys/mk/lib.mk +23 -0
  38. data/dyncall/buildsys/mk/pcc.mk +60 -0
  39. data/dyncall/buildsys/mk/prolog.mk +35 -0
  40. data/dyncall/buildsys/nmake/common.nmake +61 -0
  41. data/dyncall/buildsys/nmake/epilog.nmake +28 -0
  42. data/dyncall/buildsys/nmake/prolog.nmake +76 -0
  43. data/dyncall/buildsys/nmake/tool_gcc.nmake +82 -0
  44. data/dyncall/buildsys/nmake/tool_msvc.nmake +67 -0
  45. data/dyncall/buildsys/scripts/batch-build-linux.sh +11 -0
  46. data/dyncall/buildsys/scripts/batch-build-minix.sh +11 -0
  47. data/dyncall/buildsys/scripts/batch-build-psp.sh +11 -0
  48. data/dyncall/buildsys/scripts/conf-nds.bat +41 -0
  49. data/dyncall/buildsys/scripts/setenv-cross-ios.sh +8 -0
  50. data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +22 -0
  51. data/dyncall/buildsys/vs2005/dyncall/dyncall.vcproj +245 -0
  52. data/dyncall/buildsys/vs2005/test_plain/test_plain.vcproj +202 -0
  53. data/dyncall/buildsys/vs2005/vs2005.sln +29 -0
  54. data/dyncall/configure +152 -0
  55. data/dyncall/configure.bat +157 -0
  56. data/dyncall/configure.rc +234 -0
  57. data/dyncall/dynMakefile +4 -0
  58. data/dyncall/dyncall/CMakeLists.txt +53 -0
  59. data/dyncall/dyncall/DynCallConfig.cmake +3 -0
  60. data/dyncall/dyncall/Makefile.M +10 -0
  61. data/dyncall/dyncall/Makefile.embedded +20 -0
  62. data/dyncall/dyncall/Makefile.generic +16 -0
  63. data/dyncall/dyncall/Nmakefile +62 -0
  64. data/dyncall/dyncall/README-Developer.txt +45 -0
  65. data/dyncall/dyncall/README.txt +65 -0
  66. data/dyncall/dyncall/TODO +9 -0
  67. data/dyncall/dyncall/dynMakefile +4 -0
  68. data/dyncall/dyncall/dyncall.3 +189 -0
  69. data/dyncall/dyncall/dyncall.h +135 -0
  70. data/dyncall/dyncall/dyncall_alloc.h +40 -0
  71. data/dyncall/dyncall/dyncall_api.c +167 -0
  72. data/dyncall/dyncall/dyncall_call.S +72 -0
  73. data/dyncall/dyncall/dyncall_call_arm32_arm.S +80 -0
  74. data/dyncall/dyncall/dyncall_call_arm32_arm.h +61 -0
  75. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +96 -0
  76. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +44 -0
  77. data/dyncall/dyncall/dyncall_call_arm32_thumb.h +65 -0
  78. data/dyncall/dyncall/dyncall_call_arm32_thumb_apple.s +80 -0
  79. data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +121 -0
  80. data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +101 -0
  81. data/dyncall/dyncall/dyncall_call_mips.h +50 -0
  82. data/dyncall/dyncall/dyncall_call_mips_eabi.h +61 -0
  83. data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +115 -0
  84. data/dyncall/dyncall/dyncall_call_mips_gas.S +36 -0
  85. data/dyncall/dyncall/dyncall_call_mips_n32.h +67 -0
  86. data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +192 -0
  87. data/dyncall/dyncall/dyncall_call_mips_n64.h +67 -0
  88. data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +192 -0
  89. data/dyncall/dyncall/dyncall_call_mips_o32.h +70 -0
  90. data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +109 -0
  91. data/dyncall/dyncall/dyncall_call_ppc32.S +266 -0
  92. data/dyncall/dyncall/dyncall_call_ppc32.h +62 -0
  93. data/dyncall/dyncall/dyncall_call_sparc.S +192 -0
  94. data/dyncall/dyncall/dyncall_call_sparc.h +42 -0
  95. data/dyncall/dyncall/dyncall_call_sparc64.S +361 -0
  96. data/dyncall/dyncall/dyncall_call_sparc64.h +42 -0
  97. data/dyncall/dyncall/dyncall_call_sparc_v9.S +220 -0
  98. data/dyncall/dyncall/dyncall_call_sparc_v9.h +42 -0
  99. data/dyncall/dyncall/dyncall_call_x64-att.S +146 -0
  100. data/dyncall/dyncall/dyncall_call_x64.S +149 -0
  101. data/dyncall/dyncall/dyncall_call_x64.h +63 -0
  102. data/dyncall/dyncall/dyncall_call_x64_generic_masm.asm +70 -0
  103. data/dyncall/dyncall/dyncall_call_x86.S +238 -0
  104. data/dyncall/dyncall/dyncall_call_x86.h +70 -0
  105. data/dyncall/dyncall/dyncall_call_x86_8a.s +127 -0
  106. data/dyncall/dyncall/dyncall_call_x86_generic_masm.asm +136 -0
  107. data/dyncall/dyncall/dyncall_call_x86_nasm.asm +234 -0
  108. data/dyncall/dyncall/dyncall_callf.c +112 -0
  109. data/dyncall/dyncall/dyncall_callf.h +52 -0
  110. data/dyncall/dyncall/dyncall_callvm.c +68 -0
  111. data/dyncall/dyncall/dyncall_callvm.h +88 -0
  112. data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +250 -0
  113. data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +59 -0
  114. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +204 -0
  115. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +63 -0
  116. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +271 -0
  117. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +59 -0
  118. data/dyncall/dyncall/dyncall_callvm_base.c +33 -0
  119. data/dyncall/dyncall/dyncall_callvm_mips.c +40 -0
  120. data/dyncall/dyncall/dyncall_callvm_mips.h +37 -0
  121. data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +181 -0
  122. data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +61 -0
  123. data/dyncall/dyncall/dyncall_callvm_mips_n32.c +268 -0
  124. data/dyncall/dyncall/dyncall_callvm_mips_n64.c +268 -0
  125. data/dyncall/dyncall/dyncall_callvm_mips_n64.h +53 -0
  126. data/dyncall/dyncall/dyncall_callvm_mips_o32.c +235 -0
  127. data/dyncall/dyncall/dyncall_callvm_mips_o32.h +45 -0
  128. data/dyncall/dyncall/dyncall_callvm_ppc32.c +372 -0
  129. data/dyncall/dyncall/dyncall_callvm_ppc32.h +61 -0
  130. data/dyncall/dyncall/dyncall_callvm_sparc.c +155 -0
  131. data/dyncall/dyncall/dyncall_callvm_sparc.h +44 -0
  132. data/dyncall/dyncall/dyncall_callvm_sparc64.c +239 -0
  133. data/dyncall/dyncall/dyncall_callvm_sparc64.h +47 -0
  134. data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +182 -0
  135. data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +45 -0
  136. data/dyncall/dyncall/dyncall_callvm_x64.c +228 -0
  137. data/dyncall/dyncall/dyncall_callvm_x64.h +111 -0
  138. data/dyncall/dyncall/dyncall_callvm_x86.c +667 -0
  139. data/dyncall/dyncall/dyncall_callvm_x86.h +75 -0
  140. data/dyncall/dyncall/dyncall_config.h +46 -0
  141. data/dyncall/dyncall/dyncall_macros.h +248 -0
  142. data/dyncall/dyncall/dyncall_signature.h +71 -0
  143. data/dyncall/dyncall/dyncall_struct.c +255 -0
  144. data/dyncall/dyncall/dyncall_struct.h +69 -0
  145. data/dyncall/dyncall/dyncall_types.h +74 -0
  146. data/dyncall/dyncall/dyncall_utils.h +38 -0
  147. data/dyncall/dyncall/dyncall_value.h +73 -0
  148. data/dyncall/dyncall/dyncall_vector.c +52 -0
  149. data/dyncall/dyncall/dyncall_vector.h +56 -0
  150. data/dyncall/dyncall/gen-masm.sh +7 -0
  151. data/dyncall/dyncall/mkfile +29 -0
  152. data/dyncall/dyncallback/CMakeLists.txt +55 -0
  153. data/dyncall/dyncallback/DynCallbackConfig.cmake +2 -0
  154. data/dyncall/dyncallback/Makefile.M +10 -0
  155. data/dyncall/dyncallback/Makefile.embedded +15 -0
  156. data/dyncall/dyncallback/Makefile.generic +20 -0
  157. data/dyncall/dyncallback/Nmakefile +71 -0
  158. data/dyncall/dyncallback/README.txt +9 -0
  159. data/dyncall/dyncallback/TODO +4 -0
  160. data/dyncall/dyncallback/dynMakefile +4 -0
  161. data/dyncall/dyncallback/dyncall_alloc_wx.c +35 -0
  162. data/dyncall/dyncallback/dyncall_alloc_wx.h +46 -0
  163. data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +40 -0
  164. data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +42 -0
  165. data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +42 -0
  166. data/dyncall/dyncallback/dyncall_args.c +45 -0
  167. data/dyncall/dyncallback/dyncall_args.h +65 -0
  168. data/dyncall/dyncallback/dyncall_args_arm32_arm.c +112 -0
  169. data/dyncall/dyncallback/dyncall_args_arm32_arm.h +40 -0
  170. data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +29 -0
  171. data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +32 -0
  172. data/dyncall/dyncallback/dyncall_args_mips.c +81 -0
  173. data/dyncall/dyncallback/dyncall_args_mips.h +41 -0
  174. data/dyncall/dyncallback/dyncall_args_ppc32.c +88 -0
  175. data/dyncall/dyncallback/dyncall_args_ppc32.h +41 -0
  176. data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -0
  177. data/dyncall/dyncallback/dyncall_args_sparc32.h +37 -0
  178. data/dyncall/dyncallback/dyncall_args_sparc64.c +41 -0
  179. data/dyncall/dyncallback/dyncall_args_sparc64.h +37 -0
  180. data/dyncall/dyncallback/dyncall_args_x64.c +73 -0
  181. data/dyncall/dyncallback/dyncall_args_x64.h +44 -0
  182. data/dyncall/dyncallback/dyncall_args_x86.c +121 -0
  183. data/dyncall/dyncallback/dyncall_args_x86.h +58 -0
  184. data/dyncall/dyncallback/dyncall_callback.c +45 -0
  185. data/dyncall/dyncallback/dyncall_callback.h +51 -0
  186. data/dyncall/dyncallback/dyncall_callback_arch.S +71 -0
  187. data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +63 -0
  188. data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +45 -0
  189. data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +73 -0
  190. data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.s +73 -0
  191. data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +29 -0
  192. data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +33 -0
  193. data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.s +32 -0
  194. data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.s +32 -0
  195. data/dyncall/dyncallback/dyncall_callback_mips.c +61 -0
  196. data/dyncall/dyncallback/dyncall_callback_mips.h +42 -0
  197. data/dyncall/dyncallback/dyncall_callback_ppc32.S +33 -0
  198. data/dyncall/dyncallback/dyncall_callback_ppc32.c +60 -0
  199. data/dyncall/dyncallback/dyncall_callback_ppc32.h +43 -0
  200. data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +180 -0
  201. data/dyncall/dyncallback/dyncall_callback_sparc32.c +57 -0
  202. data/dyncall/dyncallback/dyncall_callback_sparc32.h +43 -0
  203. data/dyncall/dyncallback/dyncall_callback_sparc32.s +30 -0
  204. data/dyncall/dyncallback/dyncall_callback_sparc64.c +57 -0
  205. data/dyncall/dyncallback/dyncall_callback_sparc64.s +30 -0
  206. data/dyncall/dyncallback/dyncall_callback_x64.S +187 -0
  207. data/dyncall/dyncallback/dyncall_callback_x64.c +69 -0
  208. data/dyncall/dyncallback/dyncall_callback_x64.h +44 -0
  209. data/dyncall/dyncallback/dyncall_callback_x64_apple.s +122 -0
  210. data/dyncall/dyncallback/dyncall_callback_x64_gas.s +119 -0
  211. data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +102 -0
  212. data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +89 -0
  213. data/dyncall/dyncallback/dyncall_callback_x86.S +115 -0
  214. data/dyncall/dyncallback/dyncall_callback_x86.c +281 -0
  215. data/dyncall/dyncallback/dyncall_callback_x86.h +49 -0
  216. data/dyncall/dyncallback/dyncall_callback_x86_8a.s +100 -0
  217. data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +74 -0
  218. data/dyncall/dyncallback/dyncall_thunk.c +47 -0
  219. data/dyncall/dyncallback/dyncall_thunk.h +84 -0
  220. data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +45 -0
  221. data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +40 -0
  222. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +29 -0
  223. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +35 -0
  224. data/dyncall/dyncallback/dyncall_thunk_mips.c +52 -0
  225. data/dyncall/dyncallback/dyncall_thunk_mips.h +37 -0
  226. data/dyncall/dyncallback/dyncall_thunk_ppc32.c +51 -0
  227. data/dyncall/dyncallback/dyncall_thunk_ppc32.h +40 -0
  228. data/dyncall/dyncallback/dyncall_thunk_sparc32.c +32 -0
  229. data/dyncall/dyncallback/dyncall_thunk_sparc32.h +36 -0
  230. data/dyncall/dyncallback/dyncall_thunk_sparc64.c +32 -0
  231. data/dyncall/dyncallback/dyncall_thunk_sparc64.h +36 -0
  232. data/dyncall/dyncallback/dyncall_thunk_x64.c +48 -0
  233. data/dyncall/dyncallback/dyncall_thunk_x64.h +39 -0
  234. data/dyncall/dyncallback/dyncall_thunk_x86.c +44 -0
  235. data/dyncall/dyncallback/dyncall_thunk_x86.h +39 -0
  236. data/dyncall/dyncallback/dyncallback.3 +134 -0
  237. data/dyncall/dyncallback/gen-masm.sh +8 -0
  238. data/dyncall/dyncallback/mkfile +29 -0
  239. data/dyncall/dynload/CMakeLists.txt +25 -0
  240. data/dyncall/dynload/DynLoadConfig.cmake +3 -0
  241. data/dyncall/dynload/Makefile.M +10 -0
  242. data/dyncall/dynload/Makefile.embedded +22 -0
  243. data/dyncall/dynload/Makefile.generic +18 -0
  244. data/dyncall/dynload/Nmakefile +57 -0
  245. data/dyncall/dynload/README.txt +113 -0
  246. data/dyncall/dynload/TODO +20 -0
  247. data/dyncall/dynload/dynMakefile +4 -0
  248. data/dyncall/dynload/dynload.3 +64 -0
  249. data/dyncall/dynload/dynload.c +38 -0
  250. data/dyncall/dynload/dynload.h +65 -0
  251. data/dyncall/dynload/dynload_alloc.h +40 -0
  252. data/dyncall/dynload/dynload_darwin.c +89 -0
  253. data/dyncall/dynload/dynload_syms.c +38 -0
  254. data/dyncall/dynload/dynload_syms_elf.c +214 -0
  255. data/dyncall/dynload/dynload_syms_mach-o.c +167 -0
  256. data/dyncall/dynload/dynload_syms_pe.c +109 -0
  257. data/dyncall/dynload/dynload_unix.c +57 -0
  258. data/dyncall/dynload/dynload_windows.c +59 -0
  259. data/dyncall/mkfile +36 -0
  260. data/dyncall/portasm/README.txt +42 -0
  261. data/dyncall/portasm/gen-masm.sh +3 -0
  262. data/dyncall/portasm/portasm-arm.S +36 -0
  263. data/dyncall/portasm/portasm-ppc.S +98 -0
  264. data/dyncall/portasm/portasm-x64-att.S +155 -0
  265. data/dyncall/portasm/portasm-x86.S +127 -0
  266. metadata +311 -0
@@ -0,0 +1,62 @@
1
+ /*
2
+
3
+ Package: dyncall
4
+ Library: dyncall
5
+ File: dyncall/dyncall_call_ppc32.h
6
+ Description:
7
+ License:
8
+
9
+ Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
10
+ Tassilo Philipp <tphilipp@potion-studios.com>
11
+
12
+ Permission to use, copy, modify, and distribute this software for any
13
+ purpose with or without fee is hereby granted, provided that the above
14
+ copyright notice and this permission notice appear in all copies.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
17
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
18
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
19
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
21
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
22
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
+
24
+ */
25
+
26
+
27
+ #ifndef DYNCALL_PPC32_H
28
+ #define DYNCALL_PPC32_H
29
+
30
+ #include "dyncall_types.h"
31
+
32
+ #ifdef __cplusplus
33
+ extern "C" {
34
+ #endif
35
+
36
+ struct DCRegData_ppc32_
37
+ {
38
+ DCint mIntData[8];
39
+ DCdouble mFloatData[13];
40
+ };
41
+
42
+ /*
43
+ ** PowerPC 32-bit calling convention call
44
+ **
45
+ ** - hybrid return-type call (bool ... pointer)
46
+ **
47
+ */
48
+
49
+ /* Darwin ABI */
50
+
51
+ void dcCall_ppc32_darwin (DCpointer target, struct DCRegData_ppc32_* ppc32data, DCsize stksize, DCpointer stkdata);
52
+
53
+ /* System V (Linux) ABI */
54
+
55
+ void dcCall_ppc32_sysv (DCpointer target, struct DCRegData_ppc32_* ppc32data, DCsize stksize, DCpointer stkdata);
56
+
57
+ #ifdef __cplusplus
58
+ }
59
+ #endif
60
+
61
+ #endif /* DYNCALL_PPC32_H */
62
+
@@ -0,0 +1,192 @@
1
+ /*
2
+
3
+ Package: dyncall
4
+ Library: dyncall
5
+ File: dyncall/dyncall_call_sparc.S
6
+ Description: Call kernel for sparc processor architecture.
7
+ License:
8
+
9
+ Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>
10
+
11
+ Permission to use, copy, modify, and distribute this software for any
12
+ purpose with or without fee is hereby granted, provided that the above
13
+ copyright notice and this permission notice appear in all copies.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
+
23
+ */
24
+
25
+
26
+
27
+ /* ---------------------------------------------------------------------------
28
+
29
+ call kernel for sparc 32-bit
30
+ ----------------------------
31
+ tested on linux/debian [gcc54.fsffrance.org - thanx to the farm!]
32
+
33
+ new C Interface:
34
+ void dcCall_sparc (DCCallVM* callvm, DCpointer target);
35
+ %i0 %1
36
+
37
+ we need to do that, due to the special property of sparc, its 'register windows'
38
+ that propagate input registers..
39
+ otherwise, we would have a 'void' return-value layer which results in failure
40
+ to propagate back return values.
41
+ instead of implementing 'dummy'-C return-values, we call directly.
42
+
43
+ in sparc, this is simply a leaf-function layer using %o3.
44
+
45
+ old C Interface:
46
+ void dcCall_sparc (DCpointer target, DCsize size, DCpointer data);
47
+ %i0 , %i1 , %i2
48
+
49
+
50
+ Input:
51
+ i0 callvm
52
+ i1 target
53
+
54
+ old Input:
55
+ i0 target
56
+ i1 size
57
+ i2 data
58
+
59
+ Description:
60
+ We need to raise a dynamic stack frame.
61
+ Therefore we need to compute the stack size in the context of the caller as a leaf note (using o3 in addition).
62
+ Then we raise the frame.
63
+
64
+ sparc:
65
+ - big endian
66
+
67
+ sparc V8:
68
+ - integer/pointer: 32 32-bit integers.
69
+ - float: 8 quad precision, 16 double precision, 32 single precision.
70
+
71
+ sparc V9:
72
+ - integer/pointer: 32 64-bit integers.
73
+
74
+ plan9:
75
+ - completely different scheme - similar to mips/plan9.
76
+ - registers are named r0 .. r31
77
+ r1 stack pointer
78
+ r2 static base register
79
+ .. to be continued..
80
+
81
+ Stack Layout 32-Bit Model:
82
+ - sp+92 seventh argument
83
+ - sp+68 first argument
84
+ - sp+64
85
+ - 16 registers save area (in/local).
86
+
87
+ XX: should be 8 byte aligned (min stack frame size is 96).
88
+ ...
89
+ 92: on stack argument 6
90
+ 88: input argument 5 spill
91
+ ...
92
+ 68: input argument 0 spill
93
+ 64: struct/union pointer return value
94
+ 0: 16 registers save area
95
+
96
+ Stack Layout 64-Bit Model:
97
+ XX: should be 16 byte aligned (min stack frame size is 172).
98
+ 168: on stack argument 6
99
+ 136: input argument 0 spill
100
+ 128: struct/union poiner return value
101
+ 0: 16 registers save area
102
+
103
+
104
+
105
+ Register Usage:
106
+ %sp or %o6: stack pointer, always 8 (or 16?)-byte aligned.
107
+ %fp or %i6: frame pointer.
108
+ %i0 and %o0: integer and pointer return values.
109
+ %i7 and %o7: return address. (caller puts return address to %o7, callee uses %i7)
110
+ %f0 and %f1: return value (float).
111
+ %i0..%i5: input argument registers
112
+ %o0..%o5: output argument registers
113
+ %g0: always zero, writes to it have no effect.
114
+
115
+ Register Mappings:
116
+ r0-7 -> globals
117
+ r8-15 -> outs
118
+ r16-r23 -> locals
119
+ r24-r31 -> ins
120
+
121
+ */
122
+
123
+ #if defined __arch64__
124
+ #define REGSIZE 8
125
+ #error invalid arch
126
+ #else
127
+ #define REGSIZE 4
128
+ #endif
129
+
130
+ #define ALIGN 16
131
+ CALLVM_size = 12
132
+ CALLVM_dataoff = 16
133
+ .global dcCall_sparc
134
+ dcCall_sparc:
135
+
136
+ /* Basic Prolog: supports up to 6 arguments. */
137
+
138
+ /* new C interface */
139
+ /* o0-1: callvm,target */
140
+
141
+ or %o0, %g0, %o3 /* %o3: callvm */
142
+ or %o1, %g0, %o0 /* %o0: target */
143
+ ld [%o3+CALLVM_size], %o1 /* %o1: size */
144
+ add %o3, CALLVM_dataoff, %o2 /* %o2: data */
145
+ /*o0-2:target,size,data*/
146
+
147
+ /*leaf functions: may use the first six output registers.*/
148
+ /*o3-5:free to use */
149
+
150
+ /* Compute a matiching stack size (approximate): o3 = align(92+o1,16) */
151
+
152
+ add %o1, (16+1+6)*REGSIZE+ALIGN-1, %o3
153
+ and %o3, -ALIGN, %o3
154
+ neg %o3
155
+
156
+ /* Prolog. */
157
+ save %sp, %o3, %sp /* min stack size (16+1+6)*sizeof(ptr)=92 paddded to 8-byte alignment => min frame size of 96 bytes. */
158
+
159
+ /* Load output registers. */
160
+
161
+ ld [%i2 ],%o0
162
+ ld [%i2+REGSIZE*1 ],%o1
163
+ ld [%i2+REGSIZE*2 ],%o2
164
+ ld [%i2+REGSIZE*3 ],%o3
165
+ ld [%i2+REGSIZE*4 ],%o4
166
+ ld [%i2+REGSIZE*5 ],%o5
167
+
168
+ /* Copy on stack? */
169
+ sub %i1, REGSIZE*6, %i1 /* i1 = decrement copy size by 6 regs (=6 regs x 4 bytes = 24 bytes total). */
170
+ cmp %i1, 0
171
+ ble .do_call
172
+ nop
173
+
174
+ /* Copy loop: */
175
+ add %i2, REGSIZE*6, %i2 /* i2 = address of 7th word of args buffer. */
176
+ or %g0, %g0, %l0 /* l0 = offset initialized to 0. */
177
+ add %sp, (16+1+6)*REGSIZE, %l2 /* l2 = argument area on stack space (7th word). (64+4+6*4 = byte offset 92). */
178
+ .next:
179
+ ld [%i2+%l0],%l1 /* Read from arg buffer(%i2) to %l1. */
180
+ st %l1, [%l2+%l0] /* Write %l1 to stack space(%l2). */
181
+ add %l0, REGSIZE, %l0 /* Increment offset. */
182
+ sub %i1, REGSIZE, %i1 /* Decrement copy size. */
183
+ cmp %i1, 0
184
+ bgt .next
185
+ nop
186
+ .do_call:
187
+ call %i0 /* Call target. */
188
+ nop
189
+ or %o0, %g0, %i0
190
+ or %o1, %g0, %i1
191
+ jmpl %i7 + 8, %g0
192
+ restore
@@ -0,0 +1,42 @@
1
+ /*
2
+
3
+ Package: dyncall
4
+ Library: dyncall
5
+ File: dyncall/dyncall_call_sparc.h
6
+ Description:
7
+ License:
8
+
9
+ Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>
10
+
11
+ Permission to use, copy, modify, and distribute this software for any
12
+ purpose with or without fee is hereby granted, provided that the above
13
+ copyright notice and this permission notice appear in all copies.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
+
23
+ */
24
+
25
+
26
+ #ifndef DYNCALL_CALL_SPARC_H
27
+ #define DYNCALL_CALL_SPARC_H
28
+
29
+ #include "dyncall_types.h"
30
+
31
+ #ifdef __cplusplus
32
+ extern "C" {
33
+ #endif
34
+
35
+ void dcCall_sparc (DCpointer target, DCsize size, DCpointer data);
36
+
37
+ #ifdef __cplusplus
38
+ }
39
+ #endif
40
+
41
+ #endif /* DYNCALL_CALL_SPARC_H */
42
+
@@ -0,0 +1,361 @@
1
+ /*
2
+
3
+ Package: dyncall
4
+ Library: dyncall
5
+ File: dyncall/dyncall_call_sparc64.S
6
+ Description: Call kernel for sparc64 v9 ABI.
7
+ License:
8
+
9
+ Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>
10
+
11
+ Permission to use, copy, modify, and distribute this software for any
12
+ purpose with or without fee is hereby granted, provided that the above
13
+ copyright notice and this permission notice appear in all copies.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
+
23
+ */
24
+
25
+
26
+
27
+ /* ---------------------------------------------------------------------------
28
+
29
+ call kernel for sparc64 v9 abi
30
+ tested on sparc64/linux/debian [gcc54.fsffrance.org - thanx to the farm!]
31
+
32
+ new C Interface:
33
+ void dcCall_sparc (DCCallVM* callvm, DCpointer target);
34
+ %i0 %1
35
+
36
+ see dyncall_call_sparc.S for details.
37
+
38
+ old C Interface:
39
+ void dcCall_sparc (DCpointer target, DCsize size, DCpointer data);
40
+ %i0 , %i1 , %i2
41
+ Input:
42
+ i0 target
43
+ i1 size
44
+ i2 data
45
+
46
+ */
47
+
48
+ #define REGSIZE 8
49
+
50
+ #define BIAS 2047
51
+
52
+ #define ALIGN 16
53
+
54
+ #define IREGS 6
55
+ #define FREGS 16
56
+ #define SREGS 16
57
+ #define IBASE 0
58
+ #define FBASE (IREGS*8)
59
+
60
+ #define SHEAD ((16+6)*8)
61
+ #define DHEAD ((IREGS+FREGS)*8)+SREGS*4
62
+
63
+ CALLVM_singleUseFlags = 24
64
+ CALLVM_size = 40
65
+ CALLVM_dataoff = 48
66
+
67
+
68
+ .global dcCall_sparc64
69
+ dcCall_sparc64:
70
+
71
+ /* Basic Prolog: supports up to 6 arguments. */
72
+
73
+ /* new C interface */
74
+ /* o0-1: callvm,target */
75
+
76
+ or %o0, %g0, %o3 /* %o3: callvm */
77
+ or %o1, %g0, %o0 /* %o0: target */
78
+ ldx [%o3+CALLVM_size], %o1 /* %o1: size */
79
+ add %o3, CALLVM_dataoff, %o2 /* %o2: data */
80
+ ld [%o3+CALLVM_singleUseFlags], %o4 /* %o4: flags */
81
+ /*leaf functions: may use the first six output registers.*/
82
+ /*o0-2:target,size,data*/
83
+ /*o3-5:free to use */
84
+
85
+ /* Arguments: */
86
+ /* %o0 = ptr to target. */
87
+ /* %o1 = size of data. */
88
+ /* %o2 = data pointer. */
89
+ /* %o4 = use flags. */
90
+
91
+ /* Compute a matching stack size (approximate): o3 = align(o1+136,16) */
92
+
93
+ add %o1, SHEAD+ALIGN-1, %o3
94
+ and %o3, -ALIGN, %o3
95
+ neg %o3
96
+
97
+ /* Prolog. */
98
+ save %sp, %o3, %sp
99
+
100
+ /* Arguments: */
101
+ /* %i0 = ptr to target. */
102
+ /* %i1 = size of data. */
103
+ /* %i2 = data pointer. */
104
+ /* %i3 = stack size. */
105
+
106
+ /* Load output registers. */
107
+
108
+ ldx [%i2+IBASE+REGSIZE*0 ],%o0
109
+ ldx [%i2+IBASE+REGSIZE*1 ],%o1
110
+ ldx [%i2+IBASE+REGSIZE*2 ],%o2
111
+ ldx [%i2+IBASE+REGSIZE*3 ],%o3
112
+ ldx [%i2+IBASE+REGSIZE*4 ],%o4
113
+ ldx [%i2+IBASE+REGSIZE*5 ],%o5
114
+
115
+ /* Load double-precision float registers. */
116
+
117
+ ldd [%i2+FBASE+REGSIZE*0 ],%f0
118
+ ldd [%i2+FBASE+REGSIZE*1 ],%f2
119
+ ldd [%i2+FBASE+REGSIZE*2 ],%f4
120
+ ldd [%i2+FBASE+REGSIZE*3 ],%f6
121
+ ldd [%i2+FBASE+REGSIZE*4 ],%f8
122
+ ldd [%i2+FBASE+REGSIZE*5 ],%f10
123
+ ldd [%i2+FBASE+REGSIZE*6 ],%f12
124
+ ldd [%i2+FBASE+REGSIZE*7 ],%f14
125
+ ldd [%i2+FBASE+REGSIZE*8 ],%f16
126
+ ldd [%i2+FBASE+REGSIZE*9 ],%f18
127
+ ldd [%i2+FBASE+REGSIZE*10],%f20
128
+ ldd [%i2+FBASE+REGSIZE*11],%f22
129
+ ldd [%i2+FBASE+REGSIZE*12],%f24
130
+ ldd [%i2+FBASE+REGSIZE*13],%f26
131
+ ldd [%i2+FBASE+REGSIZE*14],%f28
132
+ ldd [%i2+FBASE+REGSIZE*15],%f30
133
+
134
+ /* load single-precision float registers */
135
+
136
+ or %g0, 1, %l0
137
+ .f0:
138
+ andcc %i4, %l0, %g0
139
+ beq .f1
140
+ nop
141
+ ld [%i2+FBASE+REGSIZE*16+4*0 ], %f1
142
+ .f1:
143
+ sll %l0, 1, %l0
144
+ andcc %i4, %l0, %g0
145
+ beq .f2
146
+ nop
147
+ ld [%i2+FBASE+REGSIZE*16+4*1 ], %f3
148
+ .f2:
149
+ sll %l0, 1, %l0
150
+ andcc %i4, %l0, %g0
151
+ beq .f3
152
+ nop
153
+ ld [%i2+FBASE+REGSIZE*16+4*2 ], %f5
154
+ .f3:
155
+ sll %l0, 1, %l0
156
+ andcc %i4, %l0, %g0
157
+ beq .f4
158
+ nop
159
+ ld [%i2+FBASE+REGSIZE*16+4*3 ], %f7
160
+ .f4:
161
+ sll %l0, 1, %l0
162
+ andcc %i4, %l0, %g0
163
+ beq .f5
164
+ nop
165
+ ld [%i2+FBASE+REGSIZE*16+4*4 ], %f9
166
+ .f5:
167
+ sll %l0, 1, %l0
168
+ andcc %i4, %l0, %g0
169
+ beq .f6
170
+ nop
171
+ ld [%i2+FBASE+REGSIZE*16+4*5 ], %f11
172
+ .f6:
173
+ sll %l0, 1, %l0
174
+ andcc %i4, %l0, %g0
175
+ beq .f7
176
+ nop
177
+ ld [%i2+FBASE+REGSIZE*16+4*6 ], %f13
178
+ .f7:
179
+ sll %l0, 1, %l0
180
+ andcc %i4, %l0, %g0
181
+ beq .f8
182
+ nop
183
+ ld [%i2+FBASE+REGSIZE*16+4*7 ], %f15
184
+ .f8:
185
+ sll %l0, 1, %l0
186
+ andcc %i4, %l0, %g0
187
+ beq .f9
188
+ nop
189
+ ld [%i2+FBASE+REGSIZE*16+4*8 ], %f17
190
+ .f9:
191
+ sll %l0, 1, %l0
192
+ andcc %i4, %l0, %g0
193
+ beq .f10
194
+ nop
195
+ ld [%i2+FBASE+REGSIZE*16+4*9 ], %f19
196
+ .f10:
197
+ sll %l0, 1, %l0
198
+ andcc %i4, %l0, %g0
199
+ beq .f11
200
+ nop
201
+ ld [%i2+FBASE+REGSIZE*16+4*10], %f21
202
+ .f11:
203
+ sll %l0, 1, %l0
204
+ andcc %i4, %l0, %g0
205
+ beq .f12
206
+ nop
207
+ ld [%i2+FBASE+REGSIZE*16+4*11], %f23
208
+ .f12:
209
+ sll %l0, 1, %l0
210
+ andcc %i4, %l0, %g0
211
+ beq .f13
212
+ nop
213
+ ld [%i2+FBASE+REGSIZE*16+4*12], %f25
214
+ .f13:
215
+ sll %l0, 1, %l0
216
+ andcc %i4, %l0, %g0
217
+ beq .f14
218
+ nop
219
+ ld [%i2+FBASE+REGSIZE*16+4*13], %f27
220
+ .f14:
221
+ sll %l0, 1, %l0
222
+ andcc %i4, %l0, %g0
223
+ beq .f15
224
+ nop
225
+ ld [%i2+FBASE+REGSIZE*16+4*14], %f29
226
+ .f15:
227
+ sll %l0, 1, %l0
228
+ andcc %i4, %l0, %g0
229
+ beq .f_end
230
+ nop
231
+ ld [%i2+FBASE+REGSIZE*16+4*15], %f31
232
+ .f_end:
233
+ /* Skip Register Data, do we nee to copy on stack at all? */
234
+ sub %i1, DHEAD, %i1 /* skip data header. */
235
+ cmp %i1, 0
236
+ ble .do_call
237
+ nop
238
+
239
+ /* Copy loop: */
240
+ add %i2, DHEAD, %i2 /* i2 = skip data header. */
241
+ or %g0, %g0, %l0 /* l0 = offset initialized to 0. */
242
+ add %sp, BIAS+SHEAD, %l2 /* l2 = argument area on stack space (7th word). (64+4+6*4 = byte offset 92). */
243
+
244
+ .next:
245
+ ldx [%i2+%l0],%l1 /* Read from arg buffer(%i2) to %l1. */
246
+ stx %l1, [%l2+%l0] /* Write %l1 to stack space(%l2). */
247
+ add %l0, REGSIZE, %l0 /* Increment offset. */
248
+ sub %i1, REGSIZE, %i1 /* Decrement copy size. */
249
+ cmp %i1, 0
250
+ bgt .next
251
+ nop
252
+ .do_call:
253
+ call %i0 /* Call target. */
254
+ nop
255
+ or %o0, %g0, %i0
256
+ jmpl %i7 + 8, %g0
257
+ restore
258
+ /*
259
+ return %i7 + 8
260
+ jmpl %i7 + 8, %g0
261
+ nop
262
+
263
+ jmpl %i7 + 8, %g0
264
+ nop
265
+ restore
266
+ ret
267
+ */
268
+
269
+ /*
270
+ or %o0, %g0, %i0
271
+ or %o1, %g0, %i1
272
+ or %o2, %g0, %i2
273
+ or %o3, %g0, %i3
274
+ return %i7 + 8
275
+ nop
276
+
277
+ Changes from v8:
278
+ - fundamental data types
279
+ - (un)signed int: 8,16,32,64
280
+ - float: 32,64,128
281
+ - float: IEEE 754 compilant
282
+ 32 32-bit float registers f0,f1,..,f31
283
+ 32 64-bit float registers f0,f2,..,f62
284
+ 16 128-bit float registers f0,f4,..,f60
285
+
286
+ Description:
287
+ We need to raise up a dynamic stack frame.
288
+ Therefore we need to compute the stack size. We do this first,
289
+ in the context of the caller as a leaf function (using o3 as scratch for addition).
290
+ Then we raise the frame, ending up in o0-o3 is then i0-i3.
291
+
292
+
293
+ Stack Layout:
294
+ BIAS = 2047
295
+
296
+ BIAS+XX: should be 16 byte aligned.
297
+ ...
298
+ 136: argument overflow area
299
+ 128: 1 extended word for struct/union poiner return value
300
+ BIAS+ 0: 16 extended words for registers (in/local) save area [register window]
301
+
302
+
303
+ Function Argument Passing:
304
+ - integer %o0..%o5 (caller view).
305
+ - floating-point %f0 .. %f15
306
+ - continuous memory starting at %sp+BIAS+136 (caller view).
307
+
308
+ Register Usage:
309
+ %fp0..%fp31 : floating-point arguments.
310
+ %sp or %o6 : stack pointer, always 8 (or 16?)-byte aligned.
311
+ %fp or %i6 : frame pointer.
312
+ %i0 and %o0 : integer and pointer return values.
313
+ %i7 and %o7 : return address. (caller puts return address to %o7, callee uses %i7)
314
+ %fp0 and %fp1: return value (float).
315
+ %i0..%i5 : input argument registers
316
+ %o0..%o5 : output argument registers
317
+ %g0 : always zero, writes to it have no effect.
318
+
319
+ Register Mappings:
320
+ r0-7 -> globals
321
+ r8-15 -> outs
322
+ r16-r23 -> locals
323
+ r24-r31 -> ins
324
+
325
+ Integer Register Overview Table:
326
+ ID Class Name Description
327
+ ------------------------------------------------------------------------------
328
+ 0 globals g0 always zero, writes to it have no effect
329
+ 1 g1
330
+ 2 g2
331
+ 3 g3
332
+ 4 g4
333
+ 5 g5
334
+ 6 g6
335
+ 7 g7
336
+ 8 out o0 [int/ptr] arg 0 and return
337
+ 9 o1 arg 1
338
+ 10 o2 arg 2
339
+ 11 o3 arg 3
340
+ 12 o4 arg 4
341
+ 13 o5 arg 5
342
+ 14 o6 stack pointer
343
+ 15 o7
344
+ 16 local l0 scratch
345
+ 17 l1
346
+ 18 l2
347
+ 19 l3
348
+ 20 l4
349
+ 21 l5
350
+ 22 l6
351
+ 23 l7
352
+ 24 in i0 [int/pt] arg 0 and return
353
+ 25 i1
354
+ 26 i2
355
+ 27 i3
356
+ 28 i4
357
+ 29 i5
358
+ 30 i6 frame pointer
359
+ 31 i7
360
+ */
361
+