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: Simple dynamic vector container type 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
  #include "dyncall_vector.h"
28
29
  #include <string.h>
29
30
 
@@ -6,7 +6,7 @@
6
6
  Description: Simple dynamic vector container type header
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
  #ifndef DC_VECTOR_H
28
29
  #define DC_VECTOR_H
29
30
 
@@ -44,6 +45,7 @@ typedef struct
44
45
  #define dcVecData(p) ( (unsigned char*) (((DCVecHead*)(p))+1) )
45
46
  #define dcVecAt(p,index) ( dcVecData(p)+index )
46
47
  #define dcVecSize(p) ( (p)->mSize )
48
+ #define dcVecAlign(p,align) (p)->mSize=( (p)->mSize + align-1 ) & -align
47
49
 
48
50
  /*
49
51
  #include <string.h>
File without changes
@@ -1,6 +1,6 @@
1
1
  LIBNAME = dyncallback
2
2
  OBJS = dyncall_alloc_wx.o dyncall_args.o dyncall_callback.o dyncall_callback_arch.o dyncall_thunk.o
3
- HEADERS = ${VPATH}/dyncall_thunk.h ${VPATH}/dyncall_thunk_x86.h ${VPATH}/dyncall_thunk_ppc32.h ${VPATH}/dyncall_thunk_x64.h ${VPATH}/dyncall_thunk_arm32_arm.h ${VPATH}/dyncall_thunk_arm32_thumb.h ${VPATH}/dyncall_args.h ${VPATH}/dyncall_callback.h
3
+ HEADERS = ${VPATH}/dyncall_thunk.h ${VPATH}/dyncall_thunk_x86.h ${VPATH}/dyncall_thunk_ppc32.h ${VPATH}/dyncall_thunk_x64.h ${VPATH}/dyncall_thunk_arm32_arm.h ${VPATH}/dyncall_thunk_arm32_thumb.h ${VPATH}/dyncall_thunk_arm64.h ${VPATH}/dyncall_args.h ${VPATH}/dyncall_callback.h
4
4
  TOP = ${VPATH}/..
5
5
  CFLAGS += -I${TOP}/dyncall
6
6
 
@@ -6,7 +6,7 @@
6
6
  Description: Allocate write/executable memory - Implementation back-end selector (mmap or win32)
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #include "../dyncall/dyncall_macros.h"
27
28
 
28
29
  #if defined(DC_WINDOWS)
@@ -6,7 +6,7 @@
6
6
  Description: Allocate write/executable memory - Interface
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #ifndef DYNCALL_ALLOC_WX_HPP
27
28
  #define DYNCALL_ALLOC_WX_HPP
28
29
 
@@ -6,7 +6,7 @@
6
6
  Description: Allocate write/executable memory - Fallback implementation based
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #include "dyncall_alloc_wx.h"
27
28
 
28
29
  #include <stdlib.h>
@@ -6,7 +6,7 @@
6
6
  Description: Allocate write/executable memory - Implementation for posix
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #include "dyncall_alloc_wx.h"
27
28
 
28
29
  #include <sys/types.h>
@@ -6,7 +6,7 @@
6
6
  Description: Allocate write/executable memory - Implementation for win32 platform
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #include "dyncall_alloc_wx.h"
27
28
  #include <windows.h>
28
29
  #include <assert.h>
@@ -6,7 +6,7 @@
6
6
  Description: Callback's Arguments VM - Implementation back-end selector
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
@@ -26,20 +26,32 @@
26
26
  #include "../dyncall/dyncall_macros.h"
27
27
 
28
28
  #if defined(DC__Arch_Intel_x86)
29
- #include "dyncall_args_x86.c"
29
+ # include "dyncall_args_x86.c"
30
30
  #elif defined (DC__Arch_AMD64)
31
- #include "dyncall_args_x64.c"
32
- #elif defined (DC__Arch_PowerPC)
33
- #include "dyncall_args_ppc32.c"
31
+ # include "dyncall_args_x64.c"
32
+ #elif defined (DC__Arch_PPC32)
33
+ # if defined (DC__OS_Darwin)
34
+ # include "dyncall_args_ppc32.c"
35
+ # else
36
+ # include "dyncall_args_ppc32_sysv.c"
37
+ # endif
38
+ #elif defined (DC__Arch_PPC64)
39
+ # include "dyncall_args_ppc64.c"
34
40
  #elif defined (DC__Arch_ARM_ARM)
35
- #include "dyncall_args_arm32_arm.c"
41
+ # include "dyncall_args_arm32_arm.c"
36
42
  #elif defined (DC__Arch_ARM_THUMB)
37
- #include "dyncall_args_arm32_thumb.c"
43
+ # include "dyncall_args_arm32_thumb.c"
38
44
  #elif defined (DC__Arch_MIPS)
39
- #include "dyncall_args_mips.c"
45
+ # include "dyncall_args_mips.c"
40
46
  #elif defined (DC__Arch_Sparc)
41
- #include "dyncall_args_sparc32.c"
47
+ # include "dyncall_args_sparc32.c"
42
48
  #elif defined (DC__Arch_Sparcv9)
43
- #include "dyncall_args_sparc64.c"
49
+ # include "dyncall_args_sparc64.c"
50
+ #elif defined (DC__Arch_ARM64)
51
+ # if defined (DC__OS_Darwin)
52
+ # include "dyncall_args_arm64_apple.c"
53
+ # else
54
+ # include "dyncall_args_arm64.c"
55
+ # endif
44
56
  #endif
45
57
 
@@ -6,7 +6,7 @@
6
6
  Description: Callback's Arguments VM - Interface
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #ifndef DYNCALL_ARGS_H
27
28
  #define DYNCALL_ARGS_H
28
29
 
@@ -6,7 +6,7 @@
6
6
  Description: Callback's Arguments VM - Implementation for ARM32 (ARM mode)
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
  #include "dyncall_args_arm32_arm.h"
28
29
 
29
30
 
@@ -35,7 +36,7 @@ static void arm_align_64(DCArgs* args)
35
36
  /* @@@ check signature string */
