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
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
|
-
File: dyncall/
|
6
|
-
Description:
|
5
|
+
File: dyncall/dyncall_callvm_mips_n32.h
|
6
|
+
Description: mips64 "n32" ABI callvm C interface.
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c)
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
10
11
|
|
11
12
|
Permission to use, copy, modify, and distribute this software for any
|
12
13
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -24,20 +25,29 @@
|
|
24
25
|
|
25
26
|
|
26
27
|
|
27
|
-
#ifndef
|
28
|
-
#define
|
28
|
+
#ifndef DYNCALL_CALLVM_MIPS_N32_H
|
29
|
+
#define DYNCALL_CALLVM_MIPS_N32_H
|
29
30
|
|
30
|
-
#include "
|
31
|
+
#include "dyncall_call_mips_n32.h"
|
32
|
+
#include "dyncall_callvm.h"
|
33
|
+
#include "dyncall_vector.h"
|
31
34
|
|
32
35
|
#ifdef __cplusplus
|
33
36
|
extern "C" {
|
34
37
|
#endif
|
35
38
|
|
36
|
-
|
39
|
+
typedef struct
|
40
|
+
{
|
41
|
+
DCCallVM mInterface;
|
42
|
+
DCint mRegCount;
|
43
|
+
struct DCRegData_mips_n32 mRegData;
|
44
|
+
DCVecHead mVecHead;
|
45
|
+
} DCCallVM_mips_n32;
|
46
|
+
/* @@@ this is the same as n64, combine code */
|
37
47
|
|
38
48
|
#ifdef __cplusplus
|
39
49
|
}
|
40
50
|
#endif
|
41
51
|
|
42
|
-
#endif /*
|
52
|
+
#endif /* DYNCALL_CALLVM_MIPS_N32_H */
|
43
53
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "n64" 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_n64(DCCallVM* in_self)
|
|
61
61
|
self->mRegData.mUseDouble = 0LL;
|
62
62
|
}
|
63
63
|
|
64
|
-
static DCCallVM* dc_callvm_new_mips_n64(DCCallVM_vt* vt, DCsize size)
|
65
|
-
{
|
66
|
-
DCCallVM_mips_n64* self = (DCCallVM_mips_n64*)dcAllocMem(sizeof(DCCallVM_mips_n64)+size);
|
67
|
-
dc_callvm_base_init(&self->mInterface, vt);
|
68
|
-
dcVecInit(&self->mVecHead, size);
|
69
|
-
dc_callvm_reset_mips_n64( (DCCallVM*) self );
|
70
|
-
return (DCCallVM*)self;
|
71
|
-
}
|
72
|
-
|
73
64
|
|
74
65
|
static void dc_callvm_free_mips_n64(DCCallVM* in_self)
|
75
66
|
{
|
@@ -148,7 +139,7 @@ static void dc_callvm_argFloat_mips_n64(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,14 +161,13 @@ void dc_callvm_call_mips_n64(DCCallVM* in_self, DCpointer target)
|
|
170
161
|
{
|
171
162
|
DCCallVM_mips_n64* self = (DCCallVM_mips_n64*)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) );
|
177
168
|
dcCall_mips_n64(target, &self->mRegData, size, dcVecData(&self->mVecHead));
|
178
169
|
}
|
179
170
|
|
180
|
-
/* Forward Declaration. */
|
181
171
|
static void dc_callvm_mode_mips_n64(DCCallVM* in_self,DCint mode);
|
182
172
|
|
183
173
|
DCCallVM_vt gVT_mips_n64 =
|
@@ -187,7 +177,7 @@ DCCallVM_vt gVT_mips_n64 =
|
|
187
177
|
, &dc_callvm_mode_mips_n64
|
188
178
|
, &dc_callvm_argBool_mips_n64
|
189
179
|
, &dc_callvm_argChar_mips_n64
|
190
|
-
, &dc_callvm_argShort_mips_n64
|
180
|
+
, &dc_callvm_argShort_mips_n64
|
191
181
|
, &dc_callvm_argInt_mips_n64
|
192
182
|
, &dc_callvm_argLong_mips_n64
|
193
183
|
, &dc_callvm_argLongLong_mips_n64
|
@@ -236,34 +226,37 @@ DCCallVM_vt gVT_mips_n64_ellipsis =
|
|
236
226
|
, NULL /* callStruct */
|
237
227
|
};
|
238
228
|
|
239
|
-
static void dc_callvm_mode_mips_n64(DCCallVM*
|
229
|
+
static void dc_callvm_mode_mips_n64(DCCallVM* in_self, DCint mode)
|
240
230
|
{
|
231
|
+
DCCallVM_mips_n64* self = (DCCallVM_mips_n64*)in_self;
|
232
|
+
DCCallVM_vt* vt;
|
233
|
+
|
241
234
|
switch(mode) {
|
242
235
|
case DC_CALL_C_DEFAULT:
|
243
|
-
|
244
|
-
break;
|
236
|
+
case DC_CALL_C_MIPS64_N64:
|
245
237
|
case DC_CALL_C_ELLIPSIS:
|
246
|
-
|
238
|
+
vt = &gVT_mips_n64;
|
247
239
|
break;
|
248
|
-
|
249
|
-
|
240
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
241
|
+
vt = &gVT_mips_n64_ellipsis;
|
250
242
|
break;
|
243
|
+
default:
|
244
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
245
|
+
return;
|
251
246
|
}
|
247
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
252
248
|
}
|
253
249
|
|
254
|
-
|
250
|
+
/* Public API. */
|
251
|
+
DCCallVM* dcNewCallVM(DCsize size)
|
255
252
|
{
|
256
|
-
|
257
|
-
}
|
253
|
+
DCCallVM_mips_n64* p = (DCCallVM_mips_n64*)dcAllocMem(sizeof(DCCallVM_mips_n64)+size);
|
258
254
|
|
259
|
-
DCCallVM*
|
260
|
-
{
|
261
|
-
return dc_callvm_new_mips_n64(&gVT_mips_n64_ellipsis, size);
|
262
|
-
}
|
255
|
+
dc_callvm_mode_mips_n64((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
263
256
|
|
257
|
+
dcVecInit(&p->mVecHead, size);
|
258
|
+
dc_callvm_reset_mips_n64((DCCallVM*)p);
|
264
259
|
|
265
|
-
DCCallVM*
|
266
|
-
{
|
267
|
-
return dcNewCallVM_mips_n64(size);
|
260
|
+
return (DCCallVM*)p;
|
268
261
|
}
|
269
262
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "n64" ABI callvm C 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
|
@@ -38,14 +38,12 @@ extern "C" {
|
|
38
38
|
|
39
39
|
typedef struct
|
40
40
|
{
|
41
|
-
DCCallVM
|
42
|
-
|
41
|
+
DCCallVM mInterface;
|
42
|
+
DCint mRegCount;
|
43
43
|
struct DCRegData_mips_n64 mRegData;
|
44
|
-
DCVecHead
|
44
|
+
DCVecHead mVecHead;
|
45
45
|
} DCCallVM_mips_n64;
|
46
46
|
|
47
|
-
DCCallVM* dcNewCallVM_mips_n64(DCsize size);
|
48
|
-
|
49
47
|
#ifdef __cplusplus
|
50
48
|
}
|
51
49
|
#endif
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "o32" 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
|
@@ -60,34 +60,12 @@ static void dc_callvm_reset_mips_o32(DCCallVM* in_self)
|
|
60
60
|
self->mArgCount = 0;
|
61
61
|
}
|
62
62
|
|
63
|
-
static DCCallVM* dc_callvm_new_mips_o32(DCCallVM_vt* vt, DCsize size)
|
64
|
-
{
|
65
|
-
DCCallVM_mips_o32* self = (DCCallVM_mips_o32*)dcAllocMem(sizeof(DCCallVM_mips_o32)+size);
|
66
|
-
dc_callvm_base_init(&self->mInterface, vt);
|
67
|
-
dcVecInit(&self->mVecHead, size);
|
68
|
-
dc_callvm_reset_mips_o32( (DCCallVM*) self );
|
69
|
-
return (DCCallVM*)self;
|
70
|
-
}
|
71
|
-
|
72
63
|
|
73
64
|
static void dc_callvm_free_mips_o32(DCCallVM* in_self)
|
74
65
|
{
|
75
66
|
dcFreeMem(in_self);
|
76
67
|
}
|
77
68
|
|
78
|
-
static void dc_callvm_mode_mips_o32(DCCallVM* self, DCint mode)
|
79
|
-
{
|
80
|
-
switch(mode) {
|
81
|
-
case DC_CALL_C_DEFAULT:
|
82
|
-
case DC_CALL_C_ELLIPSIS:
|
83
|
-
case DC_CALL_C_MIPS32_O32:
|
84
|
-
break;
|
85
|
-
default:
|
86
|
-
self->mError = DC_ERROR_UNSUPPORTED_MODE;
|
87
|
-
break;
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
69
|
/* arg int -- fillup integer register file OR push on stack */
|
92
70
|
|
93
71
|
static void dc_callvm_argInt_mips_o32(DCCallVM* in_self, DCint i)
|
@@ -138,7 +116,7 @@ static void dc_callvm_argFloat_mips_o32(DCCallVM* in_self, DCfloat x)
|
|
138
116
|
|
139
117
|
dcVecAppend(&self->mVecHead, &x, sizeof(DCfloat) );
|
140
118
|
if (self->mArgCount < 2) {
|
141
|
-
#if defined(
|
119
|
+
#if defined(DC__Endian_LITTLE)
|
142
120
|
self->mRegData.u[self->mArgCount].f[0] = x;
|
143
121
|
#else
|
144
122
|
self->mRegData.u[self->mArgCount].f[1] = x;
|
@@ -158,7 +136,7 @@ static void dc_callvm_argFloat_mips_o32(DCCallVM* in_self, DCfloat x)
|
|
158
136
|
lwc1 $f14, 8($5) <--- byte offset 12
|
159
137
|
lwc1 $f15, 12($5)
|
160
138
|
|
161
|
-
#if defined(
|
139
|
+
#if defined(DC__Endian_LITTLE)
|
162
140
|
/* index 0 and 2 */
|
163
141
|
self->mRegData.floats[self->mArgCount*2] = x;
|
164
142
|
#else
|
@@ -195,6 +173,8 @@ void dc_callvm_call_mips_o32(DCCallVM* in_self, DCpointer target)
|
|
195
173
|
dcCall_mips_o32(target, &self->mRegData, size, dcVecData(&self->mVecHead));
|
196
174
|
}
|
197
175
|
|
176
|
+
static void dc_callvm_mode_mips_o32(DCCallVM* in_self, DCint mode);
|
177
|
+
|
198
178
|
DCCallVM_vt gVT_mips_o32 =
|
199
179
|
{
|
200
180
|
&dc_callvm_free_mips_o32
|
@@ -223,14 +203,36 @@ DCCallVM_vt gVT_mips_o32 =
|
|
223
203
|
, NULL /* callStruct */
|
224
204
|
};
|
225
205
|
|
226
|
-
|
206
|
+
/* mode: only a single mode available currently. */
|
207
|
+
static void dc_callvm_mode_mips_o32(DCCallVM* in_self, DCint mode)
|
227
208
|
{
|
228
|
-
|
229
|
-
|
209
|
+
DCCallVM_mips_o32* self = (DCCallVM_mips_o32*)in_self;
|
210
|
+
DCCallVM_vt* vt;
|
230
211
|
|
212
|
+
switch(mode) {
|
213
|
+
case DC_CALL_C_DEFAULT:
|
214
|
+
case DC_CALL_C_MIPS32_O32:
|
215
|
+
case DC_CALL_C_ELLIPSIS:
|
216
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
217
|
+
vt = &gVT_mips_o32;
|
218
|
+
break;
|
219
|
+
default:
|
220
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
221
|
+
return;
|
222
|
+
}
|
223
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
224
|
+
}
|
231
225
|
|
226
|
+
/* Public API. */
|
232
227
|
DCCallVM* dcNewCallVM(DCsize size)
|
233
228
|
{
|
234
|
-
|
229
|
+
DCCallVM_mips_o32* p = (DCCallVM_mips_o32*)dcAllocMem(sizeof(DCCallVM_mips_o32)+size);
|
230
|
+
|
231
|
+
dc_callvm_mode_mips_o32((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
232
|
+
|
233
|
+
dcVecInit(&p->mVecHead, size);
|
234
|
+
dc_callvm_reset_mips_o32((DCCallVM*)p);
|
235
|
+
|
236
|
+
return (DCCallVM*)p;
|
235
237
|
}
|
236
238
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "o32" ABI callvm C 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
|
@@ -40,7 +40,5 @@ typedef struct
|
|
40
40
|
DCVecHead mVecHead;
|
41
41
|
} DCCallVM_mips_o32;
|
42
42
|
|
43
|
-
DCCallVM* dcNewCallVM_mips_o32(DCsize size);
|
44
|
-
|
45
43
|
#endif /* DYNCALL_CALLVM_MIPS_O32_H */
|
46
44
|
|
@@ -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
|
@@ -50,12 +50,14 @@
|
|
50
50
|
|
51
51
|
/* Support for Mac OS X (Darwin) and Systen V ABI for Power PC 32-bit */
|
52
52
|
|
53
|
-
#if defined(
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
53
|
+
#if defined(DC_UNIX)
|
54
|
+
# if defined(DC__OS_Darwin)
|
55
|
+
# define DC__ABI_Darwin
|
56
|
+
# else
|
57
|
+
# define DC__ABI_SysV
|
58
|
+
# endif
|
57
59
|
#else
|
58
|
-
#error Unsupported OS for ppc32 architecture.
|
60
|
+
# error Unsupported OS for ppc32 architecture.
|
59
61
|
#endif
|
60
62
|
|
61
63
|
static void dc_callvm_free_ppc32(DCCallVM* in_self)
|
@@ -364,29 +366,26 @@ DCCallVM_vt gVT_ppc32_syscall =
|
|
364
366
|
|
365
367
|
void dc_callvm_mode_ppc32(DCCallVM* in_self, DCint mode)
|
366
368
|
{
|
367
|
-
DCCallVM_ppc32* self = (DCCallVM_ppc32*)
|
369
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
368
370
|
DCCallVM_vt* vt;
|
369
|
-
switch(mode) {
|
370
371
|
|
371
|
-
|
372
|
+
switch(mode) {
|
372
373
|
|
373
374
|
#if defined(DC__ABI_Darwin)
|
374
375
|
case DC_CALL_C_DEFAULT:
|
375
376
|
case DC_CALL_C_ELLIPSIS:
|
376
377
|
case DC_CALL_C_ELLIPSIS_VARARGS:
|
377
378
|
#endif
|
378
|
-
|
379
|
+
case DC_CALL_C_PPC32_OSX:
|
379
380
|
vt = &gVT_ppc32_darwin;
|
380
381
|
break;
|
381
382
|
|
382
|
-
case DC_CALL_C_PPC32_SYSV:
|
383
|
-
|
384
383
|
#if defined(DC__ABI_SysV)
|
385
384
|
case DC_CALL_C_DEFAULT:
|
386
385
|
case DC_CALL_C_ELLIPSIS:
|
387
386
|
case DC_CALL_C_ELLIPSIS_VARARGS:
|
388
387
|
#endif
|
389
|
-
|
388
|
+
case DC_CALL_C_PPC32_SYSV:
|
390
389
|
vt = &gVT_ppc32_sysv;
|
391
390
|
break;
|
392
391
|
|
@@ -399,17 +398,20 @@ void dc_callvm_mode_ppc32(DCCallVM* in_self, DCint mode)
|
|
399
398
|
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
400
399
|
return;
|
401
400
|
}
|
402
|
-
|
401
|
+
|
403
402
|
dc_callvm_base_init(&self->mInterface, vt);
|
404
403
|
}
|
405
404
|
|
405
|
+
/* Public API. */
|
406
406
|
DCCallVM* dcNewCallVM(DCsize size)
|
407
407
|
{
|
408
|
-
DCCallVM_ppc32*
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
408
|
+
DCCallVM_ppc32* p = (DCCallVM_ppc32*)dcAllocMem(sizeof(DCCallVM_ppc32)+size);
|
409
|
+
|
410
|
+
dc_callvm_mode_ppc32((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
411
|
+
|
412
|
+
dcVecInit(&p->mVecHead, size);
|
413
|
+
dc_callvm_reset_ppc32((DCCallVM*)p);
|
414
|
+
|
415
|
+
return (DCCallVM*)p;
|
414
416
|
}
|
415
417
|
|
@@ -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
|
@@ -56,7 +56,5 @@ struct DCCallVM_ppc32_
|
|
56
56
|
DCVecHead mVecHead;
|
57
57
|
};
|
58
58
|
|
59
|
-
DCCallVM* dcNewCallVM_ppc32(DCsize size);
|
60
|
-
|
61
59
|
#endif /* DYNCALL_CALLVM_PPC32_H */
|
62
60
|
|
@@ -74,7 +74,7 @@ static void dc_callvm_argDouble_ppc64(DCCallVM* in_self, DCdouble d)
|
|
74
74
|
{
|
75
75
|
DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self;
|
76
76
|
|
77
|
-
if (self->mFloatRegs < 13) {
|
77
|
+
if (self->mFloatRegs < 13) {
|
78
78
|
self->mRegData.mFloatData[self->mFloatRegs++] = d;
|
79
79
|
if (self->mIntRegs < 8) {
|
80
80
|
self->mRegData.mIntData[self->mIntRegs++] = *( (DClonglong*) &d );
|
@@ -82,7 +82,7 @@ static void dc_callvm_argDouble_ppc64(DCCallVM* in_self, DCdouble d)
|
|
82
82
|
return;
|
83
83
|
#endif
|
84
84
|
}
|
85
|
-
}
|
85
|
+
}
|
86
86
|
|
87
87
|
#if DC__ABI_PPC64_ELF_V == 2
|
88
88
|
if (dcVecSize(&self->mVecHead) == 0) {
|
@@ -99,10 +99,10 @@ static void dc_callvm_argDouble_ppc64_ellipsis(DCCallVM* in_self, DCdouble d)
|
|
99
99
|
{
|
100
100
|
DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self;
|
101
101
|
|
102
|
-
if (dcVecSize(&self->mVecHead) == 0)
|
102
|
+
if (dcVecSize(&self->mVecHead) == 0)
|
103
103
|
dcVecSkip(&self->mVecHead,(sizeof(DClonglong))*(self->mIntRegs));
|
104
104
|
|
105
|
-
if (self->mFloatRegs < 13) {
|
105
|
+
if (self->mFloatRegs < 13) {
|
106
106
|
self->mRegData.mFloatData[self->mFloatRegs++] = d;
|
107
107
|
if (self->mIntRegs < 8) {
|
108
108
|
self->mRegData.mIntData[self->mIntRegs++] = *( (DClonglong*) &d );
|
@@ -116,19 +116,55 @@ static void dc_callvm_argDouble_ppc64_ellipsis(DCCallVM* in_self, DCdouble d)
|
|
116
116
|
|
117
117
|
|
118
118
|
/* Floating-point */
|
119
|
-
|
119
|
+
|
120
120
|
static void dc_callvm_argFloat_ppc64(DCCallVM* in_self, DCfloat f)
|
121
|
+
{
|
122
|
+
DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self;
|
123
|
+
|
124
|
+
DCdouble d;
|
125
|
+
#if defined(DC__Endian_BIG)
|
126
|
+
struct { DCfloat f_pad; DCfloat f; } sf;
|
127
|
+
#else /* Endian_LITTLE */
|
128
|
+
struct { DCfloat f; DCfloat f_pad; } sf;
|
129
|
+
#endif
|
130
|
+
|
131
|
+
if (self->mFloatRegs < 13) {
|
132
|
+
d = (DCdouble)f;
|
133
|
+
self->mRegData.mFloatData[self->mFloatRegs++] = d;
|
134
|
+
if (self->mIntRegs < 8) {
|
135
|
+
self->mRegData.mIntData[self->mIntRegs++] = *( (DClonglong*) &d );
|
136
|
+
#if DC__ABI_PPC64_ELF_V == 2
|
137
|
+
return;
|
138
|
+
#endif
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
#if DC__ABI_PPC64_ELF_V == 2
|
143
|
+
if (dcVecSize(&self->mVecHead) == 0) {
|
144
|
+
dcVecSkip(&self->mVecHead,sizeof(DClonglong)*8);
|
145
|
+
}
|
146
|
+
#endif
|
147
|
+
|
148
|
+
/* push on stack */
|
149
|
+
sf.f = f;
|
150
|
+
dcVecAppend(&self->mVecHead,(DCpointer) &sf,sizeof(DCdouble));
|
151
|
+
}
|
152
|
+
|
153
|
+
#if DC__ABI_PPC64_ELF_V == 2
|
154
|
+
static void dc_callvm_argFloat_ppc64_ellipsis(DCCallVM* in_self, DCfloat f)
|
121
155
|
{
|
122
156
|
/* promote to double */
|
123
157
|
dcArgDouble(in_self, (DCdouble) f );
|
124
158
|
}
|
159
|
+
#endif
|
160
|
+
|
125
161
|
|
126
162
|
/* long long integer */
|
127
163
|
|
128
164
|
static void dc_callvm_argLongLong_ppc64(DCCallVM* in_self, DClonglong L)
|
129
165
|
{
|
130
166
|
DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self;
|
131
|
-
|
167
|
+
|
132
168
|
/* fillup integer register file */
|
133
169
|
if (self->mIntRegs < 8) {
|
134
170
|
self->mRegData.mIntData[self->mIntRegs++] = L;
|
@@ -259,7 +295,7 @@ DCCallVM_vt gVT_ppc64_ellipsis =
|
|
259
295
|
, &dc_callvm_argInt_ppc64
|
260
296
|
, &dc_callvm_argLong_ppc64
|
261
297
|
, &dc_callvm_argLongLong_ppc64_ellipsis
|
262
|
-
, &
|
298
|
+
, &dc_callvm_argFloat_ppc64_ellipsis
|
263
299
|
, &dc_callvm_argDouble_ppc64_ellipsis
|
264
300
|
, &dc_callvm_argPointer_ppc64
|
265
301
|
, NULL /* argStruct */
|
@@ -309,10 +345,10 @@ void dc_callvm_mode_ppc64(DCCallVM* in_self, DCint mode)
|
|
309
345
|
{
|
310
346
|
DCCallVM_ppc64* self = (DCCallVM_ppc64*) in_self;
|
311
347
|
DCCallVM_vt* vt;
|
312
|
-
switch(mode) {
|
313
348
|
|
314
|
-
|
349
|
+
switch(mode) {
|
315
350
|
case DC_CALL_C_DEFAULT:
|
351
|
+
case DC_CALL_C_PPC64:
|
316
352
|
case DC_CALL_C_ELLIPSIS:
|
317
353
|
#if DC__ABI_PPC64_ELF_V == 2
|
318
354
|
vt = &gVT_ppc64;
|
@@ -339,13 +375,16 @@ void dc_callvm_mode_ppc64(DCCallVM* in_self, DCint mode)
|
|
339
375
|
dc_callvm_base_init(&self->mInterface, vt);
|
340
376
|
}
|
341
377
|
|
378
|
+
/* Public API. */
|
342
379
|
DCCallVM* dcNewCallVM(DCsize size)
|
343
380
|
{
|
344
|
-
DCCallVM_ppc64*
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
381
|
+
DCCallVM_ppc64* p = (DCCallVM_ppc64*)dcAllocMem(sizeof(DCCallVM_ppc64)+size);
|
382
|
+
|
383
|
+
dc_callvm_mode_ppc64((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
384
|
+
|
385
|
+
dcVecInit(&p->mVecHead, size);
|
386
|
+
dc_callvm_reset_ppc64((DCCallVM*)p);
|
387
|
+
|
388
|
+
return (DCCallVM*)p;
|
350
389
|
}
|
351
390
|
|