rbdc 0.8.7 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. checksums.yaml +7 -0
  2. data/{bindings → dyncall-bindings}/ruby/rbdc/extconf.rb +1 -1
  3. data/{bindings → dyncall-bindings}/ruby/rbdc/rbdc.c +3 -1
  4. data/dyncall/AUTHORS +2 -0
  5. data/dyncall/BUGS +1 -0
  6. data/dyncall/CMakeLists.txt +10 -2
  7. data/dyncall/ChangeLog +46 -11
  8. data/dyncall/LICENSE +4 -1
  9. data/dyncall/Makefile.embedded +7 -3
  10. data/dyncall/README +23 -14
  11. data/dyncall/ToDo +27 -28
  12. data/dyncall/autovar/autovar_ABI.h +3 -2
  13. data/dyncall/autovar/autovar_ARCH.h +13 -10
  14. data/dyncall/autovar/autovar_CC.h +3 -2
  15. data/dyncall/autovar/autovar_OS.h +3 -2
  16. data/dyncall/autovar/autovar_OSFAMILY.h +3 -2
  17. data/dyncall/buildsys/scripts/batch-build-linux.sh +6 -2
  18. data/dyncall/buildsys/scripts/batch-build-minix.sh +2 -0
  19. data/dyncall/buildsys/scripts/batch-build-psp.sh +4 -1
  20. data/dyncall/buildsys/scripts/elf-to-psp-eboot.sh +19 -0
  21. data/dyncall/buildsys/scripts/setenv-cross-ios.sh +0 -0
  22. data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +0 -0
  23. data/dyncall/configure +83 -30
  24. data/dyncall/dyncall/dyncall.3 +16 -4
  25. data/dyncall/dyncall/dyncall.h +9 -1
  26. data/dyncall/dyncall/dyncall_alloc.h +2 -1
  27. data/dyncall/dyncall/dyncall_api.c +2 -1
  28. data/dyncall/dyncall/dyncall_call.S +9 -2
  29. data/dyncall/dyncall/dyncall_call_arm32_arm.S +2 -1
  30. data/dyncall/dyncall/dyncall_call_arm32_arm.h +8 -2
  31. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +11 -19
  32. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +15 -2
  33. data/dyncall/dyncall/dyncall_call_arm32_thumb.h +8 -6
  34. data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +10 -18
  35. data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +0 -16
  36. data/dyncall/dyncall/dyncall_call_arm64.S +226 -0
  37. data/dyncall/dyncall/dyncall_call_arm64.h +45 -0
  38. data/dyncall/dyncall/dyncall_call_mips.h +2 -1
  39. data/dyncall/dyncall/dyncall_call_mips_eabi.h +2 -1
  40. data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -1
  41. data/dyncall/dyncall/dyncall_call_mips_n32.h +2 -1
  42. data/dyncall/dyncall/dyncall_call_mips_n64.h +2 -1
  43. data/dyncall/dyncall/dyncall_call_mips_o32.h +2 -1
  44. data/dyncall/dyncall/dyncall_call_ppc32.S +27 -2
  45. data/dyncall/dyncall/dyncall_call_ppc32.h +2 -2
  46. data/dyncall/dyncall/dyncall_call_ppc64.S +210 -0
  47. data/dyncall/dyncall/dyncall_call_ppc64.h +55 -0
  48. data/dyncall/dyncall/dyncall_call_sparc.S +2 -1
  49. data/dyncall/dyncall/dyncall_call_sparc.h +2 -1
  50. data/dyncall/dyncall/dyncall_call_sparc64.S +2 -1
  51. data/dyncall/dyncall/dyncall_call_sparc64.h +2 -1
  52. data/dyncall/dyncall/dyncall_call_sparc_v9.S +25 -23
  53. data/dyncall/dyncall/dyncall_call_sparc_v9.h +2 -1
  54. data/dyncall/dyncall/dyncall_call_x64-att.S +2 -1
  55. data/dyncall/dyncall/dyncall_call_x64.S +2 -1
  56. data/dyncall/dyncall/dyncall_call_x64.h +2 -1
  57. data/dyncall/dyncall/dyncall_call_x86.S +2 -1
  58. data/dyncall/dyncall/dyncall_call_x86.h +2 -1
  59. data/dyncall/dyncall/dyncall_callf.c +56 -66
  60. data/dyncall/dyncall/dyncall_callf.h +5 -1
  61. data/dyncall/dyncall/dyncall_callvm.c +11 -2
  62. data/dyncall/dyncall/dyncall_callvm.h +2 -1
  63. data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +2 -1
  64. data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +2 -1
  65. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +60 -30
  66. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +3 -2
  67. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +2 -24
  68. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +2 -1
  69. data/dyncall/dyncall/dyncall_callvm_arm64.c +165 -0
  70. data/dyncall/dyncall/dyncall_callvm_arm64.h +51 -0
  71. data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +272 -0
  72. data/dyncall/dyncall/dyncall_callvm_base.c +2 -1
  73. data/dyncall/dyncall/dyncall_callvm_mips.c +2 -1
  74. data/dyncall/dyncall/dyncall_callvm_mips.h +2 -1
  75. data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +2 -1
  76. data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +2 -1
  77. data/dyncall/dyncall/dyncall_callvm_mips_n32.c +2 -1
  78. data/dyncall/dyncall/dyncall_callvm_mips_n64.c +2 -1
  79. data/dyncall/dyncall/dyncall_callvm_mips_n64.h +2 -1
  80. data/dyncall/dyncall/dyncall_callvm_mips_o32.c +2 -1
  81. data/dyncall/dyncall/dyncall_callvm_mips_o32.h +2 -1
  82. data/dyncall/dyncall/dyncall_callvm_ppc32.c +45 -2
  83. data/dyncall/dyncall/dyncall_callvm_ppc32.h +2 -1
  84. data/dyncall/dyncall/dyncall_callvm_ppc64.c +351 -0
  85. data/dyncall/dyncall/dyncall_callvm_ppc64.h +60 -0
  86. data/dyncall/dyncall/dyncall_callvm_sparc.c +2 -1
  87. data/dyncall/dyncall/dyncall_callvm_sparc.h +2 -1
  88. data/dyncall/dyncall/dyncall_callvm_sparc64.c +2 -2
  89. data/dyncall/dyncall/dyncall_callvm_sparc64.h +2 -1
  90. data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +3 -3
  91. data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +2 -1
  92. data/dyncall/dyncall/dyncall_callvm_x64.c +2 -1
  93. data/dyncall/dyncall/dyncall_callvm_x64.h +2 -1
  94. data/dyncall/dyncall/dyncall_callvm_x86.c +2 -1
  95. data/dyncall/dyncall/dyncall_callvm_x86.h +2 -1
  96. data/dyncall/dyncall/dyncall_config.h +2 -1
  97. data/dyncall/dyncall/dyncall_macros.h +46 -9
  98. data/dyncall/dyncall/dyncall_signature.h +2 -1
  99. data/dyncall/dyncall/dyncall_struct.c +2 -1
  100. data/dyncall/dyncall/dyncall_struct.h +2 -1
  101. data/dyncall/dyncall/dyncall_types.h +2 -1
  102. data/dyncall/dyncall/dyncall_utils.h +2 -1
  103. data/dyncall/dyncall/dyncall_value.h +19 -1
  104. data/dyncall/dyncall/dyncall_vector.c +2 -1
  105. data/dyncall/dyncall/dyncall_vector.h +3 -1
  106. data/dyncall/dyncall/gen-masm.sh +0 -0
  107. data/dyncall/dyncallback/Makefile.generic +1 -1
  108. data/dyncall/dyncallback/dyncall_alloc_wx.c +2 -1
  109. data/dyncall/dyncallback/dyncall_alloc_wx.h +2 -1
  110. data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +2 -1
  111. data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +2 -1
  112. data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +2 -1
  113. data/dyncall/dyncallback/dyncall_args.c +22 -10
  114. data/dyncall/dyncallback/dyncall_args.h +2 -1
  115. data/dyncall/dyncallback/dyncall_args_arm32_arm.c +35 -4
  116. data/dyncall/dyncallback/dyncall_args_arm32_arm.h +7 -1
  117. data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +2 -1
  118. data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +2 -1
  119. data/dyncall/dyncallback/dyncall_args_arm64.c +77 -0
  120. data/dyncall/dyncallback/dyncall_args_arm64_apple.c +160 -0
  121. data/dyncall/dyncallback/dyncall_args_mips.c +3 -2
  122. data/dyncall/dyncallback/dyncall_args_mips.h +3 -2
  123. data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -1
  124. data/dyncall/dyncallback/dyncall_args_ppc32.h +9 -7
  125. data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +95 -0
  126. data/dyncall/dyncallback/dyncall_args_ppc64.c +71 -0
  127. data/dyncall/dyncallback/dyncall_args_ppc64.h +40 -0
  128. data/dyncall/dyncallback/dyncall_args_sparc32.c +2 -1
  129. data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -1
  130. data/dyncall/dyncallback/dyncall_args_sparc64.c +2 -1
  131. data/dyncall/dyncallback/dyncall_args_sparc64.h +2 -1
  132. data/dyncall/dyncallback/dyncall_args_x64.c +2 -1
  133. data/dyncall/dyncallback/dyncall_args_x64.h +2 -1
  134. data/dyncall/dyncallback/dyncall_args_x86.c +2 -1
  135. data/dyncall/dyncallback/dyncall_args_x86.h +2 -1
  136. data/dyncall/dyncallback/dyncall_callback.c +7 -2
  137. data/dyncall/dyncallback/dyncall_callback.h +3 -1
  138. data/dyncall/dyncallback/dyncall_callback_arch.S +14 -6
  139. data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +2 -1
  140. data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +2 -1
  141. data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +1 -1
  142. data/dyncall/dyncallback/{dyncall_callback_arm32_arm_gas.s → dyncall_callback_arm32_arm_gas.S} +17 -7
  143. data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +2 -1
  144. data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +2 -1
  145. data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_apple.s → dyncall_callback_arm32_thumb_apple.S} +2 -2
  146. data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_gas.s → dyncall_callback_arm32_thumb_gas.S} +2 -2
  147. data/dyncall/dyncallback/dyncall_callback_arm64.S +111 -0
  148. data/dyncall/dyncallback/dyncall_callback_arm64.c +71 -0
  149. data/dyncall/dyncallback/dyncall_callback_mips.c +3 -2
  150. data/dyncall/dyncallback/dyncall_callback_mips.h +3 -2
  151. data/dyncall/dyncallback/dyncall_callback_ppc32.S +115 -4
  152. data/dyncall/dyncallback/dyncall_callback_ppc32.c +3 -2
  153. data/dyncall/dyncallback/dyncall_callback_ppc32.h +6 -6
  154. data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +6 -5
  155. data/dyncall/dyncallback/dyncall_callback_ppc64.S +170 -0
  156. data/dyncall/dyncallback/dyncall_callback_ppc64.c +60 -0
  157. data/dyncall/dyncallback/dyncall_callback_ppc64.h +56 -0
  158. data/dyncall/dyncallback/dyncall_callback_sparc32.c +2 -1
  159. data/dyncall/dyncallback/dyncall_callback_sparc32.h +2 -1
  160. data/dyncall/dyncallback/dyncall_callback_sparc32.s +1 -1
  161. data/dyncall/dyncallback/dyncall_callback_sparc64.c +2 -1
  162. data/dyncall/dyncallback/dyncall_callback_sparc64.s +1 -1
  163. data/dyncall/dyncallback/dyncall_callback_x64.S +5 -12
  164. data/dyncall/dyncallback/dyncall_callback_x64.c +2 -1
  165. data/dyncall/dyncallback/dyncall_callback_x64.h +2 -1
  166. data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +0 -7
  167. data/dyncall/dyncallback/dyncall_callback_x86.S +5 -12
  168. data/dyncall/dyncallback/dyncall_callback_x86.c +2 -1
  169. data/dyncall/dyncallback/dyncall_callback_x86.h +2 -1
  170. data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +2 -11
  171. data/dyncall/dyncallback/dyncall_thunk.c +11 -3
  172. data/dyncall/dyncallback/dyncall_thunk.h +8 -2
  173. data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +7 -7
  174. data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +2 -1
  175. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +2 -1
  176. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +2 -1
  177. data/dyncall/dyncallback/dyncall_thunk_arm64.c +64 -0
  178. data/dyncall/dyncallback/dyncall_thunk_arm64.h +42 -0
  179. data/dyncall/dyncallback/dyncall_thunk_mips.c +49 -17
  180. data/dyncall/dyncallback/dyncall_thunk_mips.h +3 -2
  181. data/dyncall/dyncallback/dyncall_thunk_ppc32.c +3 -2
  182. data/dyncall/dyncallback/dyncall_thunk_ppc32.h +7 -7
  183. data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +50 -0
  184. data/dyncall/dyncallback/dyncall_thunk_ppc64.c +87 -0
  185. data/dyncall/dyncallback/dyncall_thunk_ppc64.h +55 -0
  186. data/dyncall/dyncallback/dyncall_thunk_sparc32.c +2 -1
  187. data/dyncall/dyncallback/dyncall_thunk_sparc32.h +2 -1
  188. data/dyncall/dyncallback/dyncall_thunk_sparc64.c +2 -1
  189. data/dyncall/dyncallback/dyncall_thunk_sparc64.h +2 -1
  190. data/dyncall/dyncallback/dyncall_thunk_x64.c +2 -1
  191. data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -1
  192. data/dyncall/dyncallback/dyncall_thunk_x86.c +2 -1
  193. data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -1
  194. data/dyncall/dyncallback/dyncallback.3 +3 -3
  195. data/dyncall/dyncallback/gen-masm.sh +0 -0
  196. data/dyncall/dynload/dynload.c +2 -1
  197. data/dyncall/dynload/dynload.h +2 -1
  198. data/dyncall/dynload/dynload_alloc.h +2 -1
  199. data/dyncall/dynload/dynload_darwin.c +2 -1
  200. data/dyncall/dynload/dynload_syms.c +2 -1
  201. data/dyncall/dynload/dynload_syms_elf.c +2 -1
  202. data/dyncall/dynload/dynload_syms_mach-o.c +3 -2
  203. data/dyncall/dynload/dynload_syms_pe.c +2 -1
  204. data/dyncall/dynload/dynload_unix.c +2 -1
  205. data/dyncall/dynload/dynload_windows.c +2 -1
  206. data/dyncall/portasm/gen-masm.sh +0 -0
  207. data/dyncall/portasm/portasm-arm.S +3 -2
  208. data/dyncall/portasm/portasm-ppc.S +2 -1
  209. data/dyncall/portasm/portasm-ppc64.S +119 -0
  210. data/dyncall/portasm/portasm-x64-att.S +2 -1
  211. data/dyncall/portasm/portasm-x86.S +2 -1
  212. metadata +39 -18
  213. data/dyncall/dyncallback/dyncall_callback_x64_apple.s +0 -122
  214. data/dyncall/dyncallback/dyncall_callback_x64_gas.s +0 -119
  215. data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +0 -102