36
37
 
37
38
  int sig =
38
- #if defined(DC__ABI_ARM_EABI)
39
+ #if defined(DC__ABI_ARM_EABI) || defined(DC__ABI_ARM_HF)
39
40
  0; /* EABI */
40
41
  #else
41
42
  1; /* ATPCS */
@@ -57,6 +58,22 @@ static void* arm_word(DCArgs* args)
57
58
  return (void*)args->stack_ptr++;
58
59
  }
59
60
 
61
+ static DCfloat arm_float(DCArgs* args)
62
+ {
63
+ #if defined(DC__ABI_ARM_HF)
64
+ DCfloat f;
65
+ if(args->freg_count < 16) {
66
+ f = args->f[args->freg_count++];
67
+
68
+ /* if freg_count was odd, sync with dreg_count */
69
+ if(!(args->freg_count & 1) && (args->freg_count < args->dreg_count))
70
+ args->freg_count = args->dreg_count;
71
+
72
+ return f;
73
+ }
74
+ #endif
75
+ return *(DCfloat*)arm_word(args);
76
+ }
60
77
 
61
78
  static DCdouble arm_double(DCArgs* args)
62
79
  {
@@ -64,13 +81,27 @@ static DCdouble arm_double(DCArgs* args)
64
81
  DCdouble d;
65
82
  DClong l[2];
66
83
  } d;
84
+ #if defined(DC__ABI_ARM_HF)
85
+ if(args->dreg_count < args->freg_count)
86
+ args->dreg_count = (args->freg_count+1)&0x1e; /* clear last bit, counter won't be higher than 16, anyways */
87
+
88
+ if(args->dreg_count < 16) {
89
+ d.d = *(DCdouble*)&args->f[args->dreg_count];
90
+ args->dreg_count += 2;
91
+
92
+ /* freg_count is either odd (pointing to a gap), or always the same as dreg_count */
93
+ if(!(args->freg_count & 1))
94
+ args->freg_count = args->dreg_count;
95
+ return d.d;
96
+ }
97
+ args->freg_count = 16; /* fp registers all full - need to use stack now: stop filling gaps for single precision, also */
98
+ #endif
67
99
  arm_align_64(args);
68
100
  d.l[0] = *(DClong*)arm_word(args);
69
101
  d.l[1] = *(DClong*)arm_word(args);
70
102
  return d.d;
71
103
  }
72
104
 
73
-
74
105
  static DClonglong arm_longlong(DCArgs* args)
