rbdc 0.8.7 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/{bindings → dyncall-bindings}/ruby/rbdc/extconf.rb +1 -1
- data/{bindings → dyncall-bindings}/ruby/rbdc/rbdc.c +3 -1
- data/dyncall/AUTHORS +2 -0
- data/dyncall/BUGS +1 -0
- data/dyncall/CMakeLists.txt +10 -2
- data/dyncall/ChangeLog +46 -11
- data/dyncall/LICENSE +4 -1
- data/dyncall/Makefile.embedded +7 -3
- data/dyncall/README +23 -14
- data/dyncall/ToDo +27 -28
- data/dyncall/autovar/autovar_ABI.h +3 -2
- data/dyncall/autovar/autovar_ARCH.h +13 -10
- data/dyncall/autovar/autovar_CC.h +3 -2
- data/dyncall/autovar/autovar_OS.h +3 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +3 -2
- data/dyncall/buildsys/scripts/batch-build-linux.sh +6 -2
- data/dyncall/buildsys/scripts/batch-build-minix.sh +2 -0
- data/dyncall/buildsys/scripts/batch-build-psp.sh +4 -1
- data/dyncall/buildsys/scripts/elf-to-psp-eboot.sh +19 -0
- data/dyncall/buildsys/scripts/setenv-cross-ios.sh +0 -0
- data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +0 -0
- data/dyncall/configure +83 -30
- data/dyncall/dyncall/dyncall.3 +16 -4
- data/dyncall/dyncall/dyncall.h +9 -1
- data/dyncall/dyncall/dyncall_alloc.h +2 -1
- data/dyncall/dyncall/dyncall_api.c +2 -1
- data/dyncall/dyncall/dyncall_call.S +9 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +2 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +8 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +11 -19
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +15 -2
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +8 -6
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +10 -18
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +0 -16
- data/dyncall/dyncall/dyncall_call_arm64.S +226 -0
- data/dyncall/dyncall/dyncall_call_arm64.h +45 -0
- data/dyncall/dyncall/dyncall_call_mips.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -1
- data/dyncall/dyncall/dyncall_call_mips_n32.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_n64.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_o32.h +2 -1
- data/dyncall/dyncall/dyncall_call_ppc32.S +27 -2
- data/dyncall/dyncall/dyncall_call_ppc32.h +2 -2
- data/dyncall/dyncall/dyncall_call_ppc64.S +210 -0
- data/dyncall/dyncall/dyncall_call_ppc64.h +55 -0
- data/dyncall/dyncall/dyncall_call_sparc.S +2 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +2 -1
- data/dyncall/dyncall/dyncall_call_sparc64.S +2 -1
- data/dyncall/dyncall/dyncall_call_sparc64.h +2 -1
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +25 -23
- data/dyncall/dyncall/dyncall_call_sparc_v9.h +2 -1
- data/dyncall/dyncall/dyncall_call_x64-att.S +2 -1
- data/dyncall/dyncall/dyncall_call_x64.S +2 -1
- data/dyncall/dyncall/dyncall_call_x64.h +2 -1
- data/dyncall/dyncall/dyncall_call_x86.S +2 -1
- data/dyncall/dyncall/dyncall_call_x86.h +2 -1
- data/dyncall/dyncall/dyncall_callf.c +56 -66
- data/dyncall/dyncall/dyncall_callf.h +5 -1
- data/dyncall/dyncall/dyncall_callvm.c +11 -2
- data/dyncall/dyncall/dyncall_callvm.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +60 -30
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +3 -2
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +2 -24
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm64.c +165 -0
- data/dyncall/dyncall/dyncall_callvm_arm64.h +51 -0
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +272 -0
- data/dyncall/dyncall/dyncall_callvm_base.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +45 -2
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +351 -0
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +60 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +2 -2
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +3 -3
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_x64.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_x64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_x86.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_x86.h +2 -1
- data/dyncall/dyncall/dyncall_config.h +2 -1
- data/dyncall/dyncall/dyncall_macros.h +46 -9
- data/dyncall/dyncall/dyncall_signature.h +2 -1
- data/dyncall/dyncall/dyncall_struct.c +2 -1
- data/dyncall/dyncall/dyncall_struct.h +2 -1
- data/dyncall/dyncall/dyncall_types.h +2 -1
- data/dyncall/dyncall/dyncall_utils.h +2 -1
- data/dyncall/dyncall/dyncall_value.h +19 -1
- data/dyncall/dyncall/dyncall_vector.c +2 -1
- data/dyncall/dyncall/dyncall_vector.h +3 -1
- data/dyncall/dyncall/gen-masm.sh +0 -0
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +2 -1
- data/dyncall/dyncallback/dyncall_args.c +22 -10
- data/dyncall/dyncallback/dyncall_args.h +2 -1
- data/dyncall/dyncallback/dyncall_args_arm32_arm.c +35 -4
- data/dyncall/dyncallback/dyncall_args_arm32_arm.h +7 -1
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/dyncall_args_arm64.c +77 -0
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +160 -0
- data/dyncall/dyncallback/dyncall_args_mips.c +3 -2
- data/dyncall/dyncallback/dyncall_args_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -1
- data/dyncall/dyncallback/dyncall_args_ppc32.h +9 -7
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +95 -0
- data/dyncall/dyncallback/dyncall_args_ppc64.c +71 -0
- data/dyncall/dyncallback/dyncall_args_ppc64.h +40 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc64.h +2 -1
- data/dyncall/dyncallback/dyncall_args_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +2 -1
- data/dyncall/dyncallback/dyncall_callback.c +7 -2
- data/dyncall/dyncallback/dyncall_callback.h +3 -1
- data/dyncall/dyncallback/dyncall_callback_arch.S +14 -6
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +1 -1
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm_gas.s → dyncall_callback_arm32_arm_gas.S} +17 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_apple.s → dyncall_callback_arm32_thumb_apple.S} +2 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_gas.s → dyncall_callback_arm32_thumb_gas.S} +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.S +111 -0
- data/dyncall/dyncallback/dyncall_callback_arm64.c +71 -0
- data/dyncall/dyncallback/dyncall_callback_mips.c +3 -2
- data/dyncall/dyncallback/dyncall_callback_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +115 -4
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +3 -2
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +6 -6
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +6 -5
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +170 -0
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +60 -0
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +56 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +1 -1
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +1 -1
- data/dyncall/dyncallback/dyncall_callback_x64.S +5 -12
- data/dyncall/dyncallback/dyncall_callback_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +0 -7
- data/dyncall/dyncallback/dyncall_callback_x86.S +5 -12
- data/dyncall/dyncallback/dyncall_callback_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_x86.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +2 -11
- data/dyncall/dyncallback/dyncall_thunk.c +11 -3
- data/dyncall/dyncallback/dyncall_thunk.h +8 -2
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +64 -0
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +42 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.c +49 -17
- data/dyncall/dyncallback/dyncall_thunk_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +3 -2
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +7 -7
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +50 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +87 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc64.h +55 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -1
- data/dyncall/dyncallback/dyncallback.3 +3 -3
- data/dyncall/dyncallback/gen-masm.sh +0 -0
- data/dyncall/dynload/dynload.c +2 -1
- data/dyncall/dynload/dynload.h +2 -1
- data/dyncall/dynload/dynload_alloc.h +2 -1
- data/dyncall/dynload/dynload_darwin.c +2 -1
- data/dyncall/dynload/dynload_syms.c +2 -1
- data/dyncall/dynload/dynload_syms_elf.c +2 -1
- data/dyncall/dynload/dynload_syms_mach-o.c +3 -2
- data/dyncall/dynload/dynload_syms_pe.c +2 -1
- data/dyncall/dynload/dynload_unix.c +2 -1
- data/dyncall/dynload/dynload_windows.c +2 -1
- data/dyncall/portasm/gen-masm.sh +0 -0
- data/dyncall/portasm/portasm-arm.S +3 -2
- data/dyncall/portasm/portasm-ppc.S +2 -1
- data/dyncall/portasm/portasm-ppc64.S +119 -0
- data/dyncall/portasm/portasm-x64-att.S +2 -1
- data/dyncall/portasm/portasm-x86.S +2 -1
- metadata +39 -18
- data/dyncall/dyncallback/dyncall_callback_x64_apple.s +0 -122
- data/dyncall/dyncallback/dyncall_callback_x64_gas.s +0 -119
- data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +0 -102
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Interface
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
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
|
@@ -32,6 +32,8 @@
|
|
32
32
|
|
33
33
|
typedef struct DCCallback DCCallback;
|
34
34
|
|
35
|
+
// TODO: return value is the type encoded as a signature char (character of the set [vBcCsSiIjJlLfd]).
|
36
|
+
|
35
37
|
typedef char (DCCallbackHandler)(DCCallback* pcb, DCArgs* args, DCValue* result, void* userdata);
|
36
38
|
|
37
39
|
#ifdef __cplusplus
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback Thunk - Implementation Back-end selector
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
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
|
@@ -40,32 +40,40 @@
|
|
40
40
|
# error Unsupported Architecture on Plan9.
|
41
41
|
# endif
|
42
42
|
#elif defined(DC__OS_Darwin)
|
43
|
-
# if defined(
|
43
|
+
# if defined(DC__Arch_PPC32)
|
44
44
|
# include "dyncall_callback_ppc32_apple.s"
|
45
45
|
# elif defined(DC__Arch_ARM_ARM)
|
46
46
|
# include "dyncall_callback_arm32_arm_apple.s"
|
47
47
|
# elif defined(DC__Arch_ARM_THUMB)
|
48
|
-
# include "dyncall_callback_arm32_thumb_apple.
|
48
|
+
# include "dyncall_callback_arm32_thumb_apple.S"
|
49
49
|
# elif defined(DC__Arch_AMD64)
|
50
50
|
# include "dyncall_callback_x64.S"
|
51
51
|
# elif defined(DC__Arch_Intel_x86)
|
52
52
|
# include "dyncall_callback_x86.S"
|
53
|
+
# elif defined(DC__Arch_ARM64)
|
54
|
+
# include "dyncall_callback_arm64.S"
|
55
|
+
# else // e.g. PowerPC G5, which is PPC64, etc.
|
56
|
+
# error Unsupported Architecture on Darwin/OS X.
|
53
57
|
# endif
|
54
58
|
#else
|
55
59
|
# if defined(DC__Arch_Intel_x86)
|
56
60
|
# include "dyncall_callback_x86.S"
|
57
61
|
# elif defined(DC__Arch_AMD64)
|
58
62
|
# include "dyncall_callback_x64.S"
|
59
|
-
# elif defined(
|
63
|
+
# elif defined(DC__Arch_PPC32)
|
60
64
|
# include "dyncall_callback_ppc32.S"
|
65
|
+
# elif defined(DC__Arch_PPC64)
|
66
|
+
# include "dyncall_callback_ppc64.S"
|
61
67
|
# elif defined(DC__Arch_ARM_ARM)
|
62
|
-
# include "dyncall_callback_arm32_arm_gas.
|
68
|
+
# include "dyncall_callback_arm32_arm_gas.S"
|
63
69
|
# elif defined(DC__Arch_ARM_THUMB)
|
64
|
-
# include "dyncall_callback_arm32_thumb_gas.
|
70
|
+
# include "dyncall_callback_arm32_thumb_gas.S"
|
65
71
|
# elif defined(DC__Arch_Sparc)
|
66
72
|
# include "dyncall_callback_sparc32.s"
|
67
73
|
# elif defined(DC__Arch_Sparcv9)
|
68
74
|
# include "dyncall_callback_sparc64.s"
|
75
|
+
# elif defined(DC__Arch_ARM64)
|
76
|
+
# include "dyncall_callback_arm64.S"
|
69
77
|
# endif
|
70
78
|
#endif
|
71
79
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Implementation for ARM32 (ARM mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
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_callback_arm32_arm.h"
|
28
29
|
#include "dyncall_args_arm32_arm.h"
|
29
30
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Header for ARM32 (ARM mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
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 DYNCALL_CALLBACK_ARM32_ARM_H_
|
28
29
|
#define DYNCALL_CALLBACK_ARM32_ARM_H_
|
29
30
|
|
@@ -32,13 +32,13 @@
|
|
32
32
|
/* sizes */
|
33
33
|
.set DCThunk_size , 8
|
34
34
|
.set DCArgs_size , 24
|
35
|
+
.set DCCallback_size, 20
|
35
36
|
.set DCValue_size , 8
|
36
37
|
|
37
38
|
/* struct DCCallback offsets and size */
|
38
39
|
.set CTX_thunk , 0
|
39
40
|
.set CTX_handler , 12
|
40
41
|
.set CTX_userdata , 16
|
41
|
-
.set DCCallback_size, 20
|
42
42
|
|
43
43
|
|
44
44
|
/* Called by thunk - thunk stores pointer to DCCallback in r12 */
|
data/dyncall/dyncallback/{dyncall_callback_arm32_arm_gas.s → dyncall_callback_arm32_arm_gas.S}
RENAMED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/dyncall_callback_arm32_arm_gas.
|
5
|
+
File: dyncallback/dyncall_callback_arm32_arm_gas.S
|
6
6
|
Description: Callback Thunk - Implementation for ARM32 (ARM mode)
|
7
7
|
License:
|
8
8
|
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
#include "../dyncall/dyncall_macros.h"
|
26
27
|
|
27
28
|
.text
|
28
29
|
.code 32 /* ARM mode */
|
@@ -30,15 +31,16 @@
|
|
30
31
|
.globl dcCallbackThunkEntry
|
31
32
|
|
32
33
|
/* sizes */
|
33
|
-
.set DCThunk_size , 8
|
34
|
-
.set DCArgs_size , 24
|
34
|
+
/* .set DCThunk_size , 8 */
|
35
|
+
/* .set DCArgs_size , 24 */ /* for EABI/ATPCS/... */
|
36
|
+
/* .set DCArgs_size , 96 */ /* for armhf */
|
37
|
+
/* .set DCCallback_size, 20 */
|
35
38
|
.set DCValue_size , 8
|
36
39
|
|
37
40
|
/* struct DCCallback offsets and size */
|
38
|
-
.set CTX_thunk , 0
|
41
|
+
/* .set CTX_thunk , 0 */
|
39
42
|
.set CTX_handler , 12
|
40
43
|
.set CTX_userdata , 16
|
41
|
-
.set DCCallback_size, 20
|
42
44
|
|
43
45
|
|
44
46
|
/* Called by thunk - thunk stores pointer to DCCallback in r12 */
|
@@ -51,7 +53,12 @@ dcCallbackThunkEntry:
|
|
51
53
|
|
52
54
|
/* Grab arguments. */
|
53
55
|
mov %r4, #0
|
54
|
-
|
56
|
+
#if defined(DC__ABI_ARM_HF)
|
57
|
+
stmdb %r13!, {%r4} /* Init freg_count and dreg_count to 0 */
|
58
|
+
stmdb %r13!, {%r4}
|
59
|
+
fstmdbd %r13!, {d0-d7} /* Store all fp-registers in DCArgs' f[16] */
|
60
|
+
#endif
|
61
|
+
stmdb %r13!, {%r0-%r4, %r11} /* Spill first 4 args to DCArgs, along with reg_count (init to 0) and (stack) pointer to remaining args. */
|
55
62
|
|
56
63
|
/* Prepare callback handler call. */
|
57
64
|
mov %r0, %r12 /* Parameter 0 (r0) = DCCallback pointer (r12, pointer to thunk). */
|
@@ -62,11 +69,14 @@ dcCallbackThunkEntry:
|
|
62
69
|
|
63
70
|
/* Call. */
|
64
71
|
ldr %r4, [%r12, #CTX_handler] /* Load callback handler pointer into r4. */
|
65
|
-
mov %r14, %r15 /* Branch return address(r15) -> link register (r14) -- r15 always points to address of current + 2 instructions (= Epilog code). */
|
72
|
+
mov %r14, %r15 /* Branch return address(r15) -> link register (r14) -- r15 always points to address of current + 2 instructions (= Epilog code). */
|
66
73
|
bx %r4 /* Call. */
|
67
74
|
|
68
75
|
/* Return value. */
|
69
76
|
ldmia %r13, {%r0, %r1} /* Load return value in r0 and r1. */
|
77
|
+
#if defined(DC__ABI_ARM_HF)
|
78
|
+
fldmiad %r13, {%d0} /* Same for floating point return value (if any). */
|
79
|
+
#endif
|
70
80
|
|
71
81
|
/* Epilog. */
|
72
82
|
ldmdb %r11, {%r4-%r11, %r13, %r15} /* Restore permanent registers (restore stack ptr and program counter).@@@db not needed since we rewrite r13? */
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Implementation for ARM32 (THUMB mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
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_callback_arm32_thumb.h"
|
28
29
|
#include "dyncall_callback_arm32_arm.c" /* Uses same code as ARM mode. */
|
29
30
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Header for ARM32 (THUMB mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
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 DYNCALL_CALLBACK_ARM32_THUMB_H_
|
28
29
|
#define DYNCALL_CALLBACK_ARM32_THUMB_H_
|
29
30
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/
|
5
|
+
File: dyncallback/dyncall_callback_arm32_thumb_apple.S
|
6
6
|
Description: Callback Thunk - Implementation for ARM32 (THUMB mode)
|
7
7
|
License:
|
8
8
|
|
@@ -28,5 +28,5 @@
|
|
28
28
|
/* into ARM mode, the parameters passed use the same registers/stack spase */
|
29
29
|
/* as the ARM mode, and the bx instruction switches back to THUMB mode, if */
|
30
30
|
/* the function to be called has a "THUMB function address" (=address+1). */
|
31
|
-
|
31
|
+
#include "dyncall_callback_arm32_arm_apple.s"
|
32
32
|
|
data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_gas.s → dyncall_callback_arm32_thumb_gas.S}
RENAMED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/dyncall_callback_arm32_thumb_gas.
|
5
|
+
File: dyncallback/dyncall_callback_arm32_thumb_gas.S
|
6
6
|
Description: Callback Thunk - Implementation for ARM32 (THUMB mode)
|
7
7
|
License:
|
8
8
|
|
@@ -28,5 +28,5 @@
|
|
28
28
|
/* into ARM mode, the parameters passed use the same registers/stack space */
|
29
29
|
/* as the ARM mode, and the bx instruction switches back to THUMB mode, if */
|
30
30
|
/* the function to be called has a "THUMB function address" (=address+1). */
|
31
|
-
|
31
|
+
#include "dyncall_callback_arm32_arm_gas.S"
|
32
32
|
|
@@ -0,0 +1,111 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_callback_arm64.S
|
6
|
+
Description: Callback Thunk - 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
|
+
// struct DCCallback
|
26
|
+
// type off size
|
27
|
+
// ---------|------|------
|
28
|
+
// DCThunk | 0 | 32
|
29
|
+
// handler | 32 | 8
|
30
|
+
// userdata | 40 | 8
|
31
|
+
|
32
|
+
#include "../portasm/portasm-arm.S"
|
33
|
+
|
34
|
+
.align 4
|
35
|
+
GLOBAL_C(dcCallbackThunkEntry)
|
36
|
+
ENTRY_C(dcCallbackThunkEntry)
|
37
|
+
|
38
|
+
// input:
|
39
|
+
// x9: DCCallback* pcb
|
40
|
+
// x0..x7 ?? GP regs
|
41
|
+
// d0..d7 ?? FP/SIMD regs
|
42
|
+
// sp... ?? arguments on stack
|
43
|
+
//
|
44
|
+
// locals:
|
45
|
+
// type off size
|
46
|
+
// ---------|------|------
|
47
|
+
// Frame 0 16
|
48
|
+
// DCArgs 16 168
|
49
|
+
// DCValue 184 16
|
50
|
+
//
|
51
|
+
// size 200
|
52
|
+
// aligned 208
|
53
|
+
//
|
54
|
+
|
55
|
+
// locals:
|
56
|
+
// x10: sp
|
57
|
+
// x11: DCArgs* args
|
58
|
+
|
59
|
+
mov x10, sp
|
60
|
+
stp x29, x30, [sp, #-208 ]!
|
61
|
+
mov x29, sp
|
62
|
+
|
63
|
+
add x11, x29 , #16
|
64
|
+
|
65
|
+
// save integer registers
|
66
|
+
|
67
|
+
stp x0, x1, [x11, #0 ]
|
68
|
+
stp x2, x3, [x11, #16]
|
69
|
+
stp x4, x5, [x11, #32]
|
70
|
+
stp x6, x7, [x11, #48]
|
71
|
+
|
72
|
+
stp d0, d1, [x11, #64]
|
73
|
+
stp d2, d3, [x11, #80]
|
74
|
+
stp d4, d5, [x11, #96]
|
75
|
+
stp d6, d7, [x11, #112]
|
76
|
+
|
77
|
+
eor x12, x12, x12
|
78
|
+
stp x10,x12,[x11, #128] // sp=sp, i=0, f=0
|
79
|
+
|
80
|
+
str x12, [x11, #144] // s=0, reserved=0
|
81
|
+
|
82
|
+
|
83
|
+
// call handler:
|
84
|
+
// args:
|
85
|
+
// x0: DCCallback* pcb
|
86
|
+
// x1: DCArgs* args
|
87
|
+
// x2: DCValue* result
|
88
|
+
// x3: void* userdata
|
89
|
+
|
90
|
+
mov x0 , x9
|
91
|
+
add x1 , x29 , #16
|
92
|
+
add x2 , x29 , #184
|
93
|
+
ldr x3 , [x9 , #40]
|
94
|
+
|
95
|
+
ldr x11, [x9 , #32]
|
96
|
+
blr x11
|
97
|
+
|
98
|
+
and w0, w0, #255
|
99
|
+
cmp w0, 'f'
|
100
|
+
b.eq .retf
|
101
|
+
cmp w0, 'd'
|
102
|
+
b.eq .retf
|
103
|
+
|
104
|
+
.reti:
|
105
|
+
ldr x0, [x29, #184]
|
106
|
+
b .ret
|
107
|
+
.retf:
|
108
|
+
ldr d0, [x29, #184]
|
109
|
+
.ret:
|
110
|
+
ldp x29, x30, [sp], #208
|
111
|
+
ret
|
@@ -0,0 +1,71 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_callback_arm64.c
|
6
|
+
Description: Callback - 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
|
+
|
26
|
+
#include "dyncall_callback.h"
|
27
|
+
#include "dyncall_alloc_wx.h"
|
28
|
+
#include "dyncall_thunk.h"
|
29
|
+
|
30
|
+
extern void dcCallbackThunkEntry();
|
31
|
+
|
32
|
+
struct DCCallback
|
33
|
+
{
|
34
|
+
// off size
|
35
|
+
// ----|-----
|
36
|
+
DCThunk thunk; // 0 32
|
37
|
+
DCCallbackHandler* handler; // 32 8
|
38
|
+
void* userdata; // 40 8
|
39
|
+
//
|
40
|
+
// size 48
|
41
|
+
// aligned 48
|
42
|
+
};
|
43
|
+
|
44
|
+
void dcbInitCallback(DCCallback* pcb, const char* signature, DCCallbackHandler* handler, void* userdata)
|
45
|
+
{
|
46
|
+
pcb->handler = handler;
|
47
|
+
pcb->userdata = userdata;
|
48
|
+
}
|
49
|
+
|
50
|
+
DCCallback* dcbNewCallback(const char* signature, DCCallbackHandler* handler, void* userdata)
|
51
|
+
{
|
52
|
+
int err;
|
53
|
+
DCCallback* pcb;
|
54
|
+
err = dcAllocWX(sizeof(DCCallback), (void**) &pcb);
|
55
|
+
if (err != 0) return 0;
|
56
|
+
|
57
|
+
dcbInitThunk(&pcb->thunk, dcCallbackThunkEntry);
|
58
|
+
dcbInitCallback(pcb, signature, handler, userdata);
|
59
|
+
return pcb;
|
60
|
+
}
|
61
|
+
|
62
|
+
void dcbFreeCallback(DCCallback* pcb)
|
63
|
+
{
|
64
|
+
dcFreeWX(pcb, sizeof(DCCallback));
|
65
|
+
}
|
66
|
+
|
67
|
+
void* dcbGetUserData(DCCallback* pcb)
|
68
|
+
{
|
69
|
+
return pcb->userdata;
|
70
|
+
}
|
71
|
+
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: Callback - Implementation Header for MIPS
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2013 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
-
|
9
|
+
Copyright (c) 2013-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
13
13
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
|
26
27
|
#include "dyncall_callback.h"
|
27
28
|
#include "dyncall_callback_mips.h"
|
28
29
|
|