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: Call VM for sparc processor architecture.
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011-
|
9
|
+
Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>
|
10
10
|
|
11
11
|
Permission to use, copy, modify, and distribute this software for any
|
12
12
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -29,16 +29,6 @@
|
|
29
29
|
#include "dyncall_utils.h"
|
30
30
|
#include "dyncall_alloc.h"
|
31
31
|
#define DEFAULT_STACK_ALIGN 16
|
32
|
-
/* Construtor. */
|
33
|
-
/* the six output registers %o0-%o5 are always loaded, thus we need to ensure the argument buffer has space for at least 24 bytes. */
|
34
|
-
static DCCallVM* dc_callvm_new_sparc(DCCallVM_vt* vt, DCsize size)
|
35
|
-
{
|
36
|
-
size=DC_MAX(size,sizeof(void*)*(6+1));
|
37
|
-
DCCallVM_sparc* self = (DCCallVM_sparc*) dcAllocMem(sizeof(DCCallVM_sparc)+size);
|
38
|
-
dc_callvm_base_init(&self->mInterface, vt);
|
39
|
-
dcVecInit(&self->mVecHead,size);
|
40
|
-
return (DCCallVM*)self;
|
41
|
-
}
|
42
32
|
|
43
33
|
/* Destructor. */
|
44
34
|
static void dc_callvm_free_sparc(DCCallVM* in_self)
|
@@ -95,20 +85,6 @@ static void dc_callvm_argDouble_sparc(DCCallVM* in_self, DCdouble x)
|
|
95
85
|
dcVecAppend(&self->mVecHead, &x, sizeof(DCdouble));
|
96
86
|
}
|
97
87
|
|
98
|
-
/* mode: only a single mode available currently. */
|
99
|
-
static void dc_callvm_mode_sparc(DCCallVM* in_self, DCint mode)
|
100
|
-
{
|
101
|
-
switch(mode) {
|
102
|
-
case DC_CALL_C_DEFAULT:
|
103
|
-
case DC_CALL_C_ELLIPSIS:
|
104
|
-
case DC_CALL_C_SPARC32:
|
105
|
-
break;
|
106
|
-
default:
|
107
|
-
in_self->mError = DC_ERROR_UNSUPPORTED_MODE;
|
108
|
-
break;
|
109
|
-
}
|
110
|
-
}
|
111
|
-
|
112
88
|
/* we call directly with 'RTYPE dcCall(DCCallVM* in_self, DCpointer target)' */
|
113
89
|
#if 0
|
114
90
|
/* call: delegate to default call kernel */
|
@@ -119,6 +95,8 @@ static void dc_callvm_call_sparc(DCCallVM* in_self, DCpointer target)
|
|
119
95
|
}
|
120
96
|
#endif
|
121
97
|
|
98
|
+
static void dc_callvm_mode_sparc(DCCallVM* in_self, DCint mode);
|
99
|
+
|
122
100
|
/* CallVM virtual table. */
|
123
101
|
DCCallVM_vt gVT_sparc =
|
124
102
|
{
|
@@ -148,9 +126,39 @@ DCCallVM_vt gVT_sparc =
|
|
148
126
|
NULL /* callStruct */
|
149
127
|
};
|
150
128
|
|
129
|
+
/* mode: only a single mode available currently. */
|
130
|
+
static void dc_callvm_mode_sparc(DCCallVM* in_self, DCint mode)
|
131
|
+
{
|
132
|
+
DCCallVM_sparc* self = (DCCallVM_sparc*)in_self;
|
133
|
+
DCCallVM_vt* vt;
|
134
|
+
|
135
|
+
switch(mode) {
|
136
|
+
case DC_CALL_C_DEFAULT:
|
137
|
+
case DC_CALL_C_SPARC32:
|
138
|
+
case DC_CALL_C_ELLIPSIS:
|
139
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
140
|
+
vt = &gVT_sparc;
|
141
|
+
break;
|
142
|
+
default:
|
143
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
147
|
+
}
|
148
|
+
|
151
149
|
/* Public API. */
|
152
150
|
DCCallVM* dcNewCallVM(DCsize size)
|
153
151
|
{
|
154
|
-
|
152
|
+
DCCallVM_sparc* p;
|
153
|
+
|
154
|
+
/* the six output registers %o0-%o5 are always loaded, thus we need to ensure the argument buffer has space for at least 24 bytes. */
|
155
|
+
size = DC_MAX(size, sizeof(void*)*(6+1));
|
156
|
+
p = (DCCallVM_sparc*)dcAllocMem(sizeof(DCCallVM_sparc)+size);
|
157
|
+
|
158
|
+
dc_callvm_mode_sparc((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
159
|
+
|
160
|
+
dcVecInit(&p->mVecHead, size);
|
161
|
+
|
162
|
+
return (DCCallVM*)p;
|
155
163
|
}
|
156
164
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Call VM for sparc processor architecture.
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011-
|
9
|
+
Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>
|
10
10
|
|
11
11
|
Permission to use, copy, modify, and distribute this software for any
|
12
12
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -39,7 +39,5 @@ struct DCCallVM_sparc_
|
|
39
39
|
DCVecHead mVecHead; /* 8 bytes (max,size) */
|
40
40
|
};
|
41
41
|
|
42
|
-
DCCallVM* dcNewCallVM_sparc(DCsize size);
|
43
|
-
|
44
42
|
#endif /* DYNCALL_CALLVM_SPARC_H */
|
45
43
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_callvm_sparc64.c
|
6
|
-
Description: Call VM for sparc64
|
6
|
+
Description: Call VM for sparc64 (v9) ABI.
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011-
|
9
|
+
Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>
|
10
10
|
|
11
11
|
Permission to use, copy, modify, and distribute this software for any
|
12
12
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -28,212 +28,156 @@
|
|
28
28
|
#include "dyncall_call_sparc64.h"
|
29
29
|
#include "dyncall_alloc.h"
|
30
30
|
|
31
|
-
#define IREGS 6
|
32
|
-
#define FREGS 16
|
33
|
-
#define SREGS 16
|
34
|
-
#define DHEAD (IREGS+FREGS)*8+SREGS*4
|
35
|
-
|
36
31
|
/* Reset argument buffer. */
|
37
|
-
static void
|
32
|
+
static void dc_callvm_reset_v9(DCCallVM* in_self)
|
38
33
|
{
|
39
|
-
|
40
|
-
dcVecResize(&self->mVecHead,
|
41
|
-
self->mIntRegs = 0;
|
42
|
-
self->mFloatRegs = 0;
|
43
|
-
self->mUseSingleFlags = 0;
|
34
|
+
DCCallVM_v9* self = (DCCallVM_v9*)in_self;
|
35
|
+
dcVecResize(&self->mVecHead, 0);
|
44
36
|
}
|
45
37
|
|
46
|
-
/* Construtor. */
|
47
|
-
/* the six output registers %o0-%o5 are always loaded, thus we need to ensure the argument buffer has space for at least 24 bytes. */
|
48
|
-
static DCCallVM* dc_callvm_new_sparc64(DCCallVM_vt* vt, DCsize size)
|
49
|
-
{
|
50
|
-
DCCallVM_sparc64* self = (DCCallVM_sparc64*) dcAllocMem(sizeof(DCCallVM_sparc64)+DHEAD+size);
|
51
|
-
dc_callvm_base_init(&self->mInterface, vt);
|
52
|
-
dcVecInit(&self->mVecHead,DHEAD+size);
|
53
|
-
dc_callvm_reset_sparc64(&self->mInterface);
|
54
|
-
return (DCCallVM*)self;
|
55
|
-
}
|
56
38
|
|
57
39
|
/* Destructor. */
|
58
|
-
static void
|
40
|
+
static void dc_callvm_free_v9(DCCallVM* in_self)
|
59
41
|
{
|
60
42
|
dcFreeMem(in_self);
|
61
43
|
}
|
62
44
|
|
63
|
-
|
64
|
-
|
65
|
-
static void dc_callvm_argLongLong_sparc64(DCCallVM* in_self, DClonglong x)
|
45
|
+
static void dc_callvm_argLongLong_v9(DCCallVM* in_self, DClonglong x)
|
66
46
|
{
|
67
|
-
|
68
|
-
|
69
|
-
* ( (DClonglong*) ( dcVecAt(&self->mVecHead, (self->mIntRegs++)*8) ) ) = x;
|
70
|
-
} else {
|
71
|
-
dcVecAppend(&self->mVecHead, &x, sizeof(DClonglong));
|
72
|
-
}
|
73
|
-
if (self->mFloatRegs < FREGS) self->mFloatRegs++;
|
47
|
+
DCCallVM_v9* self = (DCCallVM_v9*)in_self;
|
48
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DClonglong));
|
74
49
|
}
|
75
50
|
|
76
|
-
|
77
|
-
static void
|
78
|
-
static void
|
79
|
-
static void
|
80
|
-
static void
|
81
|
-
static void
|
82
|
-
|
83
|
-
|
51
|
+
/* all integers are promoted to 64-bit. */
|
52
|
+
static void dc_callvm_argLong_v9 (DCCallVM* in_self, DClong x) { dc_callvm_argLongLong_v9(in_self, (DClonglong) x ); }
|
53
|
+
static void dc_callvm_argInt_v9 (DCCallVM* in_self, DCint x) { dc_callvm_argLongLong_v9(in_self, (DClonglong) x ); }
|
54
|
+
static void dc_callvm_argBool_v9 (DCCallVM* in_self, DCbool x) { dc_callvm_argLongLong_v9(in_self, (DClonglong) x ); }
|
55
|
+
static void dc_callvm_argChar_v9 (DCCallVM* in_self, DCchar x) { dc_callvm_argLongLong_v9(in_self, (DClonglong) x ); }
|
56
|
+
static void dc_callvm_argShort_v9 (DCCallVM* in_self, DCshort x) { dc_callvm_argLongLong_v9(in_self, (DClonglong) x ); }
|
57
|
+
static void dc_callvm_argPointer_v9(DCCallVM* in_self, DCpointer x) { dc_callvm_argLongLong_v9(in_self, (DClonglong) x ); }
|
58
|
+
|
59
|
+
static void dc_callvm_argDouble_v9(DCCallVM* in_self, DCdouble x)
|
84
60
|
{
|
85
|
-
|
86
|
-
|
87
|
-
* ((double*)dcVecAt(&self->mVecHead,(IREGS+(self->mFloatRegs++))*8)) = x;
|
88
|
-
}
|
89
|
-
if (self->mIntRegs < IREGS) {
|
90
|
-
self->mIntRegs++;
|
91
|
-
} else {
|
92
|
-
dcVecAppend(&self->mVecHead, &x, sizeof(DCdouble));
|
93
|
-
}
|
61
|
+
DCCallVM_v9* self = (DCCallVM_v9*)in_self;
|
62
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DCdouble));
|
94
63
|
}
|
95
64
|
|
96
|
-
static void
|
65
|
+
static void dc_callvm_argDouble_v9_ellipsis(DCCallVM* in_self, DCdouble x)
|
97
66
|
{
|
98
67
|
union {
|
99
68
|
long long l;
|
100
69
|
double d;
|
101
70
|
} u;
|
102
71
|
u.d = x;
|
103
|
-
|
72
|
+
dc_callvm_argLongLong_v9(in_self, u.l);
|
104
73
|
}
|
105
74
|
|
106
|
-
static void
|
75
|
+
static void dc_callvm_argFloat_v9_ellipsis(DCCallVM* in_self, DCfloat x)
|
107
76
|
{
|
108
|
-
|
77
|
+
dc_callvm_argDouble_v9_ellipsis(in_self, (DCdouble) x);
|
109
78
|
}
|
110
79
|
|
111
|
-
static void
|
80
|
+
static void dc_callvm_argFloat_v9(DCCallVM* in_self, DCfloat x)
|
112
81
|
{
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
if (self->mIntRegs < IREGS) {
|
120
|
-
self->mIntRegs++;
|
121
|
-
} else {
|
122
|
-
union {
|
123
|
-
DCdouble d;
|
124
|
-
DClonglong l;
|
125
|
-
DCfloat f[2];
|
126
|
-
} u;
|
127
|
-
u.f[1] = x;
|
128
|
-
dcVecAppend(&self->mVecHead, &u.l, sizeof(DClonglong));
|
129
|
-
}
|
130
|
-
}
|
131
|
-
|
132
|
-
#if 0
|
133
|
-
/* call: delegate to default call kernel */
|
134
|
-
static void dc_callvm_call_sparc64(DCCallVM* in_self, DCpointer target)
|
135
|
-
{
|
136
|
-
DCCallVM_sparc64* self = (DCCallVM_sparc64*)in_self;
|
137
|
-
dcCall_sparc64(target, dcVecSize(&self->mVecHead), dcVecData(&self->mVecHead));
|
82
|
+
union {
|
83
|
+
double d;
|
84
|
+
float f[2];
|
85
|
+
} u;
|
86
|
+
u.f[1] = x;
|
87
|
+
dc_callvm_argDouble_v9(in_self, u.d);
|
138
88
|
}
|
139
|
-
#endif
|
140
89
|
|
141
|
-
static void
|
90
|
+
static void dc_callvm_mode_v9(DCCallVM* in_self, DCint mode);
|
142
91
|
|
143
|
-
DCCallVM_vt
|
92
|
+
DCCallVM_vt gVT_v9_ellipsis =
|
144
93
|
{
|
145
|
-
&
|
146
|
-
&
|
147
|
-
&
|
148
|
-
&
|
149
|
-
&
|
150
|
-
&
|
151
|
-
&
|
152
|
-
&
|
153
|
-
&
|
154
|
-
&
|
155
|
-
&
|
156
|
-
&
|
94
|
+
&dc_callvm_free_v9,
|
95
|
+
&dc_callvm_reset_v9,
|
96
|
+
&dc_callvm_mode_v9,
|
97
|
+
&dc_callvm_argBool_v9,
|
98
|
+
&dc_callvm_argChar_v9,
|
99
|
+
&dc_callvm_argShort_v9,
|
100
|
+
&dc_callvm_argInt_v9,
|
101
|
+
&dc_callvm_argLong_v9,
|
102
|
+
&dc_callvm_argLongLong_v9,
|
103
|
+
&dc_callvm_argFloat_v9_ellipsis,
|
104
|
+
&dc_callvm_argDouble_v9_ellipsis,
|
105
|
+
&dc_callvm_argPointer_v9,
|
157
106
|
NULL /* argStruct */,
|
158
|
-
(DCvoidvmfunc*) &
|
159
|
-
(DCboolvmfunc*) &
|
160
|
-
(DCcharvmfunc*) &
|
161
|
-
(DCshortvmfunc*) &
|
162
|
-
(DCintvmfunc*) &
|
163
|
-
(DClongvmfunc*) &
|
164
|
-
(DClonglongvmfunc*) &
|
165
|
-
(DCfloatvmfunc*) &
|
166
|
-
(DCdoublevmfunc*) &
|
167
|
-
(DCpointervmfunc*) &
|
107
|
+
(DCvoidvmfunc*) &dcCall_v9,
|
108
|
+
(DCboolvmfunc*) &dcCall_v9,
|
109
|
+
(DCcharvmfunc*) &dcCall_v9,
|
110
|
+
(DCshortvmfunc*) &dcCall_v9,
|
111
|
+
(DCintvmfunc*) &dcCall_v9,
|
112
|
+
(DClongvmfunc*) &dcCall_v9,
|
113
|
+
(DClonglongvmfunc*) &dcCall_v9,
|
114
|
+
(DCfloatvmfunc*) &dcCall_v9,
|
115
|
+
(DCdoublevmfunc*) &dcCall_v9,
|
116
|
+
(DCpointervmfunc*) &dcCall_v9,
|
168
117
|
NULL /* callStruct */
|
169
118
|
};
|
170
119
|
|
171
120
|
/* CallVM virtual table. */
|
172
|
-
DCCallVM_vt
|
121
|
+
DCCallVM_vt gVT_v9 =
|
173
122
|
{
|
174
|
-
&
|
175
|
-
&
|
176
|
-
&
|
177
|
-
&
|
178
|
-
&
|
179
|
-
&
|
180
|
-
&
|
181
|
-
&
|
182
|
-
&
|
183
|
-
&
|
184
|
-
&
|
185
|
-
&
|
123
|
+
&dc_callvm_free_v9,
|
124
|
+
&dc_callvm_reset_v9,
|
125
|
+
&dc_callvm_mode_v9,
|
126
|
+
&dc_callvm_argBool_v9,
|
127
|
+
&dc_callvm_argChar_v9,
|
128
|
+
&dc_callvm_argShort_v9,
|
129
|
+
&dc_callvm_argInt_v9,
|
130
|
+
&dc_callvm_argLong_v9,
|
131
|
+
&dc_callvm_argLongLong_v9,
|
132
|
+
&dc_callvm_argFloat_v9,
|
133
|
+
&dc_callvm_argDouble_v9,
|
134
|
+
&dc_callvm_argPointer_v9,
|
186
135
|
NULL /* argStruct */,
|
187
|
-
(DCvoidvmfunc*) &
|
188
|
-
(DCboolvmfunc*) &
|
189
|
-
(DCcharvmfunc*) &
|
190
|
-
(DCshortvmfunc*) &
|
191
|
-
(DCintvmfunc*) &
|
192
|
-
(DClongvmfunc*) &
|
193
|
-
(DClonglongvmfunc*) &
|
194
|
-
(DCfloatvmfunc*) &
|
195
|
-
(DCdoublevmfunc*) &
|
196
|
-
(DCpointervmfunc*) &
|
136
|
+
(DCvoidvmfunc*) &dcCall_v9,
|
137
|
+
(DCboolvmfunc*) &dcCall_v9,
|
138
|
+
(DCcharvmfunc*) &dcCall_v9,
|
139
|
+
(DCshortvmfunc*) &dcCall_v9,
|
140
|
+
(DCintvmfunc*) &dcCall_v9,
|
141
|
+
(DClongvmfunc*) &dcCall_v9,
|
142
|
+
(DClonglongvmfunc*) &dcCall_v9,
|
143
|
+
(DCfloatvmfunc*) &dcCall_v9,
|
144
|
+
(DCdoublevmfunc*) &dcCall_v9,
|
145
|
+
(DCpointervmfunc*) &dcCall_v9,
|
197
146
|
NULL /* callStruct */
|
198
147
|
};
|
199
148
|
|
200
149
|
/* mode: only a single mode available currently. */
|
201
|
-
static void
|
150
|
+
static void dc_callvm_mode_v9(DCCallVM* in_self, DCint mode)
|
202
151
|
{
|
152
|
+
DCCallVM_v9* self = (DCCallVM_v9*)in_self;
|
153
|
+
DCCallVM_vt* vt;
|
154
|
+
|
203
155
|
switch(mode) {
|
204
156
|
case DC_CALL_C_DEFAULT:
|
205
|
-
case DC_CALL_C_ELLIPSIS:
|
206
157
|
case DC_CALL_C_SPARC64:
|
207
|
-
|
158
|
+
case DC_CALL_C_ELLIPSIS:
|
159
|
+
vt = &gVT_v9;
|
208
160
|
break;
|
209
161
|
case DC_CALL_C_ELLIPSIS_VARARGS:
|
210
|
-
|
162
|
+
vt = &gVT_v9_ellipsis;
|
211
163
|
break;
|
212
164
|
default:
|
213
|
-
|
214
|
-
|
165
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
166
|
+
return;
|
215
167
|
}
|
168
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
216
169
|
}
|
217
170
|
|
218
|
-
|
219
171
|
/* Public API. */
|
220
172
|
DCCallVM* dcNewCallVM(DCsize size)
|
221
173
|
{
|
222
|
-
|
223
|
-
}
|
174
|
+
DCCallVM_v9* p = (DCCallVM_v9*)dcAllocMem(sizeof(DCCallVM_v9)+size);
|
224
175
|
|
225
|
-
|
226
|
-
/* Load integer 32-bit. */
|
227
|
-
static void dc_callvm_argInt_sparc64(DCCallVM* in_self, DCint x)
|
228
|
-
{
|
229
|
-
DCCallVM_sparc64* self = (DCCallVM_sparc64*)in_self;
|
230
|
-
dcVecAppend(&self->mVecHead, &x, sizeof(DCint));
|
231
|
-
}
|
176
|
+
dc_callvm_mode_v9((DCCallVM*)p, DC_CALL_C_DEFAULT);
|
232
177
|
|
233
|
-
|
178
|
+
dcVecInit(&p->mVecHead,size);
|
179
|
+
dc_callvm_reset_v9(&p->mInterface);
|
234
180
|
|
235
|
-
|
236
|
-
|
237
|
-
static void dc_callvm_argShort_sparc64(DCCallVM* in_self, DCshort x) { dc_callvm_argInt_sparc64(in_self, (DCint)x); }
|
238
|
-
#endif
|
181
|
+
return (DCCallVM*)p;
|
182
|
+
}
|
239
183
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_callvm_sparc64.h
|
6
|
-
Description: Call VM for sparc64
|
6
|
+
Description: Call VM for sparc64 (v9) ABI.
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011-
|
9
|
+
Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>
|
10
10
|
|
11
11
|
Permission to use, copy, modify, and distribute this software for any
|
12
12
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -24,25 +24,19 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
#ifndef
|
28
|
-
#define
|
27
|
+
#ifndef DYNCALL_CALLVM_SPARC_V9_H
|
28
|
+
#define DYNCALL_CALLVM_SPARC_V9_H
|
29
29
|
|
30
30
|
#include "dyncall_callvm.h"
|
31
31
|
#include "dyncall_vector.h"
|
32
32
|
|
33
|
-
typedef struct
|
34
|
-
struct DCCallVM_sparc64_
|
33
|
+
typedef struct
|
35
34
|
{
|
36
|
-
DCCallVM mInterface;
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
};
|
42
|
-
|
43
|
-
DCCallVM* dcNewCallVM_sparc64(DCsize size);
|
44
|
-
|
45
|
-
#endif /* DYNCALL_CALLVM_SPARC64_H */
|
46
|
-
|
35
|
+
DCCallVM mInterface; /* 0: +12:8 = 16*/
|
36
|
+
DCVecHead mVecHead; /* 16 152: mTotalSize +8 */
|
37
|
+
/* 24 160: mSize +8 */
|
38
|
+
/* 32 168: mData */
|
39
|
+
} DCCallVM_v9;
|
47
40
|
|
41
|
+
#endif /* DYNCALL_CALLVM_SPARC_V9_H */
|
48
42
|
|