rbdc 0.8.7 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/{bindings → dyncall-bindings}/ruby/rbdc/extconf.rb +1 -1
- data/{bindings → dyncall-bindings}/ruby/rbdc/rbdc.c +3 -1
- data/dyncall/AUTHORS +2 -0
- data/dyncall/BUGS +1 -0
- data/dyncall/CMakeLists.txt +10 -2
- data/dyncall/ChangeLog +46 -11
- data/dyncall/LICENSE +4 -1
- data/dyncall/Makefile.embedded +7 -3
- data/dyncall/README +23 -14
- data/dyncall/ToDo +27 -28
- data/dyncall/autovar/autovar_ABI.h +3 -2
- data/dyncall/autovar/autovar_ARCH.h +13 -10
- data/dyncall/autovar/autovar_CC.h +3 -2
- data/dyncall/autovar/autovar_OS.h +3 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +3 -2
- data/dyncall/buildsys/scripts/batch-build-linux.sh +6 -2
- data/dyncall/buildsys/scripts/batch-build-minix.sh +2 -0
- data/dyncall/buildsys/scripts/batch-build-psp.sh +4 -1
- data/dyncall/buildsys/scripts/elf-to-psp-eboot.sh +19 -0
- data/dyncall/buildsys/scripts/setenv-cross-ios.sh +0 -0
- data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +0 -0
- data/dyncall/configure +83 -30
- data/dyncall/dyncall/dyncall.3 +16 -4
- data/dyncall/dyncall/dyncall.h +9 -1
- data/dyncall/dyncall/dyncall_alloc.h +2 -1
- data/dyncall/dyncall/dyncall_api.c +2 -1
- data/dyncall/dyncall/dyncall_call.S +9 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +2 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +8 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +11 -19
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +15 -2
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +8 -6
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +10 -18
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +0 -16
- data/dyncall/dyncall/dyncall_call_arm64.S +226 -0
- data/dyncall/dyncall/dyncall_call_arm64.h +45 -0
- data/dyncall/dyncall/dyncall_call_mips.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -1
- data/dyncall/dyncall/dyncall_call_mips_n32.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_n64.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_o32.h +2 -1
- data/dyncall/dyncall/dyncall_call_ppc32.S +27 -2
- data/dyncall/dyncall/dyncall_call_ppc32.h +2 -2
- data/dyncall/dyncall/dyncall_call_ppc64.S +210 -0
- data/dyncall/dyncall/dyncall_call_ppc64.h +55 -0
- data/dyncall/dyncall/dyncall_call_sparc.S +2 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +2 -1
- data/dyncall/dyncall/dyncall_call_sparc64.S +2 -1
- data/dyncall/dyncall/dyncall_call_sparc64.h +2 -1
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +25 -23
- data/dyncall/dyncall/dyncall_call_sparc_v9.h +2 -1
- data/dyncall/dyncall/dyncall_call_x64-att.S +2 -1
- data/dyncall/dyncall/dyncall_call_x64.S +2 -1
- data/dyncall/dyncall/dyncall_call_x64.h +2 -1
- data/dyncall/dyncall/dyncall_call_x86.S +2 -1
- data/dyncall/dyncall/dyncall_call_x86.h +2 -1
- data/dyncall/dyncall/dyncall_callf.c +56 -66
- data/dyncall/dyncall/dyncall_callf.h +5 -1
- data/dyncall/dyncall/dyncall_callvm.c +11 -2
- data/dyncall/dyncall/dyncall_callvm.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +60 -30
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +3 -2
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +2 -24
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm64.c +165 -0
- data/dyncall/dyncall/dyncall_callvm_arm64.h +51 -0
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +272 -0
- data/dyncall/dyncall/dyncall_callvm_base.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +45 -2
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +351 -0
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +60 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +2 -2
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +3 -3
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_x64.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_x64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_x86.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_x86.h +2 -1
- data/dyncall/dyncall/dyncall_config.h +2 -1
- data/dyncall/dyncall/dyncall_macros.h +46 -9
- data/dyncall/dyncall/dyncall_signature.h +2 -1
- data/dyncall/dyncall/dyncall_struct.c +2 -1
- data/dyncall/dyncall/dyncall_struct.h +2 -1
- data/dyncall/dyncall/dyncall_types.h +2 -1
- data/dyncall/dyncall/dyncall_utils.h +2 -1
- data/dyncall/dyncall/dyncall_value.h +19 -1
- data/dyncall/dyncall/dyncall_vector.c +2 -1
- data/dyncall/dyncall/dyncall_vector.h +3 -1
- data/dyncall/dyncall/gen-masm.sh +0 -0
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +2 -1
- data/dyncall/dyncallback/dyncall_args.c +22 -10
- data/dyncall/dyncallback/dyncall_args.h +2 -1
- data/dyncall/dyncallback/dyncall_args_arm32_arm.c +35 -4
- data/dyncall/dyncallback/dyncall_args_arm32_arm.h +7 -1
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/dyncall_args_arm64.c +77 -0
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +160 -0
- data/dyncall/dyncallback/dyncall_args_mips.c +3 -2
- data/dyncall/dyncallback/dyncall_args_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -1
- data/dyncall/dyncallback/dyncall_args_ppc32.h +9 -7
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +95 -0
- data/dyncall/dyncallback/dyncall_args_ppc64.c +71 -0
- data/dyncall/dyncallback/dyncall_args_ppc64.h +40 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc64.h +2 -1
- data/dyncall/dyncallback/dyncall_args_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +2 -1
- data/dyncall/dyncallback/dyncall_callback.c +7 -2
- data/dyncall/dyncallback/dyncall_callback.h +3 -1
- data/dyncall/dyncallback/dyncall_callback_arch.S +14 -6
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +1 -1
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm_gas.s → dyncall_callback_arm32_arm_gas.S} +17 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_apple.s → dyncall_callback_arm32_thumb_apple.S} +2 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_gas.s → dyncall_callback_arm32_thumb_gas.S} +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.S +111 -0
- data/dyncall/dyncallback/dyncall_callback_arm64.c +71 -0
- data/dyncall/dyncallback/dyncall_callback_mips.c +3 -2
- data/dyncall/dyncallback/dyncall_callback_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +115 -4
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +3 -2
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +6 -6
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +6 -5
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +170 -0
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +60 -0
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +56 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +1 -1
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +1 -1
- data/dyncall/dyncallback/dyncall_callback_x64.S +5 -12
- data/dyncall/dyncallback/dyncall_callback_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +0 -7
- data/dyncall/dyncallback/dyncall_callback_x86.S +5 -12
- data/dyncall/dyncallback/dyncall_callback_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_x86.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +2 -11
- data/dyncall/dyncallback/dyncall_thunk.c +11 -3
- data/dyncall/dyncallback/dyncall_thunk.h +8 -2
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +64 -0
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +42 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.c +49 -17
- data/dyncall/dyncallback/dyncall_thunk_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +3 -2
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +7 -7
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +50 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +87 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc64.h +55 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -1
- data/dyncall/dyncallback/dyncallback.3 +3 -3
- data/dyncall/dyncallback/gen-masm.sh +0 -0
- data/dyncall/dynload/dynload.c +2 -1
- data/dyncall/dynload/dynload.h +2 -1
- data/dyncall/dynload/dynload_alloc.h +2 -1
- data/dyncall/dynload/dynload_darwin.c +2 -1
- data/dyncall/dynload/dynload_syms.c +2 -1
- data/dyncall/dynload/dynload_syms_elf.c +2 -1
- data/dyncall/dynload/dynload_syms_mach-o.c +3 -2
- data/dyncall/dynload/dynload_syms_pe.c +2 -1
- data/dyncall/dynload/dynload_unix.c +2 -1
- data/dyncall/dynload/dynload_windows.c +2 -1
- data/dyncall/portasm/gen-masm.sh +0 -0
- data/dyncall/portasm/portasm-arm.S +3 -2
- data/dyncall/portasm/portasm-ppc.S +2 -1
- data/dyncall/portasm/portasm-ppc64.S +119 -0
- data/dyncall/portasm/portasm-x64-att.S +2 -1
- data/dyncall/portasm/portasm-x86.S +2 -1
- metadata +39 -18
- data/dyncall/dyncallback/dyncall_callback_x64_apple.s +0 -122
- data/dyncall/dyncallback/dyncall_callback_x64_gas.s +0 -119
- data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +0 -102
@@ -0,0 +1,51 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm_arm64.h
|
6
|
+
Description:
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
#ifndef DYNCALL_CALLVM_ARM64_H
|
27
|
+
#define DYNCALL_CALLVM_ARM64_H
|
28
|
+
|
29
|
+
#include "dyncall_call_arm64.h"
|
30
|
+
#include "dyncall_callvm.h"
|
31
|
+
#include "dyncall_vector.h"
|
32
|
+
|
33
|
+
|
34
|
+
typedef struct
|
35
|
+
{
|
36
|
+
DCCallVM mInterface;
|
37
|
+
unsigned int i; /* int register counter */
|
38
|
+
unsigned int f; /* float register counter */
|
39
|
+
union { /* float register buffer */
|
40
|
+
DCfloat S[16];
|
41
|
+
DCdouble D[8];
|
42
|
+
} u;
|
43
|
+
unsigned long long I[8]; /* int register buffer */
|
44
|
+
DCVecHead mVecHead; /* argument buffer head */
|
45
|
+
} DCCallVM_arm64;
|
46
|
+
|
47
|
+
DCCallVM* dcNewCallVM_arm64(DCsize size);
|
48
|
+
|
49
|
+
|
50
|
+
#endif /* DYNCALL_CALLVM_ARM64_DEBIAN_H */
|
51
|
+
|
@@ -0,0 +1,272 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm_arm64_apple.c
|
6
|
+
Description: ARM 64-bit Apple ABI implementation
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
|
27
|
+
#include "dyncall_callvm_arm64.h"
|
28
|
+
#include "dyncall_alloc.h"
|
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
|
+
|
44
|
+
static void reset(DCCallVM* in_p)
|
45
|
+
{
|
46
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
47
|
+
p->i = 0;
|
48
|
+
p->f = 0;
|
49
|
+
dcVecReset(&p->mVecHead);
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
static void mode(DCCallVM* in_p,DCint mode);
|
54
|
+
|
55
|
+
static void deinit(DCCallVM* in_p)
|
56
|
+
{
|
57
|
+
dcFreeMem(in_p);
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
static void a_i64(DCCallVM* in_p, DClonglong x)
|
63
|
+
{
|
64
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
65
|
+
if (p->i < 8) {
|
66
|
+
p->I[p->i] = x;
|
67
|
+
p->i++;
|
68
|
+
} else {
|
69
|
+
dcVecAlign(&p->mVecHead, sizeof(DClonglong));
|
70
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DClonglong));
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
static void var_i64 (DCCallVM* in_p, DClonglong x)
|
75
|
+
{
|
76
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
77
|
+
dcVecAlign(&p->mVecHead, sizeof(DClonglong));
|
78
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DClonglong));
|
79
|
+
}
|
80
|
+
static void var_bool (DCCallVM* in_p, DCbool x) { var_i64( in_p, ((DClonglong) x) ); }
|
81
|
+
static void var_char (DCCallVM* in_p, DCchar x) { var_i64( in_p, ((DClonglong) x) ); }
|
82
|
+
static void var_short (DCCallVM* in_p, DCshort x) { var_i64( in_p, ((DClonglong) x) ); }
|
83
|
+
static void var_int (DCCallVM* in_p, DCint x) { var_i64( in_p, ((DClonglong) x) ); }
|
84
|
+
static void var_long (DCCallVM* in_p, DClong x) { var_i64( in_p, ((DClonglong) x) ); }
|
85
|
+
static void var_double (DCCallVM* in_p, DCdouble x) {
|
86
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
87
|
+
dcVecAlign(&p->mVecHead, sizeof(DCdouble));
|
88
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DCdouble));
|
89
|
+
}
|
90
|
+
static void var_float (DCCallVM* in_p, DCfloat x) {
|
91
|
+
var_double( in_p, (DCdouble) x );
|
92
|
+
}
|
93
|
+
static void var_pointer (DCCallVM* in_p, DCpointer x) {
|
94
|
+
var_i64(in_p, (DClonglong) x );
|
95
|
+
}
|
96
|
+
|
97
|
+
static void a_bool (DCCallVM* in_p, DCbool x)
|
98
|
+
{
|
99
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
100
|
+
if (p->i < 8) {
|
101
|
+
p->I[p->i] = (DClonglong) x;
|
102
|
+
p->i++;
|
103
|
+
} else {
|
104
|
+
dcVecAlign(&p->mVecHead, sizeof(DCbool));
|
105
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DCbool));
|
106
|
+
}
|
107
|
+
}
|
108
|
+
static void a_char (DCCallVM* in_p, DCchar x)
|
109
|
+
{
|
110
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
111
|
+
if (p->i < 8) {
|
112
|
+
p->I[p->i] = (DClonglong) x;
|
113
|
+
p->i++;
|
114
|
+
} else {
|
115
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DCchar));
|
116
|
+
}
|
117
|
+
}
|
118
|
+
static void a_short (DCCallVM* in_p, DCshort x)
|
119
|
+
{
|
120
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
121
|
+
if (p->i < 8) {
|
122
|
+
p->I[p->i] = (DClonglong) x;
|
123
|
+
p->i++;
|
124
|
+
} else {
|
125
|
+
dcVecAlign(&p->mVecHead, sizeof(DCshort));
|
126
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DCshort));
|
127
|
+
}
|
128
|
+
}
|
129
|
+
static void a_int (DCCallVM* in_p, DCint x)
|
130
|
+
{
|
131
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
132
|
+
if (p->i < 8) {
|
133
|
+
p->I[p->i] = (DClonglong) x;
|
134
|
+
p->i++;
|
135
|
+
} else {
|
136
|
+
dcVecAlign(&p->mVecHead, sizeof(DCint));
|
137
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DCint));
|
138
|
+
}
|
139
|
+
}
|
140
|
+
static void a_long (DCCallVM* in_p, DClong x)
|
141
|
+
{
|
142
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
143
|
+
if (p->i < 8) {
|
144
|
+
p->I[p->i] = (DClonglong) x;
|
145
|
+
p->i++;
|
146
|
+
} else {
|
147
|
+
dcVecAlign(&p->mVecHead, sizeof(DClong));
|
148
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DClong));
|
149
|
+
}
|
150
|
+
}
|
151
|
+
static void a_pointer (DCCallVM* in_p, DCpointer x) { a_i64(in_p, (DClonglong) x ); }
|
152
|
+
|
153
|
+
static void a_float(DCCallVM* in_p, DCfloat x)
|
154
|
+
{
|
155
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
156
|
+
|
157
|
+
if (p->f < 8) {
|
158
|
+
p->u.S[ p->f << 1 ] = x;
|
159
|
+
p->f++;
|
160
|
+
} else {
|
161
|
+
dcVecAlign(&p->mVecHead, sizeof(DCfloat));
|
162
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DCfloat));
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
static void a_double(DCCallVM* in_p, DCdouble x)
|
167
|
+
{
|
168
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
169
|
+
if (p->f < 8) {
|
170
|
+
p->u.D[ p->f ] = x;
|
171
|
+
p->f++;
|
172
|
+
} else {
|
173
|
+
dcVecAlign(&p->mVecHead, sizeof(DCdouble));
|
174
|
+
dcVecAppend(&p->mVecHead, &x, sizeof(DCdouble));
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
void call(DCCallVM* in_p, DCpointer target)
|
179
|
+
{
|
180
|
+
DCCallVM_arm64* p = (DCCallVM_arm64*)in_p;
|
181
|
+
|
182
|
+
/*
|
183
|
+
** copy 'size' argument is given in number of 16-byte 'pair' blocks.
|
184
|
+
*/
|
185
|
+
|
186
|
+
dcCall_arm64(target, dcVecData(&p->mVecHead), ( dcVecSize(&p->mVecHead) + 15 ) & -16, &p->u.S[0]);
|
187
|
+
}
|
188
|
+
|
189
|
+
DCCallVM_vt vt_arm64 =
|
190
|
+
{
|
191
|
+
&deinit
|
192
|
+
, &reset
|
193
|
+
, &mode
|
194
|
+
, &a_bool
|
195
|
+
, &a_char
|
196
|
+
, &a_short
|
197
|
+
, &a_int
|
198
|
+
, &a_long
|
199
|
+
, &a_i64
|
200
|
+
, &a_float
|
201
|
+
, &a_double
|
202
|
+
, &a_pointer
|
203
|
+
, NULL /* argStruct */
|
204
|
+
, (DCvoidvmfunc*) &call
|
205
|
+
, (DCboolvmfunc*) &call
|
206
|
+
, (DCcharvmfunc*) &call
|
207
|
+
, (DCshortvmfunc*) &call
|
208
|
+
, (DCintvmfunc*) &call
|
209
|
+
, (DClongvmfunc*) &call
|
210
|
+
, (DClonglongvmfunc*) &call
|
211
|
+
, (DCfloatvmfunc*) &call
|
212
|
+
, (DCdoublevmfunc*) &call
|
213
|
+
, (DCpointervmfunc*) &call
|
214
|
+
, NULL /* callStruct */
|
215
|
+
};
|
216
|
+
|
217
|
+
DCCallVM_vt vt_arm64_variadic =
|
218
|
+
{
|
219
|
+
&deinit
|
220
|
+
, &reset
|
221
|
+
, &mode
|
222
|
+
, &var_bool
|
223
|
+
, &var_char
|
224
|
+
, &var_short
|
225
|
+
, &var_int
|
226
|
+
, &var_long
|
227
|
+
, &var_i64
|
228
|
+
, &var_float
|
229
|
+
, &var_double
|
230
|
+
, &var_pointer
|
231
|
+
, NULL /* argStruct */
|
232
|
+
, (DCvoidvmfunc*) &call
|
233
|
+
, (DCboolvmfunc*) &call
|
234
|
+
, (DCcharvmfunc*) &call
|
235
|
+
, (DCshortvmfunc*) &call
|
236
|
+
, (DCintvmfunc*) &call
|
237
|
+
, (DClongvmfunc*) &call
|
238
|
+
, (DClonglongvmfunc*) &call
|
239
|
+
, (DCfloatvmfunc*) &call
|
240
|
+
, (DCdoublevmfunc*) &call
|
241
|
+
, (DCpointervmfunc*) &call
|
242
|
+
, NULL /* callStruct */
|
243
|
+
};
|
244
|
+
|
245
|
+
|
246
|
+
DCCallVM* dcNewCallVM(DCsize size)
|
247
|
+
{
|
248
|
+
return dc_callvm_new_arm64(&vt_arm64, size);
|
249
|
+
}
|
250
|
+
|
251
|
+
static void mode(DCCallVM* in_self,DCint mode)
|
252
|
+
{
|
253
|
+
DCCallVM_arm64* self = (DCCallVM_arm64*) in_self;
|
254
|
+
DCCallVM_vt* vt;
|
255
|
+
switch(mode) {
|
256
|
+
case DC_CALL_C_DEFAULT:
|
257
|
+
case DC_CALL_C_ARM64:
|
258
|
+
vt = &vt_arm64;
|
259
|
+
break;
|
260
|
+
case DC_CALL_C_ELLIPSIS:
|
261
|
+
vt = &vt_arm64;
|
262
|
+
break;
|
263
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
264
|
+
vt = &vt_arm64_variadic;
|
265
|
+
break;
|
266
|
+
default:
|
267
|
+
in_self->mError = DC_ERROR_UNSUPPORTED_MODE;
|
268
|
+
return;
|
269
|
+
}
|
270
|
+
self->mInterface.mVTpointer = vt;
|
271
|
+
}
|
272
|
+
|
@@ -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-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#include "dyncall_callvm.h"
|
28
29
|
|
29
30
|
void dc_callvm_base_init(DCCallVM* pInstance, DCCallVM_vt* pVTable)
|
@@ -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-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#if defined(__GNUC__)
|
28
29
|
|
29
30
|
#if defined(DC__ABI_MIPS_O32)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#ifndef DYNCALL_CALLVM_MIPS_H
|
28
29
|
#define DYNCALL_CALLVM_MIPS_H
|
29
30
|
|
@@ -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-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#include "dyncall_callvm_mips_eabi.h"
|
28
29
|
#include "dyncall_alloc.h"
|
29
30
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
/*
|
28
29
|
|
29
30
|
dyncall callvm for 32bit MIPS family of processors
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "n32" ABI callvm implementation
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
/*
|
28
29
|
|
29
30
|
dyncall callvm for 64bit MIPS family of processors
|
@@ -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-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
/*
|
28
29
|
|
29
30
|
dyncall callvm for 64bit MIPS family of processors
|
@@ -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-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#ifndef DYNCALL_CALLVM_MIPS_N64_H
|
28
29
|
#define DYNCALL_CALLVM_MIPS_N64_H
|
29
30
|
|