@@ -6,7 +6,7 @@
6
6
  Description: ARM 32-bit "arm" ABI callvm implementation
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -24,6 +24,7 @@
24
24
  */
25
25
 
26
26
 
27
+
27
28
  /*
28
29
 
29
30
  dyncall callvm for 32bit ARM32 family of processors
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -24,6 +24,7 @@
24
24
  */
25
25
 
26
26
 
27
+
27
28
  /*
28
29
 
29
30
  dyncall callvm for 32bit ARM32 family of processors
@@ -2,11 +2,11 @@
2
2
 
3
3
  Package: dyncall
4
4
  Library: dyncall
5
- File: dyncall/arm_armhf.c
5
+ File: dyncall/dyncall_callvm_arm32_arm_armhf.c
6
6
  Description: ARM 'armhf' ABI implementation
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2012 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -23,13 +23,14 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #include "dyncall_callvm_arm32_arm_armhf.h"
27
28
  #include "dyncall_alloc.h"
28
29
 
29
30
 
30
31
  static DCCallVM* dc_callvm_new_arm32_armhf(DCCallVM_vt* vt, DCsize size)
31
32
  {
32
- /* Store at least 16 bytes (4 words) for internal spill area. Assembly code depends on it. */
33
+ /* Store at least 16 bytes (4 words for first 4 int args) for internal spill area. Assembly code depends on it. */
33
34
  DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)dcAllocMem(sizeof(DCCallVM_arm32_armhf)+size+16);
