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:
|
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
|
@@ -45,7 +45,6 @@
|
|
45
45
|
#include "dyncall_callvm.h"
|
46
46
|
#include "dyncall_vector.h"
|
47
47
|
|
48
|
-
|
49
48
|
typedef struct
|
50
49
|
{
|
51
50
|
DCCallVM mInterface;
|
@@ -53,8 +52,5 @@ typedef struct
|
|
53
52
|
DCVecHead mVecHead;
|
54
53
|
} DCCallVM_arm32_thumb;
|
55
54
|
|
56
|
-
DCCallVM* dcNewCallVM_arm32_thumb(DCsize size);
|
57
|
-
|
58
|
-
|
59
55
|
#endif /* DYNCALL_CALLVM_ARM32_THUMB_H */
|
60
56
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: ARM 64-bit ABI implementation
|
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
|
@@ -27,19 +27,6 @@
|
|
27
27
|
#include "dyncall_callvm_arm64.h"
|
28
28
|
#include "dyncall_alloc.h"
|
29
29
|
|
30
|
-
static DCCallVM* dc_callvm_new_arm64(DCCallVM_vt* vt, DCsize size)
|
31
|
-
{
|
32
|
-
DCCallVM_arm64* p = (DCCallVM_arm64*) dcAllocMem(size);
|
33
|
-
|
34
|
-
dc_callvm_base_init(&p->mInterface, vt);
|
35
|
-
|
36
|
-
dcVecInit(&p->mVecHead, size);
|
37
|
-
|
38
|
-
p->i = 0;
|
39
|
-
p->f = 0;
|
40
|
-
|
41
|
-
return (DCCallVM*)p;
|
42
|
-
}
|
43
30
|
|
44
31
|
static void reset(DCCallVM* in_p)
|
45
32
|
{
|
@@ -50,8 +37,6 @@ static void reset(DCCallVM* in_p)
|
|
50
37
|
}
|
51
38
|
|
52
39
|
|
53
|
-
static void mode(DCCallVM* in_self,DCint mode);
|
54
|
-
|
55
40
|
static void deinit(DCCallVM* in_self)
|
56
41
|
{
|
57
42
|
dcFreeMem(in_self);
|
@@ -112,6 +97,8 @@ void call(DCCallVM* in_p, DCpointer target)
|
|
112
97
|
dcCall_arm64(target, dcVecData(&p->mVecHead), ( dcVecSize(&p->mVecHead) + 15 ) & -16, &p->u.S[0]);
|
113
98
|
}
|
114
99
|
|
100
|
+
static void mode(DCCallVM* in_self, DCint mode);
|
101
|
+
|
115
102
|
DCCallVM_vt vt_arm64 =
|
116
103
|
{
|
117
104
|
&deinit
|
@@ -140,26 +127,35 @@ DCCallVM_vt vt_arm64 =
|
|
140
127
|
, NULL /* callStruct */
|
141
128
|
};
|
142
129
|
|
143
|
-
DCCallVM*
|
130
|
+
static void mode(DCCallVM* in_self, DCint mode)
|
144
131
|
{
|
145
|
-
|
146
|
-
|
132
|
+
DCCallVM_arm64* self = (DCCallVM_arm64*)in_self;
|
133
|
+
DCCallVM_vt* vt;
|
147
134
|
|
148
|
-
static void mode(DCCallVM* in_self,DCint mode)
|
149
|
-
{
|
150
|
-
DCCallVM_arm64* self = (DCCallVM_arm64*) in_self;
|
151
|
-
DCCallVM_vt* vt;
|
152
135
|
switch(mode) {
|
153
136
|
case DC_CALL_C_DEFAULT:
|
137
|
+
case DC_CALL_C_ARM64:
|
154
138
|
case DC_CALL_C_ELLIPSIS:
|
155
139
|
case DC_CALL_C_ELLIPSIS_VARARGS:
|
156
|
-
case DC_CALL_C_ARM64:
|
157
140
|
vt = &vt_arm64;
|
158
141
|
break;
|
159
142
|
default:
|
160
|
-
|
143
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
161
144
|
return;
|
162
145
|
}
|
163
|
-
self->mInterface
|
146
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
147
|
+
}
|
148
|
+
|
149
|
+
/* Public API. */
|
150
|
+
DCCallVM* dcNewCallVM(DCsize size)
|
151
|
+
{
|
152
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)dcAllocMem(sizeof(DCCallVM_arm64)+size);
|
153
|
+
|
154
|
+
mode((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
155
|
+
|
156
|
+
dcVecInit(&p->mVecHead, size);
|
157
|
+
reset((DCCallVM*)p);
|
158
|
+
|
159
|
+
return (DCCallVM*)p;
|
164
160
|
}
|
165
161
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description:
|
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
|
@@ -30,7 +30,6 @@
|
|
30
30
|
#include "dyncall_callvm.h"
|
31
31
|
#include "dyncall_vector.h"
|
32
32
|
|
33
|
-
|
34
33
|
typedef struct
|
35
34
|
{
|
36
35
|
DCCallVM mInterface;
|
@@ -44,8 +43,5 @@ typedef struct
|
|
44
43
|
DCVecHead mVecHead; /* argument buffer head */
|
45
44
|
} DCCallVM_arm64;
|
46
45
|
|
47
|
-
DCCallVM* dcNewCallVM_arm64(DCsize size);
|
48
|
-
|
49
|
-
|
50
46
|
#endif /* DYNCALL_CALLVM_ARM64_DEBIAN_H */
|
51
47
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: ARM 64-bit Apple ABI implementation
|
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
|
@@ -27,19 +27,6 @@
|
|
27
27
|
#include "dyncall_callvm_arm64.h"
|
28
28
|
#include "dyncall_alloc.h"
|
29
29
|
|
30
|
-
static DCCallVM* dc_callvm_new_arm64(DCCallVM_vt* vt, DCsize size)
|
31
|
-
{
|
32
|
-
DCCallVM_arm64* p = (DCCallVM_arm64*) dcAllocMem(size);
|
33
|
-
|
34
|
-
dc_callvm_base_init(&p->mInterface, vt);
|
35
|
-
|
36
|
-
dcVecInit(&p->mVecHead, size);
|
37
|
-
|
38
|
-
p->i = 0;
|
39
|
-
p->f = 0;
|
40
|
-
|
41
|
-
return (DCCallVM*)p;
|
42
|
-
}
|
43
30
|
|
44
31
|
static void reset(DCCallVM* in_p)
|
45
32
|
{
|
@@ -50,8 +37,6 @@ static void reset(DCCallVM* in_p)
|
|
50
37
|
}
|
51
38
|
|
52
39
|
|
53
|
-
static void mode(DCCallVM* in_p,DCint mode);
|
54
|
-
|
55
40
|
static void deinit(DCCallVM* in_p)
|
56
41
|
{
|
57
42
|
dcFreeMem(in_p);
|
@@ -186,6 +171,8 @@ void call(DCCallVM* in_p, DCpointer target)
|
|
186
171
|
dcCall_arm64(target, dcVecData(&p->mVecHead), ( dcVecSize(&p->mVecHead) + 15 ) & -16, &p->u.S[0]);
|
187
172
|
}
|
188
173
|
|
174
|
+
static void mode(DCCallVM* in_p,DCint mode);
|
175
|
+
|
189
176
|
DCCallVM_vt vt_arm64 =
|
190
177
|
{
|
191
178
|
&deinit
|
@@ -242,21 +229,14 @@ DCCallVM_vt vt_arm64_variadic =
|
|
242
229
|
, NULL /* callStruct */
|
243
230
|
};
|
244
231
|
|
245
|
-
|
246
|
-
DCCallVM* dcNewCallVM(DCsize size)
|
232
|
+
static void mode(DCCallVM* in_self, DCint mode)
|
247
233
|
{
|
248
|
-
|
249
|
-
|
234
|
+
DCCallVM_arm64* self = (DCCallVM_arm64*)in_self;
|
235
|
+
DCCallVM_vt* vt;
|
250
236
|
|
251
|
-
static void mode(DCCallVM* in_self,DCint mode)
|
252
|
-
{
|
253
|
-
DCCallVM_arm64* self = (DCCallVM_arm64*) in_self;
|
254
|
-
DCCallVM_vt* vt;
|
255
237
|
switch(mode) {
|
256
238
|
case DC_CALL_C_DEFAULT:
|
257
|
-
case DC_CALL_C_ARM64:
|
258
|
-
vt = &vt_arm64;
|
259
|
-
break;
|
239
|
+
case DC_CALL_C_ARM64:
|
260
240
|
case DC_CALL_C_ELLIPSIS:
|
261
241
|
vt = &vt_arm64;
|
262
242
|
break;
|
@@ -264,9 +244,22 @@ static void mode(DCCallVM* in_self,DCint mode)
|
|
264
244
|
vt = &vt_arm64_variadic;
|
265
245
|
break;
|
266
246
|
default:
|
267
|
-
|
247
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
268
248
|
return;
|
269
249
|
}
|
270
|
-
self->mInterface
|
250
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
251
|
+
}
|
252
|
+
|
253
|
+
/* Public API. */
|
254
|
+
DCCallVM* dcNewCallVM(DCsize size)
|
255
|
+
{
|
256
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)dcAllocMem(sizeof(DCCallVM_arm64)+size);
|
257
|
+
|
258
|
+
mode((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
259
|
+
|
260
|
+
dcVecInit(&p->mVecHead, size);
|
261
|
+
reset((DCCallVM*)p);
|
262
|
+
|
263
|
+
return (DCCallVM*)p;
|
271
264
|
}
|
272
265
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: ARM 32-bit "thumb" ABI callvm implementation
|
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
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: ARM 32-bit "thumb" ABI callvm implementation
|
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
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
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
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Implementation of Call VM for mips "eabi" abi.
|
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
|
@@ -36,34 +36,11 @@ static void dc_callvm_reset_mips_eabi(DCCallVM* in_self)
|
|
36
36
|
self->mSingleRegs = 0;
|
37
37
|
}
|
38
38
|
|
39
|
-
static DCCallVM* dc_callvm_new_mips_eabi(DCCallVM_vt* vt, DCsize size)
|
40
|
-
{
|
41
|
-
/* Store at least 16 bytes (4 words) for internal spill area. Assembly code depends on it. */
|
42
|
-
DCCallVM_mips_eabi* self = (DCCallVM_mips_eabi*)dcAllocMem(sizeof(DCCallVM_mips_eabi)+size+16);
|
43
|
-
dc_callvm_base_init(&self->mInterface, vt);
|
44
|
-
dcVecInit(&self->mVecHead, size);
|
45
|
-
dc_callvm_reset_mips_eabi( (DCCallVM*) self );
|
46
|
-
return (DCCallVM*)self;
|
47
|
-
}
|
48
|
-
|
49
|
-
|
50
39
|
static void dc_callvm_free_mips_eabi(DCCallVM* in_self)
|
51
40
|
{
|
52
41
|
dcFreeMem(in_self);
|
53
42
|
}
|
54
43
|
|
55
|
-
static void dc_callvm_mode_mips_eabi(DCCallVM* in_self,DCint mode)
|
56
|
-
{
|
57
|
-
switch(mode) {
|
58
|
-
case DC_CALL_C_DEFAULT:
|
59
|
-
case DC_CALL_C_ELLIPSIS:
|
60
|
-
case DC_CALL_C_MIPS32_EABI:
|
61
|
-
break;
|
62
|
-
default:
|
63
|
-
in_self->mError = DC_ERROR_UNSUPPORTED_MODE; return;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
44
|
/* arg int -- fillup integer register file OR push on stack */
|
68
45
|
|
69
46
|
static void dc_callvm_argInt_mips_eabi(DCCallVM* in_self, DCint i)
|
@@ -142,6 +119,8 @@ void dc_callvm_call_mips_eabi(DCCallVM* in_self, DCpointer target)
|
|
142
119
|
dcCall_mips_eabi(target, &self->mRegData, dcVecSize(&self->mVecHead), dcVecData(&self->mVecHead));
|
143
120
|
}
|
144
121
|
|
122
|
+
static void dc_callvm_mode_mips_eabi(DCCallVM* in_self, DCint mode);
|
123
|
+
|
145
124
|
DCCallVM_vt gVT_mips_eabi =
|
146
125
|
{
|
147
126
|
&dc_callvm_free_mips_eabi
|
@@ -170,13 +149,37 @@ DCCallVM_vt gVT_mips_eabi =
|
|
170
149
|
, NULL /* callStruct */
|
171
150
|
};
|
172
151
|
|
173
|
-
|
152
|
+
/* mode: only a single mode available currently. */
|
153
|
+
static void dc_callvm_mode_mips_eabi(DCCallVM* in_self, DCint mode)
|
174
154
|
{
|
175
|
-
|
155
|
+
DCCallVM_mips_eabi* self = (DCCallVM_mips_eabi*)in_self;
|
156
|
+
DCCallVM_vt* vt;
|
157
|
+
|
158
|
+
switch(mode) {
|
159
|
+
case DC_CALL_C_DEFAULT:
|
160
|
+
case DC_CALL_C_MIPS32_EABI:
|
161
|
+
case DC_CALL_C_ELLIPSIS:
|
162
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
163
|
+
vt = &gVT_mips_eabi;
|
164
|
+
break;
|
165
|
+
default:
|
166
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
167
|
+
return;
|
168
|
+
}
|
169
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
176
170
|
}
|
177
171
|
|
172
|
+
/* Public API. */
|
178
173
|
DCCallVM* dcNewCallVM(DCsize size)
|
179
174
|
{
|
180
|
-
|
175
|
+
/* Store at least 16 bytes (4 words) for internal spill area. Assembly code depends on it. */
|
176
|
+
DCCallVM_mips_eabi* p = (DCCallVM_mips_eabi*)dcAllocMem(sizeof(DCCallVM_mips_eabi)+size+16);
|
177
|
+
|
178
|
+
dc_callvm_mode_mips_eabi((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
179
|
+
|
180
|
+
dcVecInit(&p->mVecHead, size);
|
181
|
+
dc_callvm_reset_mips_eabi((DCCallVM*)p);
|
182
|
+
|
183
|
+
return (DCCallVM*)p;
|
181
184
|
}
|
182
185
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
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
|
@@ -45,7 +45,6 @@
|
|
45
45
|
#include "dyncall_callvm.h"
|
46
46
|
#include "dyncall_vector.h"
|
47
47
|
|
48
|
-
|
49
48
|
typedef struct
|
50
49
|
{
|
51
50
|
DCCallVM mInterface;
|
@@ -55,8 +54,5 @@ typedef struct
|
|
55
54
|
DCVecHead mVecHead;
|
56
55
|
} DCCallVM_mips_eabi;
|
57
56
|
|
58
|
-
DCCallVM* dcNewCallVM_mips_eabi(DCsize size);
|
59
|
-
|
60
|
-
|
61
57
|
#endif /* DYNCALL_CALLVM_MIPS_EABI_H */
|
62
58
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_callvm_mips_n32.c
|
6
|
-
Description:
|
6
|
+
Description: mips64 "n32" ABI callvm implementation
|
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
|
@@ -61,15 +61,6 @@ static void dc_callvm_reset_mips_n32(DCCallVM* in_self)
|
|
61
61
|
self->mRegData.mUseDouble = 0LL;
|
62
62
|
}
|
63
63
|
|
64
|
-
static DCCallVM* dc_callvm_new_mips_n32(DCCallVM_vt* vt, DCsize size)
|
65
|
-
{
|
66
|
-
DCCallVM_mips_n32* self = (DCCallVM_mips_n32*)dcAllocMem(sizeof(DCCallVM_mips_n32)+size);
|
67
|
-
dc_callvm_base_init(&self->mInterface, vt);
|
68
|
-
dcVecInit(&self->mVecHead, size);
|
69
|
-
dc_callvm_reset_mips_n32( (DCCallVM*) self );
|
70
|
-
return (DCCallVM*)self;
|
71
|
-
}
|
72
|
-
|
73
64
|
|
74
65
|
static void dc_callvm_free_mips_n32(DCCallVM* in_self)
|
75
66
|
{
|
@@ -148,7 +139,7 @@ static void dc_callvm_argFloat_mips_n32(DCCallVM* in_self, DCfloat x)
|
|
148
139
|
}
|
149
140
|
|
150
141
|
|
151
|
-
/* Ellipsis calls:
|
142
|
+
/* Ellipsis calls:
|
152
143
|
- float is promoted to double (due to ANSI C).
|
153
144
|
- double is passed via integer register-file (due to MIPS ABI).
|
154
145
|
*/
|
@@ -170,7 +161,7 @@ void dc_callvm_call_mips_n32(DCCallVM* in_self, DCpointer target)
|
|
170
161
|
{
|
171
162
|
DCCallVM_mips_n32* self = (DCCallVM_mips_n32*)in_self;
|
172
163
|
/* at minimum provide 16-bytes
|
173
|
-
which hold the first four integer register as spill area
|
164
|
+
which hold the first four integer register as spill area
|
174
165
|
and are automatically loaded to $4-$7
|
175
166
|
*/
|
176
167
|
size_t size = DC_MAX(16, ( ( (unsigned) dcVecSize(&self->mVecHead) ) +7UL ) & (-8UL) );
|
@@ -187,7 +178,7 @@ DCCallVM_vt gVT_mips_n32 =
|
|
187
178
|
, &dc_callvm_mode_mips_n32
|
188
179
|
, &dc_callvm_argBool_mips_n32
|
189
180
|
, &dc_callvm_argChar_mips_n32
|
190
|
-
, &dc_callvm_argShort_mips_n32
|
181
|
+
, &dc_callvm_argShort_mips_n32
|
191
182
|
, &dc_callvm_argInt_mips_n32
|
192
183
|
, &dc_callvm_argLong_mips_n32
|
193
184
|
, &dc_callvm_argLongLong_mips_n32
|
@@ -236,34 +227,37 @@ DCCallVM_vt gVT_mips_n32_ellipsis =
|
|
236
227
|
, NULL /* callStruct */
|
237
228
|
};
|
238
229
|
|
239
|
-
static void dc_callvm_mode_mips_n32(DCCallVM*
|
230
|
+
static void dc_callvm_mode_mips_n32(DCCallVM* in_self, DCint mode)
|
240
231
|
{
|
232
|
+
DCCallVM_mips_n32* self = (DCCallVM_mips_n32*)in_self;
|
233
|
+
DCCallVM_vt* vt;
|
234
|
+
|
241
235
|
switch(mode) {
|
242
236
|
case DC_CALL_C_DEFAULT:
|
243
|
-
|
244
|
-
break;
|
237
|
+
case DC_CALL_C_MIPS64_N32:
|
245
238
|
case DC_CALL_C_ELLIPSIS:
|
246
|
-
|
239
|
+
vt = &gVT_mips_n32;
|
247
240
|
break;
|
248
|
-
|
249
|
-
|
241
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
242
|
+
vt = &gVT_mips_n32_ellipsis;
|
250
243
|
break;
|
244
|
+
default:
|
245
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
246
|
+
return;
|
251
247
|
}
|
248
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
252
249
|
}
|
253
250
|
|
254
|
-
|
251
|
+
/* Public API. */
|
252
|
+
DCCallVM* dcNewCallVM(DCsize size)
|
255
253
|
{
|
256
|
-
|
257
|
-
}
|
254
|
+
DCCallVM_mips_n32* p = (DCCallVM_mips_n32*)dcAllocMem(sizeof(DCCallVM_mips_n32)+size);
|
258
255
|
|
259
|
-
DCCallVM*
|
260
|
-
{
|
261
|
-
return dc_callvm_new_mips_n32(&gVT_mips_n32_ellipsis, size);
|
262
|
-
}
|
256
|
+
dc_callvm_mode_mips_n32((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
263
257
|
|
258
|
+
dcVecInit(&p->mVecHead, size);
|
259
|
+
dc_callvm_reset_mips_n32((DCCallVM*)p);
|
264
260
|
|
265
|
-
DCCallVM*
|
266
|
-
{
|
267
|
-
return dcNewCallVM_mips_n32(size);
|
261
|
+
return (DCCallVM*)p;
|
268
262
|
}
|
269
263
|
|