rbdc 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dyncall/BUGS +1 -1
- data/dyncall/CMakeLists.txt +19 -7
- data/dyncall/ChangeLog +61 -20
- data/dyncall/LICENSE +1 -1
- data/dyncall/Makefile.generic +2 -0
- data/dyncall/ToDo +97 -29
- data/dyncall/autovar/README.txt +1 -0
- data/dyncall/autovar/autovar_ABI.h +4 -2
- data/dyncall/autovar/autovar_ARCH.h +9 -5
- data/dyncall/autovar/autovar_CC.h +3 -1
- data/dyncall/autovar/autovar_OS.h +2 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +1 -1
- data/dyncall/configure +94 -38
- data/dyncall/dyncall/dyncall.3 +8 -4
- data/dyncall/dyncall/dyncall.h +1 -1
- data/dyncall/dyncall/dyncall_alloc.h +1 -1
- data/dyncall/dyncall/dyncall_api.c +3 -1
- data/dyncall/dyncall/dyncall_call.S +13 -5
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +1 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +24 -26
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +3 -7
- data/dyncall/dyncall/dyncall_call_arm64.S +2 -2
- data/dyncall/dyncall/dyncall_call_arm64.h +2 -2
- data/dyncall/dyncall/dyncall_call_mips.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +16 -16
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -2
- data/dyncall/dyncall/dyncall_call_mips_n32.h +5 -4
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +4 -4
- data/dyncall/dyncall/dyncall_call_mips_n64.h +3 -3
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +2 -2
- data/dyncall/dyncall/dyncall_call_mips_o32.h +4 -3
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +1 -3
- data/dyncall/dyncall/dyncall_call_ppc32.S +1 -1
- data/dyncall/dyncall/dyncall_call_ppc32.h +1 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +1 -1
- data/dyncall/dyncall/{dyncall_call_sparc.S → dyncall_call_sparc.s} +39 -44
- data/dyncall/dyncall/dyncall_call_sparc64.h +5 -5
- data/dyncall/dyncall/dyncall_call_sparc64.s +177 -0
- data/dyncall/dyncall/dyncall_call_x64.S +83 -86
- data/dyncall/dyncall/dyncall_call_x64.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86.S +9 -9
- data/dyncall/dyncall/dyncall_call_x86.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +5 -5
- data/dyncall/dyncall/dyncall_callf.c +18 -18
- data/dyncall/dyncall/dyncall_callf.h +1 -1
- data/dyncall/dyncall/dyncall_callvm.c +3 -3
- data/dyncall/dyncall/dyncall_callvm.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +25 -40
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +25 -33
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +24 -36
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm64.c +23 -27
- data/dyncall/dyncall/dyncall_callvm_arm64.h +2 -6
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_base.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +30 -27
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +24 -30
- data/dyncall/dyncall/{dyncall_call_sparc_v9.h → dyncall_callvm_mips_n32.h} +18 -8
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +4 -6
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +31 -29
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +22 -20
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +54 -15
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +0 -2
- data/dyncall/dyncall/dyncall_callvm_sparc.c +34 -26
- data/dyncall/dyncall/dyncall_callvm_sparc.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +94 -150
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +11 -17
- data/dyncall/dyncall/dyncall_callvm_x64.c +37 -36
- data/dyncall/dyncall/dyncall_callvm_x64.h +1 -4
- data/dyncall/dyncall/dyncall_callvm_x86.c +22 -63
- data/dyncall/dyncall/dyncall_callvm_x86.h +1 -17
- data/dyncall/dyncall/dyncall_config.h +1 -1
- data/dyncall/dyncall/dyncall_macros.h +28 -19
- data/dyncall/dyncall/dyncall_signature.h +1 -1
- data/dyncall/dyncall/dyncall_types.h +17 -18
- data/dyncall/dyncall/dyncall_utils.h +1 -1
- data/dyncall/dyncall/dyncall_value.h +28 -21
- data/dyncall/dyncall/dyncall_vector.c +1 -1
- data/dyncall/dyncall/dyncall_vector.h +1 -1
- data/dyncall/dyncall/gen-masm.sh +2 -2
- data/dyncall/dyncallback/CMakeLists.txt +1 -2
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +4 -3
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +8 -2
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +67 -4
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +7 -2
- data/dyncall/dyncallback/dyncall_args.c +19 -15
- data/dyncall/dyncallback/dyncall_args.h +1 -1
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.c → dyncall_args_arm32.c} +4 -4
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.h → dyncall_args_arm32.h} +6 -6
- data/dyncall/dyncallback/dyncall_args_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +2 -2
- data/dyncall/dyncallback/dyncall_args_mips.c +26 -21
- data/dyncall/dyncallback/dyncall_args_mips.h +18 -6
- data/dyncall/dyncallback/dyncall_args_mips64.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips_o32.c +104 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc64.c +24 -3
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -15
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -2
- data/dyncall/dyncallback/dyncall_args_sparc64.c +28 -15
- data/dyncall/dyncallback/dyncall_args_sparc64.h +7 -3
- data/dyncall/dyncallback/dyncall_args_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +1 -1
- data/dyncall/dyncallback/dyncall_callback.c +10 -12
- data/dyncall/dyncallback/dyncall_callback.h +2 -4
- data/dyncall/dyncallback/dyncall_callback_arch.S +12 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm.c → dyncall_callback_arm32.c} +25 -10
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +7 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.S +9 -9
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.c +20 -14
- data/dyncall/dyncallback/dyncall_callback_mips.c +26 -9
- data/dyncall/dyncallback/dyncall_callback_mips_eabi_gas.s +99 -0
- data/dyncall/dyncallback/{dyncall_args_arm32_thumb.h → dyncall_callback_mips_gas.S} +14 -9
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.c → dyncall_callback_mips_n32_gas.s} +12 -7
- data/dyncall/dyncallback/dyncall_callback_mips_n64_gas.s +98 -0
- data/dyncall/dyncallback/dyncall_callback_mips_o32_gas.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +54 -54
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +92 -117
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +55 -4
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +89 -5
- data/dyncall/dyncallback/dyncall_callback_x64.S +8 -8
- data/dyncall/dyncallback/dyncall_callback_x64.c +19 -6
- data/dyncall/dyncallback/dyncall_callback_x86.S +29 -25
- data/dyncall/dyncallback/dyncall_callback_x86.c +24 -11
- data/dyncall/dyncallback/dyncall_thunk.c +6 -6
- data/dyncall/dyncallback/dyncall_thunk.h +9 -7
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.c → dyncall_thunk_arm32.c} +5 -3
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.h → dyncall_thunk_arm32.h} +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +8 -13
- data/dyncall/dyncallback/dyncall_thunk_mips.c +16 -20
- data/dyncall/dyncallback/dyncall_thunk_mips.h +4 -2
- data/dyncall/dyncallback/dyncall_thunk_mips64.c +103 -0
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.h → dyncall_thunk_mips64.h} +15 -8
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +4 -4
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +9 -9
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +19 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +5 -4
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +42 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +5 -5
- data/dyncall/dyncallback/dyncall_thunk_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -2
- data/dyncall/dyncallback/dyncall_thunk_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -2
- data/dyncall/dyncallback/dyncallback.3 +16 -11
- data/dyncall/dynload/dynload.3 +63 -8
- data/dyncall/dynload/dynload.c +2 -8
- data/dyncall/dynload/dynload.h +9 -5
- data/dyncall/dynload/dynload_alloc.h +1 -1
- data/dyncall/dynload/dynload_syms.c +1 -3
- data/dyncall/dynload/dynload_syms_elf.c +19 -11
- data/dyncall/dynload/dynload_syms_mach-o.c +151 -75
- data/dyncall/dynload/dynload_syms_pe.c +24 -24
- data/dyncall/dynload/dynload_unix.c +156 -13
- data/dyncall/dynload/dynload_windows.c +15 -11
- data/dyncall/portasm/portasm-arm.S +1 -1
- data/dyncall/portasm/portasm-ppc.S +1 -1
- data/dyncall/portasm/{portasm-x64-att.S → portasm-x64.S} +7 -4
- data/dyncall/portasm/portasm-x86.S +4 -2
- data/{dyncall-bindings/ruby/rbdc/extconf.rb → extconf.rb} +4 -4
- data/{dyncall-bindings/ruby/rbdc/rbdc.c → rbdc.c} +5 -5
- metadata +24 -48
- data/dyncall/Makefile.M +0 -15
- data/dyncall/buildsys/dynmake/Makefile.base.M +0 -82
- data/dyncall/buildsys/dynmake/dynmake.bat +0 -2
- data/dyncall/buildsys/dynmake/dynmake.sh +0 -4
- data/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/Makefile.M +0 -10
- data/dyncall/dyncall/TODO +0 -9
- data/dyncall/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/dyncall_call_sparc64.S +0 -362
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +0 -222
- data/dyncall/dyncall/dyncall_call_x64-att.S +0 -147
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +0 -182
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +0 -46
- data/dyncall/dyncallback/Makefile.M +0 -10
- data/dyncall/dyncallback/README.txt +0 -9
- data/dyncall/dyncallback/TODO +0 -4
- data/dyncall/dyncallback/dynMakefile +0 -4
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +0 -46
- data/dyncall/dyncallback/dyncall_callback_mips.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +0 -56
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +0 -44
- data/dyncall/dyncallback/dyncall_callback_x64.h +0 -45
- data/dyncall/dyncallback/dyncall_callback_x86.h +0 -50
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +0 -36
- data/dyncall/dynload/Makefile.M +0 -10
- data/dyncall/dynload/TODO +0 -20
- data/dyncall/dynload/dynMakefile +0 -4
- data/dyncall/dynload/dynload_darwin.c +0 -90
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Implementation Back-end selection
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 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
|
@@ -39,15 +39,15 @@
|
|
39
39
|
# endif
|
40
40
|
#elif defined(DC__Arch_PPC64)
|
41
41
|
# include "dyncall_thunk_ppc64.c"
|
42
|
-
#elif defined(
|
43
|
-
#include "
|
44
|
-
#elif defined(DC__Arch_ARM_THUMB)
|
45
|
-
#include "dyncall_thunk_arm32_thumb.c"
|
42
|
+
#elif defined(DC__Arch_ARM)
|
43
|
+
#include "dyncall_thunk_arm32.c"
|
46
44
|
#elif defined(DC__Arch_MIPS)
|
47
45
|
#include "dyncall_thunk_mips.c"
|
46
|
+
#elif defined(DC__Arch_MIPS64)
|
47
|
+
#include "dyncall_thunk_mips64.c"
|
48
48
|
#elif defined(DC__Arch_Sparc)
|
49
49
|
#include "dyncall_thunk_sparc32.c"
|
50
|
-
#elif defined(
|
50
|
+
#elif defined(DC__Arch_Sparc64)
|
51
51
|
#include "dyncall_thunk_sparc64.c"
|
52
52
|
#elif defined(DC__Arch_ARM64)
|
53
53
|
#include "dyncall_thunk_arm64.c"
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Interface
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 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
|
@@ -47,10 +47,11 @@
|
|
47
47
|
** ppc: r2
|
48
48
|
** arm: r12
|
49
49
|
** arm64: x9
|
50
|
+
** mips: t4
|
50
51
|
**
|
51
52
|
**/
|
52
53
|
|
53
|
-
#include "dyncall_macros.h"
|
54
|
+
#include "../dyncall/dyncall_macros.h"
|
54
55
|
|
55
56
|
typedef struct DCThunk_ DCThunk;
|
56
57
|
|
@@ -68,15 +69,15 @@ void dcbInitThunk(DCThunk* p, void (*entry)());
|
|
68
69
|
#include "dyncall_thunk_ppc32.h"
|
69
70
|
#elif defined (DC__Arch_PPC64)
|
70
71
|
#include "dyncall_thunk_ppc64.h"
|
71
|
-
#elif defined (
|
72
|
-
#include "
|
73
|
-
#elif defined (DC__Arch_ARM_THUMB)
|
74
|
-
#include "dyncall_thunk_arm32_thumb.h"
|
72
|
+
#elif defined (DC__Arch_ARM)
|
73
|
+
#include "dyncall_thunk_arm32.h"
|
75
74
|
#elif defined (DC__Arch_MIPS)
|
76
75
|
#include "dyncall_thunk_mips.h"
|
76
|
+
#elif defined (DC__Arch_MIPS64)
|
77
|
+
#include "dyncall_thunk_mips64.h"
|
77
78
|
#elif defined (DC__Arch_Sparc)
|
78
79
|
#include "dyncall_thunk_sparc32.h"
|
79
|
-
#elif defined (
|
80
|
+
#elif defined (DC__Arch_Sparc64)
|
80
81
|
#include "dyncall_thunk_sparc64.h"
|
81
82
|
#elif defined (DC__Arch_ARM64)
|
82
83
|
#include "dyncall_thunk_arm64.h"
|
@@ -88,3 +89,4 @@ void dcbInitThunk(DCThunk* p, void (*entry)());
|
|
88
89
|
|
89
90
|
|
90
91
|
#endif /* DYNCALL_THUNK_H */
|
92
|
+
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/
|
6
|
-
Description: Thunk - Implementation for ARM32 (ARM mode)
|
5
|
+
File: dyncallback/dyncall_thunk_arm32.c
|
6
|
+
Description: Thunk - Implementation for ARM32 (ARM and THUMB mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 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,8 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
/* Since we can mix ARM and THUMB assembly, this works for both modes */
|
28
|
+
|
27
29
|
#include "dyncall_thunk.h"
|
28
30
|
|
29
31
|
void dcbInitThunk(DCThunk* p, void (*entry)())
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/
|
6
|
-
Description: Thunk - Header for ARM32 (ARM mode)
|
5
|
+
File: dyncallback/dyncall_thunk_arm32.h
|
6
|
+
Description: Thunk - Header for ARM32 (ARM and THUMB mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 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,8 +24,8 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
-
#ifndef
|
28
|
-
#define
|
27
|
+
#ifndef DYNCALL_THUNK_ARM32_H
|
28
|
+
#define DYNCALL_THUNK_ARM32_H
|
29
29
|
|
30
30
|
|
31
31
|
struct DCThunk_
|
@@ -34,8 +34,8 @@ struct DCThunk_
|
|
34
34
|
void (*entry)();
|
35
35
|
};
|
36
36
|
|
37
|
-
#define
|
37
|
+
#define DCTHUNK_ARM32_SIZE 12
|
38
38
|
|
39
39
|
|
40
|
-
#endif /*
|
40
|
+
#endif /* DYNCALL_THUNK_ARM32_H */
|
41
41
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: Thunk - Implementation for ARM64 / ARMv8 / AAPCS64
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
-
|
9
|
+
Copyright (c) 2015-2018 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
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: Thunk - Header for ARM64 / ARMv8 / AAPCS64
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
-
|
9
|
+
Copyright (c) 2015-2018 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
|
@@ -26,17 +26,12 @@
|
|
26
26
|
#ifndef DYNCALL_THUNK_ARM64_H
|
27
27
|
#define DYNCALL_THUNK_ARM64_H
|
28
28
|
|
29
|
-
struct DCThunk_
|
30
|
-
{
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
void* reserved; // 24 8
|
36
|
-
|
37
|
-
// 32 total size
|
38
|
-
|
39
|
-
};
|
29
|
+
struct DCThunk_ /* off size */
|
30
|
+
{ /* ----|---- */
|
31
|
+
unsigned int code[4]; /* 0 16 */
|
32
|
+
void (*entry)(); /* 16 8 */
|
33
|
+
void* reserved; /* 24 8 */
|
34
|
+
}; /* 32 total */
|
40
35
|
|
41
36
|
#endif /* DYNCALL_THUNK_ARM64_H */
|
42
37
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Implementation for MIPS
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2013-
|
9
|
+
Copyright (c) 2013-2018 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
|
@@ -25,8 +25,8 @@
|
|
25
25
|
|
26
26
|
#include "dyncall_thunk.h"
|
27
27
|
|
28
|
-
unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
|
29
|
-
unsigned short lo16(x) { return ( (unsigned short) ((unsigned int)x) ); }
|
28
|
+
static unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
|
29
|
+
static unsigned short lo16(x) { return ( (unsigned short) ((unsigned int)x) ); }
|
30
30
|
|
31
31
|
void dcbInitThunk(DCThunk* p, void (*entry)())
|
32
32
|
{
|
@@ -35,32 +35,28 @@ void dcbInitThunk(DCThunk* p, void (*entry)())
|
|
35
35
|
Thunk Register: $t4 ($12)
|
36
36
|
According to o32abi: $t9
|
37
37
|
|
38
|
-
'The Linux/MIPS convention is that all PIC calls use t9 to hold the address of
|
39
|
-
[See MIPS Run, p.413]
|
38
|
+
'The Linux/MIPS convention is that all PIC calls use t9 to hold the address of
|
39
|
+
the called function.' [See MIPS Run, p.413]
|
40
40
|
|
41
41
|
mips thunk code:
|
42
42
|
lui $t4, %hi(p)
|
43
43
|
lui $t9, %hi(entry)
|
44
44
|
ori $t9, $t9, %lo(entry)
|
45
45
|
jr $t9
|
46
|
-
ori $t4, $t4, %lo(p)
|
46
|
+
ori $t4, $t4, %lo(p) ; branch delay slot
|
47
47
|
|
48
|
-
thunk.o: file format elf32-tradbigmips
|
49
|
-
|
50
|
-
|
51
|
-
Disassembly of section .text:
|
52
48
|
|
53
49
|
00000000 <thunk>:
|
54
|
-
0:
|
55
|
-
4:
|
56
|
-
8:
|
57
|
-
c:
|
58
|
-
10:
|
59
|
-
14:
|
60
|
-
18:
|
61
|
-
1c:
|
62
|
-
|
63
|
-
|
50
|
+
0: 3c0c0000 lui t4,0x0
|
51
|
+
4: 3c190000 lui t9,0x0
|
52
|
+
8: 37390000 ori t9,t9,0x0
|
53
|
+
c: 03200008 jr t9
|
54
|
+
10: 00200825 move at,at
|
55
|
+
14: 358c0000 ori t4,t4,0x0
|
56
|
+
18: 00200825 move at,at
|
57
|
+
1c: 00200825 move at,at
|
58
|
+
|
59
|
+
*/
|
64
60
|
|
65
61
|
#if defined(DC__Endian_BIG)
|
66
62
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Header for MIPS
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2013-
|
9
|
+
Copyright (c) 2013-2018 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
|
@@ -31,8 +31,10 @@ struct DCThunk_
|
|
31
31
|
{
|
32
32
|
unsigned short data[6];
|
33
33
|
unsigned int jump;
|
34
|
-
unsigned short bddt[2];
|
34
|
+
unsigned short bddt[2]; // branch delay slots
|
35
35
|
};
|
36
36
|
|
37
|
+
#define DCTHUNK_MIPS_SIZE 20
|
38
|
+
|
37
39
|
#endif /* DYNCALL_THUNK_MIPS_H */
|
38
40
|
|
@@ -0,0 +1,103 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_thunk_mips64.c
|
6
|
+
Description: Thunk - Implementation for MIPS64
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2016-2018 Tassilo Philipp <tphilipp@potion-studios.com>
|
10
|
+
|
11
|
+
Permission to use, copy, modify, and distribute this software for any
|
12
|
+
purpose with or without fee is hereby granted, provided that the above
|
13
|
+
copyright notice and this permission notice appear in all copies.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
16
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
17
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
18
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
19
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
20
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
21
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
22
|
+
|
23
|
+
*/
|
24
|
+
|
25
|
+
#include "dyncall_thunk.h"
|
26
|
+
|
27
|
+
#define b_48_63(x) ((unsigned short)(((unsigned long long)x)>>48UL))
|
28
|
+
#define b_32_47(x) ((unsigned short)(((unsigned long long)x)>>32UL))
|
29
|
+
#define b_16_31(x) ((unsigned short)(((unsigned long long)x)>>16UL))
|
30
|
+
#define b_00_15(x) ((unsigned short) ((unsigned long long)x) )
|
31
|
+
|
32
|
+
void dcbInitThunk(DCThunk* p, void (*entry)())
|
33
|
+
{
|
34
|
+
/*
|
35
|
+
|
36
|
+
Thunk Register: $t8 ($24)
|
37
|
+
Call Address (sticking to t9 as for PIC calls on mips32): $t9 ($25)
|
38
|
+
|
39
|
+
mips64 thunk code:
|
40
|
+
lui $t8, p[48:63]
|
41
|
+
ori $t8, $t8, p[32:47]
|
42
|
+
dsll $t8, 16
|
43
|
+
ori $t8, $t8, p[16:31]
|
44
|
+
dsll $t8, 16
|
45
|
+
lui $t9, entry[48:63]
|
46
|
+
ori $t9, $t9, entry[32:47]
|
47
|
+
dsll $t9, 16
|
48
|
+
ori $t9, $t9, entry[16:31]
|
49
|
+
dsll $t9, 16
|
50
|
+
ori $t9, $t9, entry[0:15]
|
51
|
+
jr $t9
|
52
|
+
ori $t8, $t8, p[0:15] ; branch delay slot
|
53
|
+
|
54
|
+
Disassembly of section .text:
|
55
|
+
|
56
|
+
0000000000000000 <thunk>:
|
57
|
+
0: 3c180000 lui t8,0x0
|
58
|
+
4: 37180000 ori t8,t8,0x0
|
59
|
+
8: 0018c438 dsll t8,t8,0x10
|
60
|
+
c: 37180000 ori t8,t8,0x0
|
61
|
+
10: 0018c438 dsll t8,t8,0x10
|
62
|
+
14: 3c190000 lui t9,0x0
|
63
|
+
18: 37390000 ori t9,t9,0x0
|
64
|
+
1c: 0019cc38 dsll t9,t9,0x10
|
65
|
+
20: 37390000 ori t9,t9,0x0
|
66
|
+
24: 0019cc38 dsll t9,t9,0x10
|
67
|
+
28: 37390000 ori t9,t9,0x0
|
68
|
+
2c: 03200008 jr t9
|
69
|
+
30: 37180000 ori t8,t8,0x0
|
70
|
+
|
71
|
+
*/
|
72
|
+
|
73
|
+
#if defined(DC__Endian_BIG)
|
74
|
+
|
75
|
+
p->text.s[ 0] = 0x3c18; p->text.s[ 1] = b_48_63(p); /* lui $t8, p[48:63] */
|
76
|
+
p->text.s[ 2] = 0x3718; p->text.s[ 3] = b_32_47(p); /* ori $t8, $t8, p[32:47] */
|
77
|
+
p->text.s[ 6] = 0x3718; p->text.s[ 7] = b_16_31(p); /* ori $t8, $t8, p[16:31] */
|
78
|
+
p->text.s[10] = 0x3c19; p->text.s[11] = b_48_63(entry); /* lui $t9, entry[48:63] */
|
79
|
+
p->text.s[12] = 0x3739; p->text.s[13] = b_32_47(entry); /* ori $t9, $t9, entry[32:47] */
|
80
|
+
p->text.s[16] = 0x3739; p->text.s[17] = b_16_31(entry); /* ori $t9, $t9, entry[16:31] */
|
81
|
+
p->text.s[20] = 0x3739; p->text.s[21] = b_00_15(entry); /* ori $t9, $t9, entry[0:15] */
|
82
|
+
p->text.s[24] = 0x3718; p->text.s[25] = b_00_15(p); /* ori $t8, $t8, p[0:15] - branch delay slot */
|
83
|
+
|
84
|
+
#else /* defined(DC__Endian_LITTLE) */
|
85
|
+
|
86
|
+
p->text.s[ 1] = 0x3c18; p->text.s[ 0] = b_48_63(p); /* lui $t8, p[48:63] */
|
87
|
+
p->text.s[ 3] = 0x3718; p->text.s[ 2] = b_32_47(p); /* ori $t8, $t8, p[32:47] */
|
88
|
+
p->text.s[ 7] = 0x3718; p->text.s[ 6] = b_16_31(p); /* ori $t8, $t8, p[16:31] */
|
89
|
+
p->text.s[11] = 0x3c19; p->text.s[10] = b_48_63(entry); /* lui $t9, entry[48:63] */
|
90
|
+
p->text.s[13] = 0x3739; p->text.s[12] = b_32_47(entry); /* ori $t9, $t9, entry[32:47] */
|
91
|
+
p->text.s[17] = 0x3739; p->text.s[16] = b_16_31(entry); /* ori $t9, $t9, entry[16:31] */
|
92
|
+
p->text.s[21] = 0x3739; p->text.s[20] = b_00_15(entry); /* ori $t9, $t9, entry[0:15] */
|
93
|
+
p->text.s[25] = 0x3718; p->text.s[24] = b_00_15(p); /* ori $t8, $t8, p[0:15] - branch delay slot */
|
94
|
+
|
95
|
+
#endif
|
96
|
+
|
97
|
+
p->text.i[ 2] = 0x0018c438; /* dsll t8,t8,0x10 */
|
98
|
+
p->text.i[ 4] = 0x0018c438; /* dsll t8,t8,0x10 */
|
99
|
+
p->text.i[ 7] = 0x0019cc38; /* dsll t9,t9,0x10 */
|
100
|
+
p->text.i[ 9] = 0x0019cc38; /* dsll t9,t9,0x10 */
|
101
|
+
p->text.i[11] = 0x03200008; /* jr $t9 */
|
102
|
+
}
|
103
|
+
|
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/
|
6
|
-
Description:
|
5
|
+
File: dyncallback/dyncall_thunk_mips64.h
|
6
|
+
Description: Thunk - Header for MIPS64
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c)
|
10
|
-
Tassilo Philipp <tphilipp@potion-studios.com>
|
9
|
+
Copyright (c) 2016-2018 Tassilo Philipp <tphilipp@potion-studios.com>
|
11
10
|
|
12
11
|
Permission to use, copy, modify, and distribute this software for any
|
13
12
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -24,11 +23,19 @@
|
|
24
23
|
*/
|
25
24
|
|
26
25
|
|
26
|
+
#ifndef DYNCALL_THUNK_MIPS64_H
|
27
|
+
#define DYNCALL_THUNK_MIPS64_H
|
27
28
|
|
28
|
-
|
29
|
-
|
29
|
+
struct DCThunk_
|
30
|
+
{
|
31
|
+
union {
|
32
|
+
unsigned short s[26];
|
33
|
+
unsigned int i[13]; /* don't change from 'int', must be 32bit wide */
|
34
|
+
} text;
|
35
|
+
unsigned int padding; /* 4 bytes, to get struct size to multiple of 8 */
|
36
|
+
};
|
30
37
|
|
31
|
-
#
|
38
|
+
#define DCTHUNK_MIPS64_SIZE 56
|
32
39
|
|
33
|
-
#endif /*
|
40
|
+
#endif /* DYNCALL_THUNK_MIPS64_H */
|
34
41
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Implementation for ppc32 darwin/apple
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 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,8 +26,8 @@
|
|
26
26
|
|
27
27
|
#include "dyncall_thunk.h"
|
28
28
|
|
29
|
-
unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
|
30
|
-
unsigned short lo16(x) { return ( (unsigned short) ((unsigned int)x) ); }
|
29
|
+
static unsigned short hi16(x) { return ( (unsigned short) (((unsigned int)x)>>16UL) ); }
|
30
|
+
static unsigned short lo16(x) { return ( (unsigned short) ((unsigned int)x) ); }
|
31
31
|
|
32
32
|
void dcbInitThunk(DCThunk* p, void (*entry)())
|
33
33
|
{
|
@@ -42,7 +42,7 @@ void dcbInitThunk(DCThunk* p, void (*entry)())
|
|
42
42
|
|
43
43
|
p->code_load_hi = 0x3c40U; /* lis r2, HI16(p) */
|
44
44
|
p->addr_self_hi = hi16(p);
|
45
|
-
p->code_load_lo = 0x6042U;
|
45
|
+
p->code_load_lo = 0x6042U; /* ori r2, r2, LO16(p) */
|
46
46
|
p->addr_self_lo = lo16(p);
|
47
47
|
p->code_jump[0] = 0x81820014U; /* lwz r12, 20(r2) */
|
48
48
|
p->code_jump[1] = 0x7d8903a6U; /* mtclr r12 */
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Header for ppc32 (darwin/sysv)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 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
|