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: Call Kernel for ARM 32-bit ARM Architecture
|
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 "../portasm/portasm-arm.S"
|
28
29
|
|
29
30
|
/* ============================================================================
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
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
|
/*
|
28
29
|
|
29
30
|
dyncall 32bit ARM32 family interface (ARM mode)
|
@@ -49,9 +50,14 @@ extern "C" {
|
|
49
50
|
**
|
50
51
|
** - hybrid return-type call (bool ... pointer)
|
51
52
|
**
|
53
|
+
** Note the return type of this declaration is intentially of double-word size.
|
54
|
+
** On some platforms (FreeBSD/arm, Nintendo DS, ...) the compiler generates cleanup code
|
55
|
+
** in the caller (dc_callvm_call_arm32_arm) that reuses, thus overwrites r0 and r1.
|
56
|
+
** With this "hint", we preserve those registers by letting the compiler assume both
|
57
|
+
** registers are used for the return type.
|
52
58
|
*/
|
53
59
|
|
54
|
-
|
60
|
+
DClonglong dcCall_arm32_arm(DCpointer target, DCpointer stackdata, DCsize size);
|
55
61
|
|
56
62
|
#ifdef __cplusplus
|
57
63
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Call Kernel for ARM 32-bit ARM Architecture - Hard Float
|
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 "../portasm/portasm-arm.S"
|
28
29
|
|
29
30
|
/* ============================================================================
|
@@ -40,6 +41,12 @@
|
|
40
41
|
.arch armv6
|
41
42
|
.fpu vfp
|
42
43
|
|
44
|
+
/*
|
45
|
+
1st arg / r0 = funptr
|
46
|
+
2st arg / r1 = ptr to int args
|
47
|
+
3st arg / r2 = size
|
48
|
+
4st arg / r3 = ptr to float args
|
49
|
+
*/
|
43
50
|
GLOBAL_C(dcCall_arm32_armhf)
|
44
51
|
ENTRY_C(dcCall_arm32_armhf)
|
45
52
|
|
@@ -52,24 +59,9 @@ ENTRY_C(dcCall_arm32_armhf)
|
|
52
59
|
mov r5 , r1 /* r5 = 'args' (2nd argument is passed in r1). */
|
53
60
|
|
54
61
|
/* Load 16 single-precision registers (= 8 double-precision registers). */
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
flds s3, [r3,#12]
|
59
|
-
flds s4, [r3,#16]
|
60
|
-
flds s5, [r3,#20]
|
61
|
-
flds s6, [r3,#24]
|
62
|
-
flds s7, [r3,#28]
|
63
|
-
flds s8, [r3,#32]
|
64
|
-
flds s9, [r3,#36]
|
65
|
-
flds s10, [r3,#40]
|
66
|
-
flds s11, [r3,#44]
|
67
|
-
flds s12, [r3,#48]
|
68
|
-
flds s13, [r3,#52]
|
69
|
-
flds s14, [r3,#56]
|
70
|
-
flds s15, [r3,#60]
|
71
|
-
|
72
|
-
sub r2 , r2 , #16
|
62
|
+
fldmiad r3, {d0-d7}
|
63
|
+
|
64
|
+
sub r2 , r2 , #16 /* skip spill area */
|
73
65
|
cmp r2, #0
|
74
66
|
ble armhf_call
|
75
67
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
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_CALL_ARM32_ARM_ARMHF_H
|
28
29
|
#define DYNCALL_CALL_ARM32_ARM_ARMHF_H
|
29
30
|
|
@@ -34,7 +35,19 @@
|
|
34
35
|
extern "C" {
|
35
36
|
#endif
|
36
37
|
|
37
|
-
|
38
|
+
/*
|
39
|
+
** arm32 armhf mode calling convention calls
|
40
|
+
**
|
41
|
+
** - hybrid return-type call (bool ... pointer)
|
42
|
+
**
|
43
|
+
** Note the return type of this declaration is intentially of double-word size.
|
44
|
+
** On some platforms the compiler generates cleanup code in the caller (dyncall_callvm_arm32_arm_armhf.c's
|
45
|
+
** call()) that reuses,thus overwrites r0 and r1.
|
46
|
+
** With this "hint", we preserve those registers by letting the compiler assume both
|
47
|
+
** registers are used for the return type.
|
48
|
+
*/
|
49
|
+
|
50
|
+
DClonglong dcCall_arm32_armhf(DCpointer target, DCpointer stackdata, DCsize size, DCfloat* p_s16);
|
38
51
|
|
39
52
|
#ifdef __cplusplus
|
40
53
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
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
|
/*
|
28
29
|
|
29
30
|
dyncall 32bit ARM32 family interface (THUMB mode)
|
@@ -49,13 +50,14 @@ extern "C" {
|
|
49
50
|
**
|
50
51
|
** - hybrid return-type call (bool ... pointer)
|
51
52
|
**
|
53
|
+
** Note the return type of this declaration is intentially of double-word size.
|
54
|
+
** On some platforms (FreeBSD/arm, Nintendo DS, ...) the compiler generates cleanup code
|
55
|
+
** in the caller (dc_callvm_call_arm32_thumb) that reuses, thus overwrites r0 and r1.
|
56
|
+
** With this "hint", we preserve those registers by letting the compiler assume both
|
57
|
+
** registers are used for the return type.
|
52
58
|
*/
|
53
59
|
|
54
|
-
|
55
|
-
|
56
|
-
/* Internally used to avoid compiler overwriting r0 and r1 in call stub */
|
57
|
-
DClong dcCall_arm32_thumb_word (DCpointer target, DCpointer stackdata, DCsize size);
|
58
|
-
DClonglong dcCall_arm32_thumb_dword(DCpointer target, DCpointer stackdata, DCsize size);
|
60
|
+
DClonglong dcCall_arm32_thumb(DCpointer target, DCpointer stackdata, DCsize size);
|
59
61
|
|
60
62
|
#ifdef __cplusplus
|
61
63
|
}
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_call_arm32_thumb_armhf.S
|
6
|
-
Description: Call Kernel for ARM 32-bit ARM Architecture - Hard Float in Thumb code
|
6
|
+
Description: Call Kernel for ARM 32-bit ARM Architecture - Hard Float in Thumb code
|
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 "../portasm/portasm-arm.S"
|
28
29
|
|
29
30
|
/* ============================================================================
|
@@ -43,6 +44,12 @@
|
|
43
44
|
// .arch armv6
|
44
45
|
// .fpu vfp
|
45
46
|
|
47
|
+
/*
|
48
|
+
1st arg / r0 = funptr
|
49
|
+
2st arg / r1 = ptr to int args
|
50
|
+
3st arg / r2 = size
|
51
|
+
4st arg / r3 = ptr to float args
|
52
|
+
*/
|
46
53
|
GLOBAL_C(dcCall_arm32_armhf)
|
47
54
|
.thumb_func
|
48
55
|
ENTRY_C(dcCall_arm32_armhf)
|
@@ -61,22 +68,7 @@ ENTRY_C(dcCall_arm32_armhf)
|
|
61
68
|
mov r5 , r1 /* r5 = 'args' (2nd argument is passed in r1). */
|
62
69
|
|
63
70
|
/* Load 16 single-precision registers (= 8 double-precision registers). */
|
64
|
-
|
65
|
-
flds s1, [r3,#4 ]
|
66
|
-
flds s2, [r3,#8 ]
|
67
|
-
flds s3, [r3,#12]
|
68
|
-
flds s4, [r3,#16]
|
69
|
-
flds s5, [r3,#20]
|
70
|
-
flds s6, [r3,#24]
|
71
|
-
flds s7, [r3,#28]
|
72
|
-
flds s8, [r3,#32]
|
73
|
-
flds s9, [r3,#36]
|
74
|
-
flds s10, [r3,#40]
|
75
|
-
flds s11, [r3,#44]
|
76
|
-
flds s12, [r3,#48]
|
77
|
-
flds s13, [r3,#52]
|
78
|
-
flds s14, [r3,#56]
|
79
|
-
flds s15, [r3,#60]
|
71
|
+
fldmiad r3, {d0-d7}
|
80
72
|
|
81
73
|
sub r2 , #16
|
82
74
|
cmp r2, #0
|
@@ -83,19 +83,3 @@ call:
|
|
83
83
|
mov %r13, %r7 /* Reset stack ptr. */
|
84
84
|
pop {%r4-%r7, %r15} /* Restore permanent registers and program counter. (Force a stay in THUMB in ARMv4, whether ARMv5 can return in ARM or THUMB depending on the bit 0. */
|
85
85
|
|
86
|
-
|
87
|
-
|
88
|
-
/* Internally used to avoid compiler overwriting r0 and r1 in call stub */
|
89
|
-
.globl dcCall_arm32_thumb_word
|
90
|
-
|
91
|
-
.thumb_func
|
92
|
-
dcCall_arm32_thumb_word:
|
93
|
-
b dcCall_arm32_thumb
|
94
|
-
|
95
|
-
|
96
|
-
.globl dcCall_arm32_thumb_dword
|
97
|
-
|
98
|
-
.thumb_func
|
99
|
-
dcCall_arm32_thumb_dword:
|
100
|
-
b dcCall_arm32_thumb
|
101
|
-
|
@@ -0,0 +1,226 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_arm64.S
|
6
|
+
Description: Call Kernel for ARM 64-bit Architecture (aka ARM64, AArch64)
|
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
|
+
|
28
|
+
#include "../portasm/portasm-arm.S"
|
29
|
+
|
30
|
+
/* ============================================================================
|
31
|
+
DynCall Call Kernel for ARM 64-bit ARM Architecture
|
32
|
+
----------------------------------------------------------------------------
|
33
|
+
C Interface:
|
34
|
+
dcCall_arm64 (DCpointer target, DCpointer data, DCsize size, DCfloat* regdata);
|
35
|
+
|
36
|
+
This Call Kernel was tested on Debian/qemu-debootstrap arm64 jessie.
|
37
|
+
*/
|
38
|
+
|
39
|
+
.text
|
40
|
+
//
|
41
|
+
// DynCall Back-End arm64
|
42
|
+
//
|
43
|
+
// Supported ABIs:
|
44
|
+
// - 'ARM 64-bit AArch64 PCS' (@dadler: work in progress)
|
45
|
+
//
|
46
|
+
// Useful Links:
|
47
|
+
// - http://lxr.free-electrons.com/source/arch/arm64/kernel/stacktrace.c
|
48
|
+
|
49
|
+
GLOBAL_C(dcCall_arm64)
|
50
|
+
ENTRY_C(dcCall_arm64)
|
51
|
+
.align 2
|
52
|
+
|
53
|
+
// input:
|
54
|
+
// x0: target (address of target)
|
55
|
+
// x1: data (address of stack copy data)
|
56
|
+
// x2: size (number of 'pair' 16-byte units)
|
57
|
+
// x3: regdata (address of register data)
|
58
|
+
|
59
|
+
// prolog:
|
60
|
+
|
61
|
+
stp x29, x30, [sp, #-16]! // allocate frame
|
62
|
+
mov x29, sp
|
63
|
+
|
64
|
+
// load 64-bit floating-point registers
|
65
|
+
|
66
|
+
ldr d0, [x3,#0 ]
|
67
|
+
ldr d1, [x3,#8 ]
|
68
|
+
ldr d2, [x3,#16]
|
69
|
+
ldr d3, [x3,#24]
|
70
|
+
ldr d4, [x3,#32]
|
71
|
+
ldr d5, [x3,#40]
|
72
|
+
ldr d6, [x3,#48]
|
73
|
+
ldr d7, [x3,#56]
|
74
|
+
|
75
|
+
// copy to stack
|
76
|
+
|
77
|
+
sub sp, sp, x2 // create call-frame
|
78
|
+
|
79
|
+
eor x4, x4, x4 // x4: cnt = 0
|
80
|
+
|
81
|
+
mov x5, x1 // x5: read pointer = data
|
82
|
+
mov x6, sp // x6: write pointer = sp
|
83
|
+
|
84
|
+
.next:
|
85
|
+
cmp x4, x2
|
86
|
+
b.ge .done
|
87
|
+
|
88
|
+
ldp x7, x9, [x5], #16 // get pair from data
|
89
|
+
stp x7, x9, [x6], #16 // put to stack
|
90
|
+
add x4, x4, 16 // advance 16 bytes
|
91
|
+
|
92
|
+
b .next
|
93
|
+
|
94
|
+
.done:
|
95
|
+
|
96
|
+
// rescue temp int registers
|
97
|
+
|
98
|
+
mov x9 , x0 // x9: target
|
99
|
+
add x10, x3, 64 // x3: integer reg buffer
|
100
|
+
|
101
|
+
// load 64-bit integer registers ( 8 x 64-bit )
|
102
|
+
|
103
|
+
// load register set
|
104
|
+
|
105
|
+
ldr x0, [x10, #0]
|
106
|
+
ldr x1, [x10, #8]
|
107
|
+
ldr x2, [x10, #16]
|
108
|
+
ldr x3, [x10, #24]
|
109
|
+
ldr x4, [x10, #32]
|
110
|
+
ldr x5, [x10, #40]
|
111
|
+
ldr x6, [x10, #48]
|
112
|
+
ldr x7, [x10, #56]
|
113
|
+
|
114
|
+
// call target:
|
115
|
+
|
116
|
+
blr x9
|
117
|
+
|
118
|
+
// epilog:
|
119
|
+
|
120
|
+
mov sp, x29
|
121
|
+
ldp x29, x30, [sp], 16
|
122
|
+
|
123
|
+
ret
|
124
|
+
|
125
|
+
#if 0
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
// epilog:
|
130
|
+
|
131
|
+
add sp, x28, 0 // remove call record
|
132
|
+
|
133
|
+
ret
|
134
|
+
|
135
|
+
// -- OLD:
|
136
|
+
|
137
|
+
str x27, [sp, 16] // use 1 local var (size)
|
138
|
+
|
139
|
+
|
140
|
+
ldr q0, [x3,#0 ]
|
141
|
+
ldr q1, [x3,#8 ]
|
142
|
+
ldr q2, [x3,#16]
|
143
|
+
ldr q3, [x3,#24]
|
144
|
+
ldr q4, [x3,#32]
|
145
|
+
ldr q5, [x3,#40]
|
146
|
+
ldr q6, [x3,#48]
|
147
|
+
ldr q7, [x3,#56]
|
148
|
+
|
149
|
+
ldr d8, [x3,#32]
|
150
|
+
ldr d9, [x3,#36]
|
151
|
+
ldr d10, [x3,#40]
|
152
|
+
ldr d11, [x3,#44]
|
153
|
+
ldr d12, [x3,#48]
|
154
|
+
ldr d13, [x3,#52]
|
155
|
+
ldr d14, [x3,#56]
|
156
|
+
ldr d15, [x3,#60]
|
157
|
+
|
158
|
+
|
159
|
+
// load float ( 16 x 32-bit )
|
160
|
+
|
161
|
+
ldr s0, [x3,#0 ]
|
162
|
+
ldr s1, [x3,#4 ]
|
163
|
+
ldr s2, [x3,#8 ]
|
164
|
+
ldr s3, [x3,#12]
|
165
|
+
ldr s4, [x3,#16]
|
166
|
+
ldr s5, [x3,#20]
|
167
|
+
ldr s6, [x3,#24]
|
168
|
+
ldr s7, [x3,#28]
|
169
|
+
ldr s8, [x3,#32]
|
170
|
+
ldr s9, [x3,#36]
|
171
|
+
ldr s10, [x3,#40]
|
172
|
+
ldr s11, [x3,#44]
|
173
|
+
ldr s12, [x3,#48]
|
174
|
+
ldr s13, [x3,#52]
|
175
|
+
ldr s14, [x3,#56]
|
176
|
+
ldr s15, [x3,#60]
|
177
|
+
|
178
|
+
// call
|
179
|
+
|
180
|
+
blr x0
|
181
|
+
|
182
|
+
// epilog
|
183
|
+
|
184
|
+
ldp x29, x30, [sp], 32
|
185
|
+
ret
|
186
|
+
|
187
|
+
// stack copy
|
188
|
+
|
189
|
+
sub sp, sp, x2 // decrement stack by size (x2)
|
190
|
+
eor x3, x3, x3 // x3 = counter, set to zero
|
191
|
+
|
192
|
+
// .next:
|
193
|
+
ldr x4, [x1, x3] // x4 = 64-bit stack data
|
194
|
+
str x4, [sp, x3] // store to stack
|
195
|
+
add x3, x3, #8
|
196
|
+
cmp x3, x2
|
197
|
+
blt .next
|
198
|
+
|
199
|
+
|
200
|
+
// rescue int registers
|
201
|
+
|
202
|
+
mov x9 , x0 // x9 = code ptr
|
203
|
+
mov x10, x2
|
204
|
+
|
205
|
+
// load int ( 8 x 64-bit )
|
206
|
+
|
207
|
+
ldr x0, [sp, #0]
|
208
|
+
ldr x1, [sp, #8]
|
209
|
+
ldr x2, [sp, #16]
|
210
|
+
ldr x3, [sp, #24]
|
211
|
+
ldr x4, [sp, #32]
|
212
|
+
ldr x5, [sp, #40]
|
213
|
+
ldr x6, [sp, #48]
|
214
|
+
ldr x7, [sp, #56]
|
215
|
+
|
216
|
+
// call
|
217
|
+
|
218
|
+
blr x9
|
219
|
+
|
220
|
+
// epilog
|
221
|
+
|
222
|
+
ldp x29, x30, [sp], 32
|
223
|
+
ret
|
224
|
+
#endif
|
225
|
+
|
226
|
+
|