34
35
  dc_callvm_base_init(&p->mInterface, vt);
35
36
  dcVecInit(&p->mVecHead, size);
@@ -71,6 +72,7 @@ static void a_bool (DCCallVM* in_self, DCbool x) { a_int(in_self, (DCint)x);
71
72
  static void a_char (DCCallVM* in_self, DCchar x) { a_int(in_self, x); }
72
73
  static void a_short (DCCallVM* in_self, DCshort x) { a_int(in_self, x); }
73
74
  static void a_long (DCCallVM* in_self, DClong x) { a_int(in_self, x); }
75
+
74
76
  static void a_longlong(DCCallVM* in_self, DClonglong x)
75
77
  {
76
78
  DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)in_self;
@@ -85,6 +87,7 @@ static void a_longlong(DCCallVM* in_self, DClonglong x)
85
87
  dcVecAppend(&p->mVecHead, &x, sizeof(DClonglong));
86
88
  }
87
89
  }
90
+
88
91
  static void a_pointer(DCCallVM* in_p, DCpointer x) { a_int(in_p, (DCint) x ); }
89
92
 
90
93
  static void a_float(DCCallVM* in_p, DCfloat x)
@@ -99,44 +102,43 @@ static void a_float(DCCallVM* in_p, DCfloat x)
99
102
  }