75
106
  {
76
107
  union {
@@ -108,5 +139,5 @@ DCulonglong dcbArgULongLong(DCArgs* p) { return (DCulonglong)dcbArgLongLong(p);
108
139
  DCpointer dcbArgPointer (DCArgs* p) { return (DCpointer) dcbArgLong(p); }
109
140
 
110
141
  DCdouble dcbArgDouble (DCArgs* p) { return arm_double(p); }
111
- DCfloat dcbArgFloat (DCArgs* p) { return *(DCfloat*) arm_word(p); }
142
+ DCfloat dcbArgFloat (DCArgs* p) { return arm_float(p); }
112
143
 
@@ -6,7 +6,7 @@
6
6
  Description: Callback's Arguments VM - Header for ARM32 (ARM mode)
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #ifndef DYNCALLBACK_ARGS_ARM32_ARM_H
27
28
  #define DYNCALLBACK_ARGS_ARM32_ARM_H
28
29
 
@@ -34,6 +35,11 @@ struct DCArgs
34
35
  long reg_data[4];
35
36
  int reg_count;
36
37
  long* stack_ptr;
38
+ #if defined(DC__ABI_ARM_HF)
39
+ DCfloat f[16];
40
+ int freg_count;
41
+ int dreg_count;
42
+ #endif
37
43
  };
38
44
 
39
45
  #endif /* DYNCALLBACK_ARGS_ARM32_ARM_H */
@@ -6,7 +6,7 @@
6
6
  Description: Callback's Arguments VM - Implementation for ARM32 (THUMB mode)
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
  #include "dyncall_args_arm32_thumb.h"
28
29
  #include "dyncall_args_arm32_arm.c" /* Uses same code as ARM mode. */
29
30
 
@@ -6,7 +6,7 @@
6
6
  Description: Callback's Arguments VM - Header for ARM32 (THUMB mode)
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
@@ -23,6 +23,7 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #ifndef DYNCALLBACK_ARGS_ARM32_THUMB_H
27
28
  #define DYNCALLBACK_ARGS_ARM32_THUMB_H
28
29
 
@@ -0,0 +1,77 @@
1
+ /*
2
+
3
+ Package: dyncall
4
+ Library: dyncallback
5
+ File: dyncallback/dyncall_args_arm64.c
6
+ Description: Callback's Arguments VM - Implementation for ARM64 / ARMv8 / AAPCS64
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
+ #include "dyncall_args.h"
26
+
27
+ #include <stdint.h>
28
+
29
+ typedef union {
30
+ struct { double value; } d;
31
+ struct { float value; } f;
32
+ } DCFPU_t;
33
+
34
+ struct DCArgs
35
+ {
36
+ /* buffers and stack-pointer: */
37
+
38
+ uint64_t I[8];
39
+ DCFPU_t F[8];
40
+ uint64_t* sp;
41
+
42
+ /* counters: */
43
+ int i;
44
+ int f;
45
+ int s;
46
+ int reserved;
47
+ };
48
+
49
+ DClonglong dcbArgLongLong (DCArgs* p)
50
+ {
51
+ if (p->i < 8) {
52
+ return p->I[p->i++];
53
+ } else {
54
+ return *(p->sp)++;
55
+ }
56
+ }
57
+ DCdouble dcbArgDouble (DCArgs* p) {
58
+ return (p->f < 8) ? p->F[p->f++].d.value : * ( (double*) (p->sp++) );
59
+ }
60
+ DCfloat dcbArgFloat (DCArgs* p) {
61
+ return (p->f < 8) ? p->F[p->f++].f.value : * ( (float*) (p->sp++) );
62
+ }
63
+
64
+
65
+ DClong dcbArgLong (DCArgs* p) { return (DClong) dcbArgLongLong(p); }
66
+ DCint dcbArgInt (DCArgs* p) { return (DCint) dcbArgLongLong(p); }
67
+ DCshort dcbArgShort (DCArgs* p) { return (DCshort) dcbArgLongLong(p); }
68
+ DCchar dcbArgChar (DCArgs* p) { return (DCchar) dcbArgLongLong(p); }
69
+ DCbool dcbArgBool (DCArgs* p) { return dcbArgLongLong(p) & 0x1; }
70
+ DCpointer dcbArgPointer(DCArgs* p) { return (DCpointer) dcbArgLongLong(p); }
71
+
72
+ DCuint dcbArgUInt (DCArgs* p) { return (DCuint) dcbArgInt(p); }
73
+ DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgChar(p); }
74
+ DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgShort(p); }
75
+ DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgLong(p); }
76
+ DCulonglong dcbArgULongLong(DCArgs* p) { return (DCulonglong) dcbArgLongLong(p); }
77
+
@@ -0,0 +1,160 @@
1
+ /*
2
+
3
+ Package: dyncall
4
+ Library: dyncallback
5
+ File: dyncallback/dyncall_args_arm64_apple.c
6
+ Description: Callback's Arguments VM - Implementation for Apple's ARM64 / ARMv8 / AAPCS64
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
+ #include "dyncall_args.h"
27
+
28
+ #include <stdint.h>
29
+
30
+ typedef union {
31
+ struct { double value; } d;
32
+ struct { float value; } f;
33
+ } DCFPU_t;
34
+
35
+ struct DCArgs
36
+ {
37
+ /* buffers and stack-pointer: */
38
+
39
+ uint64_t I[8];
40
+ DCFPU_t F[8];
41
+ uint8_t* sp;
42
+
43
+ /* counters: */
44
+ int i;
45
+ int f;
46
+ int s;
47
+ int reserved;
48
+ };
49
+
50
+ static inline uint8_t* align(uint8_t* p, size_t v)
51
+ {
52
+ return (uint8_t*) ( ( ( (ptrdiff_t) p ) + v - 1) & (ptrdiff_t) -v );
53
+ }
54
+
55
+
56
+ DClonglong dcbArgLongLong (DCArgs* p)
57
+ {
58
+ if (p->i < 8) {
59
+ return p->I[p->i++];
60
+ } else {
61
+ DClonglong value;
62
+ p->sp = align(p->sp,sizeof(DClonglong));
63
+ value = * ( (DClonglong*) p->sp );
64
+ p->sp += sizeof(DClonglong);
65
+ return value;
66
+ }
67
+ }
68
+ DCdouble dcbArgDouble (DCArgs* p) {
69
+ if (p->f < 8) {
70
+ return p->F[p->f++].d.value;
71
+ } else {
72
+ DCdouble value;
73
+ p->sp = align(p->sp,sizeof(DCdouble));
74
+ value = * ( (DCdouble*) p->sp );
75
+ p->sp += sizeof(DCdouble);
76
+ return value;
77
+ }
78
+ }
79
+ DCfloat dcbArgFloat (DCArgs* p) {
80
+ if (p->f < 8) {
81
+ return p->F[p->f++].f.value;
82
+ } else {
83
+ DCfloat value;
84
+ p->sp = align(p->sp,sizeof(DCfloat));
85
+ value = * ( (DCfloat*) p->sp );
86
+ p->sp += sizeof(DCfloat);
87
+ return value;
88
+ }
89
+ }
90
+
91
+ DClong dcbArgLong (DCArgs* p) {
92
+ if (p->i < 8) {
93
+ return (DClong) p->I[p->i++];
94
+ } else {
95
+ DClong value;
96
+ p->sp = align(p->sp,sizeof(DClong));
97
+ value = * ( (DClong*) p->sp );
98
+ p->sp += sizeof(DClong);
99
+ return value;
100
+ }
101
+ }
102
+
103
+ DCint dcbArgInt (DCArgs* p) {
104
+ if (p->i < 8) {
105
+ return (DCint) p->I[p->i++];
106
+ } else {
107
+ DCint value;
108
+ p->sp = align(p->sp,sizeof(DCint));
109
+ value = * ( (DCint*) p->sp );
110
+ p->sp += sizeof(DCint);
111
+ return value;
112
+ }
113
+ }
114
+
115
+ DCshort dcbArgShort (DCArgs* p) {
116
+ if (p->i < 8) {
117
+ return (DCshort) p->I[p->i++];
118
+ } else {
119
+ DCshort value;
120
+ p->sp = align(p->sp,sizeof(DCshort));
121
+ value = * ( (DCshort*) p->sp );
122
+ p->sp += sizeof(DCshort);
123
+ return value;
124
+ }
125
+ }
126
+
127
+ DCchar dcbArgChar (DCArgs* p) {
128
+ if (p->i < 8) {
129
+ return (DCchar) p->I[p->i++];
130
+ } else {
131
+ DCchar value;
132
+ p->sp = align(p->sp,sizeof(DCchar));
133
+ value = * ( (DCchar*) p->sp );
134
+ p->sp += sizeof(DCchar);
135
+ return value;
136
+ }
137
+ }
138
+
139
+ DCbool dcbArgBool (DCArgs* p) {
140
+ if (p->i < 8) {
141
+ return (DCbool) p->I[p->i++];
142
+ } else {
143
+ DCbool value;
144
+ p->sp = align(p->sp,sizeof(DCbool));
145
+ value = * ( (DCbool*) p->sp );
146
+ p->sp += sizeof(DCbool);
147
+ return value;
148
+ }
149
+ }
150
+
151
+ DCpointer dcbArgPointer(DCArgs* p) {
152
+ return (DCpointer) dcbArgLongLong(p);
153
+ }
154
+
155
+ DCuint dcbArgUInt (DCArgs* p) { return (DCuint) dcbArgInt(p); }
156
+ DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgChar(p); }
157
+ DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgShort(p); }
158
+ DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgLong(p); }
159
+ DCulonglong dcbArgULongLong(DCArgs* p) { return (DCulonglong) dcbArgLongLong(p); }
160
+