100
103
  } else {
101
104
  dcVecAppend(&p->mVecHead, &x, sizeof(DCfloat));
102
- }
105
+ }
103
106
  }
104
107
 
105
108
  static void a_double(DCCallVM* in_p, DCdouble x)
106
109
  {
110
+ union {
111
+ DCdouble d;
112
+ DCchar b[8];
113
+ } v;
114
+
107
115
  DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)in_p;
108
116
  if (p->d < 16) {
109
117
  * (double*) &p->S[p->d] = x;
110
118
  p->d += 2;
111
119
  if (!(p->s & 1)) {
112
- /* if s is even it always equals d.
113
- otherwise, s points to an odd float register.
114
- */
120
+ /* if s is even it always equals d. otherwise, s points to an odd float register. */
115
121
  p->s = p->d;
116
122
  }
117
123
  } else {
118
- p->s = 16;
119
- union {
120
- DCdouble d;
121
- DCchar b[8];
122
- } v; // ,w;
124
+ p->s = 16; /* fp registers all full - need to use stack now: stop filling gaps for single precision, also */
123
125
  v.d = x;
124
- #if 0
125
- w.b[0] = v.b[7];
126
- w.b[1] = v.b[6];
127
- w.b[2] = v.b[5];
128
- w.b[3] = v.b[4];
129
- w.b[4] = v.b[3];
130
- w.b[5] = v.b[2];
131
- w.b[6] = v.b[1];
132
- w.b[7] = v.b[0];
133
- #endif
134
126
  /* 64 bit values need to be aligned on 8 byte boundaries */
135
127
  dcVecSkip(&p->mVecHead, dcVecSize(&p->mVecHead) & 4);
136
128
  dcVecAppend(&p->mVecHead, &v.b[0], sizeof(DCdouble));
137
129
  }
138
130
  }
139
131
 
132
+ static void a_float_ellipsis(DCCallVM* in_p, DCfloat x)
133
+ {
134
+ a_int(in_p, *(DCint*)&x);
135
+ }
136
+
137
+ static void a_double_ellipsis(DCCallVM* in_p, DCdouble x)
138
+ {
139
+ a_longlong(in_p, *(DClonglong*)&x);
140
+ }
141
+
140
142
  void call(DCCallVM* in_p, DCpointer target)
141
143
  {
142
144
  DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)in_p;
@@ -150,7 +152,7 @@ DCCallVM_vt vt_armhf =
150
152
  , &mode
151
153
  , &a_bool
152
154
  , &a_char
153
- , &a_short
155
+ , &a_short
154
156
  , &a_int
155
157
  , &a_long
156
158
  , &a_longlong
@@ -171,7 +173,35 @@ DCCallVM_vt vt_armhf =
171
173
  , NULL /* callStruct */
172
174
  };
173
175
 
174
- DCCallVM* dcNewCallVM(DCsize size)
176
+ DCCallVM_vt vt_armhf_ellipsis =
177
+ {
178
+ &deinit
179
+ , &reset
180
+ , &mode
181
+ , &a_bool
182
+ , &a_char
183
+ , &a_short
184
+ , &a_int
185
+ , &a_long
186
+ , &a_longlong
187
+ , &a_float_ellipsis
188
+ , &a_double_ellipsis
189
+ , &a_pointer
190
+ , NULL /* argStruct */
191
+ , (DCvoidvmfunc*) &call
192
+ , (DCboolvmfunc*) &call
193
+ , (DCcharvmfunc*) &call
194
+ , (DCshortvmfunc*) &call
195
+ , (DCintvmfunc*) &call
196
+ , (DClongvmfunc*) &call
197
+ , (DClonglongvmfunc*) &call
198
+ , (DCfloatvmfunc*) &call
199
+ , (DCdoublevmfunc*) &call
200
+ , (DCpointervmfunc*) &call
201
+ , NULL /* callStruct */
202
+ };
203
+
204
+ DCCallVM* dcNewCallVM(DCsize size)
175
205
  {
176
206
  #if defined(DC__ABI_ARM_EABI)
177
207
  return dc_callvm_new_arm32_arm(&eabi, size);
@@ -187,18 +217,18 @@ DCCallVM* dcNewCallVM(DCsize size)
187
217
  static void mode(DCCallVM* in_self,DCint mode)
188
218
  {
189
219
  DCCallVM_arm32_armhf* self = (DCCallVM_arm32_armhf*) in_self;
190
- DCCallVM_vt* vt;
191
220
  switch(mode) {
192
- case DC_CALL_C_DEFAULT:
221
+ case DC_CALL_C_DEFAULT:
222
+ case DC_CALL_C_ARM_ARMHF:
223
+ self->mInterface.mVTpointer = &vt_armhf;
224
+ break;
193
225
  case DC_CALL_C_ELLIPSIS:
194
226
  case DC_CALL_C_ELLIPSIS_VARARGS:
195
- case DC_CALL_C_ARM_ARMHF:
196
- vt = &vt_armhf;
227
+ self->mInterface.mVTpointer = &vt_armhf_ellipsis;
197
228
  break;
198
- default:
229
+ default:
199
230
  in_self->mError = DC_ERROR_UNSUPPORTED_MODE;
200
231
  return;
201
232
  }
202
- self->mInterface.mVTpointer = vt;
203
233
  }
204
234
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Package: dyncall
4
4
  Library: dyncall
5
- File: dyncall/dyncall_callvm_arm32_armhf.h
5
+ File: dyncall/dyncall_callvm_arm32_arm_armhf.h
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -24,6 +24,7 @@
24
24
  */
25
25
 
26
26
 
27
+
27
28
  /*
28
29
 
29
30
  dyncall callvm for 32bit ARM32 family of processors
@@ -6,7 +6,7 @@
6
6
  Description: ARM 32-bit "thumb" ABI callvm implementation
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -24,6 +24,7 @@
24
24
  */
25
25
 
26
26
 
27
+
27
28
  /*
28
29
 
29
30
  dyncall callvm for 32bit ARM32 family of processors
@@ -143,11 +144,6 @@ static void dc_callvm_argPointer_arm32_thumb(DCCallVM* in_self, DCpointer x)
143
144
  dcVecAppend(&self->mVecHead, &x, sizeof(DCpointer));
144
145
  }
145
146
 
146
- typedef void (*call_void) (DCpointer target, DCpointer data, DCsize size);
147
- typedef DClong (*call_word) (DCpointer target, DCpointer data, DCsize size);
148
- typedef DClonglong (*call_dword) (DCpointer target, DCpointer data, DCsize size);
149
-
150
-
151
147
 
152
148
  /* Call. */
153
149
  void dc_callvm_call_arm32_thumb(DCCallVM* in_self, DCpointer target)
@@ -157,24 +153,6 @@ void dc_callvm_call_arm32_thumb(DCCallVM* in_self, DCpointer target)
157
153
  }
158
154
 
159
155
 
160
- #if 0
161
- DClong dc_callvm_call_arm32_thumb_word(DCCallVM* in_self, DCpointer target)
162
- {
163
- DCCallVM_arm32_thumb* self = (DCCallVM_arm32_thumb*)in_self;
164
- // return dcCall_arm32_thumb_word(target, dcVecData(&self->mVecHead), dcVecSize(&self->mVecHead));
165
- return ( (call_word) dcCall_arm32_thumb) (target, dcVecData(&self->mVecHead), dcVecSize(&self->mVecHead));
166
- }
167
-
168
-
169
- DClonglong dc_callvm_call_arm32_thumb_dword(DCCallVM* in_self, DCpointer target)
170
- {
171
- DCCallVM_arm32_thumb* self = (DCCallVM_arm32_thumb*)in_self;
172
- // return dcCall_arm32_thumb_dword(target, dcVecData(&self->mVecHead), dcVecSize(&self->mVecHead));
173
- return ( (call_dword) dcCall_arm32_thumb ) (target, dcVecData(&self->mVecHead), dcVecSize(&self->mVecHead));
174
- }
175
- #endif
176
-
177
-
178
156
  DCCallVM_vt gVT_arm32_thumb =
179
157
  {
180
158
  &dc_callvm_free_arm32_thumb
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -24,6 +24,7 @@
24
24
  */
25
25
 
26
26
 
27
+
27
28
  /*
28
29
 
29
30
  dyncall callvm for 32bit ARM32 family of processors
@@ -0,0 +1,165 @@
1
+ /*
2
+
3
+ Package: dyncall
4
+ Library: dyncall
5
+ File: dyncall/dyncall_callvm_arm64.c
6
+ Description: ARM 64-bit ABI implementation
7
+ License:
8
+
9
+ Copyright (c) 2015 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
+ #include "dyncall_callvm_arm64.h"
28
+ #include "dyncall_alloc.h"
29
+
30
+ static DCCallVM* dc_callvm_new_arm64(DCCallVM_vt* vt, DCsize size)
31
+ {
32
+ DCCallVM_arm64* p = (DCCallVM_arm64*) dcAllocMem(size);
33
+
34
+ dc_callvm_base_init(&p->mInterface, vt);
35
+
36
+ dcVecInit(&p->mVecHead, size);
37
+
38
+ p->i = 0;
39
+ p->f = 0;
40
+
41
+ return (DCCallVM*)p;
42
+ }
43
+
44
+ static void reset(DCCallVM* in_p)
45
+ {
46
+ DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
47
+ p->i = 0;
48
+ p->f = 0;
49
+ dcVecReset(&p->mVecHead);
50
+ }
51
+
52
+
53
+ static void mode(DCCallVM* in_self,DCint mode);
54
+
55
+ static void deinit(DCCallVM* in_self)
56
+ {
57
+ dcFreeMem(in_self);
58
+ }
59
+
60
+
61
+
62
+ static void a_i64(DCCallVM* in_self, DClonglong x)
63
+ {
64
+ DCCallVM_arm64* p = (DCCallVM_arm64*)in_self;
65
+ if (p->i < 8) {
66
+ p->I[p->i] = x;
67
+ p->i++;
68
+ } else {
69
+ dcVecAppend(&p->mVecHead, &x, sizeof(DClonglong));
70
+ }
71
+ }
72
+
73
+ static void a_bool (DCCallVM* self, DCbool x) { a_i64(self, (DClonglong)x); }
74
+ static void a_char (DCCallVM* self, DCchar x) { a_i64(self, x); }
75
+ static void a_short (DCCallVM* self, DCshort x) { a_i64(self, x); }
76
+ static void a_int (DCCallVM* self, DCint x) { a_i64(self, x); }
77
+ static void a_long (DCCallVM* self, DClong x) { a_i64(self, x); }
78
+ static void a_pointer (DCCallVM* self, DCpointer x) { a_i64(self, (DClonglong) x ); }
79
+
80
+ static void a_float(DCCallVM* in_p, DCfloat x)
81
+ {
82
+ DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
83
+
84
+ if (p->f < 8) {
85
+ p->u.S[ p->f << 1 ] = x;
86
+ p->f++;
87
+ } else {
88
+ dcVecAppend(&p->mVecHead, &x, sizeof(DCfloat));
89
+ dcVecSkip(&p->mVecHead, 4); /* align to 8-bytes */
90
+ }
91
+ }
92
+
93
+ static void a_double(DCCallVM* in_p, DCdouble x)
94
+ {
95
+ DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
96
+ if (p->f < 8) {
97
+ p->u.D[ p->f ] = x;
98
+ p->f++;
99
+ } else {
100
+ dcVecAppend(&p->mVecHead, &x, sizeof(DCdouble));
101
+ }
102
+ }
103
+
104
+ void call(DCCallVM* in_p, DCpointer target)
105
+ {
106
+ DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
107
+
108
+ /*
109
+ ** copy 'size' argument is given in number of 16-byte 'pair' blocks.
110
+ */
111
+
112
+ dcCall_arm64(target, dcVecData(&p->mVecHead), ( dcVecSize(&p->mVecHead) + 15 ) & -16, &p->u.S[0]);
113
+ }
114
+
115
+ DCCallVM_vt vt_arm64 =
116
+ {
117
+ &deinit
118
+ , &reset
119
+ , &mode
120
+ , &a_bool
121
+ , &a_char
122
+ , &a_short
123
+ , &a_int
124
+ , &a_long
125
+ , &a_i64
126
+ , &a_float
127
+ , &a_double
128
+ , &a_pointer
129
+ , NULL /* argStruct */
130
+ , (DCvoidvmfunc*) &call
131
+ , (DCboolvmfunc*) &call
132
+ , (DCcharvmfunc*) &call
133
+ , (DCshortvmfunc*) &call
134
+ , (DCintvmfunc*) &call
135
+ , (DClongvmfunc*) &call
136
+ , (DClonglongvmfunc*) &call
137
+ , (DCfloatvmfunc*) &call
138
+ , (DCdoublevmfunc*) &call
139
+ , (DCpointervmfunc*) &call
140
+ , NULL /* callStruct */
141
+ };
142
+
143
+ DCCallVM* dcNewCallVM(DCsize size)
144
+ {
145
+ return dc_callvm_new_arm64(&vt_arm64, size);
146
+ }
147
+
148
+ static void mode(DCCallVM* in_self,DCint mode)
149
+ {
150
+ DCCallVM_arm64* self = (DCCallVM_arm64*) in_self;
151
+ DCCallVM_vt* vt;
152
+ switch(mode) {
153
+ case DC_CALL_C_DEFAULT:
154
+ case DC_CALL_C_ELLIPSIS:
155
+ case DC_CALL_C_ELLIPSIS_VARARGS:
156
+ case DC_CALL_C_ARM64:
157
+ vt = &vt_arm64;
158
+ break;
159
+ default:
160
+ in_self->mError = DC_ERROR_UNSUPPORTED_MODE;
161
+ return;
162
+ }
163
+ self->mInterface.mVTpointer = vt;
164
+ }
165
+