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,56 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_callback_ppc64.h
|
6
|
+
Description: Callback - Header for ppc64
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2014-2015 Masanori Mitsugi <mitsugi@linux.vnet.ibm.com>
|
10
|
+
|
11
|
+
Permission to use, copy, modify, and distribute this software for any
|
12
|
+
purpose with or without fee is hereby granted, provided that the above
|
13
|
+
copyright notice and this permission notice appear in all copies.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
16
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
17
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
18
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
19
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
20
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
21
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
22
|
+
|
23
|
+
*/
|
24
|
+
|
25
|
+
#ifndef DYNCALL_CALLBACK_PPC64_H
|
26
|
+
#define DYNCALL_CALLBACK_PPC64_H
|
27
|
+
|
28
|
+
#include "dyncall_callback.h"
|
29
|
+
|
30
|
+
#include "dyncall_thunk.h"
|
31
|
+
#include "dyncall_args_ppc64.h"
|
32
|
+
|
33
|
+
/*
|
34
|
+
ELF v2
|
35
|
+
thunk : offset 0, size 48
|
36
|
+
handler : offset 48, size 8
|
37
|
+
stack_cleanup : offset 56, size 8
|
38
|
+
userdata : offset 64, size 8
|
39
|
+
|
40
|
+
ELF v1
|
41
|
+
thunk : offset 0, size 64
|
42
|
+
handler : offset 64, size 8
|
43
|
+
stack_cleanup : offset 72, size 8
|
44
|
+
userdata : offset 80, size 8
|
45
|
+
*/
|
46
|
+
|
47
|
+
struct DCCallback
|
48
|
+
{
|
49
|
+
DCThunk thunk;
|
50
|
+
DCCallbackHandler* handler;
|
51
|
+
size_t stack_cleanup;
|
52
|
+
void* userdata;
|
53
|
+
};
|
54
|
+
|
55
|
+
#endif /* DYNCALL_CALLBACK_PPC64_H */
|
56
|
+
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Implementation for sparc32 (TODO: not implemented yet)
|
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
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
|
26
27
|
#include "dyncall_callback.h"
|
27
28
|
#include "dyncall_callback_sparc32.h"
|
28
29
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Header for sparc32
|
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
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
|
26
27
|
#ifndef DYNCALL_CALLBACK_SPARC32_H
|
27
28
|
#define DYNCALL_CALLBACK_SPARC32_H
|
28
29
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Implementation for sparc64 (TODO: not implemented yet)
|
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
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
|
26
27
|
#include "dyncall_callback.h"
|
27
28
|
#include "dyncall_callback_sparc32.h"
|
28
29
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback Thunk entry for x64 (portasm version)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>
|
9
|
+
Copyright (c) 2011-2015 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
|
@@ -23,6 +23,7 @@
|
|
23
23
|
*/
|
24
24
|
|
25
25
|
|
26
|
+
|
26
27
|
#include "../portasm/portasm-x64-att.S"
|
27
28
|
|
28
29
|
/* structure sizes */
|
@@ -107,24 +108,15 @@ BEGIN_PROC(dcCallback_x64_sysv)
|
|
107
108
|
PUSH(LIT(0)) /* align to 16 bytes */
|
108
109
|
CALL_REG(QWORD(RAX,CTX_handler))
|
109
110
|
|
110
|
-
/* pass return type via registers */
|
111
|
-
/* distinguish two basic classes 'integer' and 'float' */
|
111
|
+
/* pass return type via registers, handle ints and floats */
|
112
112
|
|
113
|
-
MOVB(AL,DL)
|
114
113
|
MOV(QWORD(RBP,FRAME_DCValue_sysv),RAX)
|
115
|
-
|
116
|
-
CMP(LIT(ASCII_f),DL)
|
117
|
-
JE(LOCAL(return_f64))
|
118
|
-
CMP(LIT(ASCII_d),DL)
|
119
|
-
JNE(LOCAL(return_i64))
|
120
|
-
|
121
|
-
LOCAL(return_f64):
|
122
114
|
MOVD(RAX,XMM0)
|
123
115
|
|
124
|
-
LOCAL(return_i64):
|
125
116
|
MOV(RBP,RSP)
|
126
117
|
POP(RBP)
|
127
118
|
RET()
|
119
|
+
|
128
120
|
END_PROC(dcCallback_x64_sysv)
|
129
121
|
|
130
122
|
GLOBAL(dcCallback_x64_win64)
|
@@ -173,6 +165,7 @@ BEGIN_PROC(dcCallback_x64_win64)
|
|
173
165
|
SUB(LIT(4*8),RSP) /* make room for spill area and call */
|
174
166
|
CALL_REG(QWORD(RAX,CTX_handler))
|
175
167
|
|
168
|
+
/* pass return type via registers, handle ints and floats */
|
176
169
|
|
177
170
|
MOV(QWORD(RBP,FRAME_DCValue_win64),RAX)
|
178
171
|
MOVD(RAX,XMM0)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Implementation for x64
|
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_callback_x64.h"
|
28
29
|
#include "dyncall_args_x64.h"
|
29
30
|
#include "dyncall_alloc_wx.h"
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Header for x64
|
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_CALLBACK_X64_H_
|
28
29
|
#define DYNCALL_CALLBACK_X64_H_
|
29
30
|
|
@@ -45,15 +45,8 @@ OPTION PROLOGUE:NONE, EPILOGUE:NONE
|
|
45
45
|
mov RDX,RSP
|
46
46
|
push 0
|
47
47
|
call qword ptr [RAX+CTX_handler]
|
48
|
-
mov DL,AL
|
49
48
|
mov RAX,qword ptr [RBP+FRAME_DCValue_sysv]
|
50
|
-
cmp DL,102
|
51
|
-
je return_f64
|
52
|
-
cmp DL,100
|
53
|
-
jne return_i64
|
54
|
-
return_f64:
|
55
49
|
movd XMM0,RAX
|
56
|
-
return_i64:
|
57
50
|
mov RSP,RBP
|
58
51
|
pop RBP
|
59
52
|
ret
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback Thunk entry for x86
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>
|
9
|
+
Copyright (c) 2011-2015 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
|
@@ -22,6 +22,7 @@
|
|
22
22
|
|
23
23
|
*/
|
24
24
|
|
25
|
+
|
25
26
|
#include "../portasm/portasm-x86.S"
|
26
27
|
BEGIN_ASM
|
27
28
|
DCThunk_size = 16
|
@@ -84,21 +85,13 @@ BEGIN_PROC(dcCallbackThunkEntry)
|
|
84
85
|
LEA(DWORD(EBP,frame_DCValue), EDX)
|
85
86
|
MOVL(DWORD(EBP,0), EBP) /* EBP = parent frame */
|
86
87
|
/* handle return value */
|
87
|
-
|
88
|
-
JE(LOCAL(return_void))
|
89
|
-
CMP(LIT(ASCII_d),AL)
|
90
|
-
JE(LOCAL(return_f64))
|
88
|
+
|
91
89
|
CMP(LIT(ASCII_f),AL)
|
92
90
|
JE(LOCAL(return_f32))
|
93
|
-
CMP(LIT(
|
94
|
-
JE(LOCAL(
|
95
|
-
CMP(LIT(ASCII_L),AL)
|
96
|
-
JE(LOCAL(return_i64))
|
91
|
+
CMP(LIT(ASCII_d),AL)
|
92
|
+
JE(LOCAL(return_f64))
|
97
93
|
|
98
94
|
/* All int cases <= 32 bits (+ pointer & string cases) fall in the 32 bits int case*/
|
99
|
-
LOCAL(return_i32):
|
100
|
-
MOVL(DWORD(EDX,0),EAX)
|
101
|
-
RET()
|
102
95
|
LOCAL(return_i64):
|
103
96
|
MOVL(DWORD(EDX,0),EAX)
|
104
97
|
MOVL(DWORD(EDX,4),EDX)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Implementation for x86
|
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_callback_x86.h"
|
28
29
|
#include "dyncall_args_x86.h"
|
29
30
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Header for x86
|
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_CALLBACK_X86_H_
|
28
29
|
#define DYNCALL_CALLBACK_X86_H_
|
29
30
|
|
@@ -46,19 +46,10 @@ OPTION PROLOGUE:NONE, EPILOGUE:NONE
|
|
46
46
|
push ECX
|
47
47
|
lea EDX,dword ptr [EBP+frame_DCValue]
|
48
48
|
mov EBP,dword ptr [EBP+0]
|
49
|
-
cmp AL,118
|
50
|
-
je return_void
|
51
|
-
cmp AL,100
|
52
|
-
je return_f64
|
53
49
|
cmp AL,102
|
54
50
|
je return_f32
|
55
|
-
cmp AL,
|
56
|
-
je
|
57
|
-
cmp AL,76
|
58
|
-
je return_i64
|
59
|
-
return_i32:
|
60
|
-
mov EAX,dword ptr [EDX+0]
|
61
|
-
ret
|
51
|
+
cmp AL,100
|
52
|
+
je return_f64
|
62
53
|
return_i64:
|
63
54
|
mov EAX,dword ptr [EDX+0]
|
64
55
|
mov EDX,dword ptr [EDX+4]
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Implementation Back-end selection
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-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
|
@@ -31,8 +31,14 @@
|
|
31
31
|
# include "dyncall_thunk_x86.c"
|
32
32
|
#elif defined(DC__Arch_AMD64)
|
33
33
|
# include "dyncall_thunk_x64.c"
|
34
|
-
#elif defined(
|
35
|
-
#
|
34
|
+
#elif defined(DC__Arch_PPC32)
|
35
|
+
# if defined(DC__OS_Darwin)
|
36
|
+
# include "dyncall_thunk_ppc32.c"
|
37
|
+
# else
|
38
|
+
# include "dyncall_thunk_ppc32_sysv.c"
|
39
|
+
# endif
|
40
|
+
#elif defined(DC__Arch_PPC64)
|
41
|
+
# include "dyncall_thunk_ppc64.c"
|
36
42
|
#elif defined(DC__Arch_ARM_ARM)
|
37
43
|
#include "dyncall_thunk_arm32_arm.c"
|
38
44
|
#elif defined(DC__Arch_ARM_THUMB)
|
@@ -43,5 +49,7 @@
|
|
43
49
|
#include "dyncall_thunk_sparc32.c"
|
44
50
|
#elif defined(DC__Arch_Sparcv9)
|
45
51
|
#include "dyncall_thunk_sparc64.c"
|
52
|
+
#elif defined(DC__Arch_ARM64)
|
53
|
+
#include "dyncall_thunk_arm64.c"
|
46
54
|
#endif
|
47
55
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - 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
|
@@ -45,6 +45,8 @@
|
|
45
45
|
** x86: eax
|
46
46
|
** x64: rax
|
47
47
|
** ppc: r2
|
48
|
+
** arm: r12
|
49
|
+
** arm64: x9
|
48
50
|
**
|
49
51
|
**/
|
50
52
|
|
@@ -62,8 +64,10 @@ void dcbInitThunk(DCThunk* p, void (*entry)());
|
|
62
64
|
#include "dyncall_thunk_x86.h"
|
63
65
|
#elif defined (DC__Arch_AMD64)
|
64
66
|
#include "dyncall_thunk_x64.h"
|
65
|
-
#elif defined (
|
67
|
+
#elif defined (DC__Arch_PPC32)
|
66
68
|
#include "dyncall_thunk_ppc32.h"
|
69
|
+
#elif defined (DC__Arch_PPC64)
|
70
|
+
#include "dyncall_thunk_ppc64.h"
|
67
71
|
#elif defined (DC__Arch_ARM_ARM)
|
68
72
|
#include "dyncall_thunk_arm32_arm.h"
|
69
73
|
#elif defined (DC__Arch_ARM_THUMB)
|
@@ -74,6 +78,8 @@ void dcbInitThunk(DCThunk* p, void (*entry)());
|
|
74
78
|
#include "dyncall_thunk_sparc32.h"
|
75
79
|
#elif defined (DC__Arch_Sparcv9)
|
76
80
|
#include "dyncall_thunk_sparc64.h"
|
81
|
+
#elif defined (DC__Arch_ARM64)
|
82
|
+
#include "dyncall_thunk_arm64.h"
|
77
83
|
#endif
|
78
84
|
|
79
85
|
#ifdef __cplusplus
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Implementation for ARM32 (ARM mode)
|
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
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
|
26
27
|
#include "dyncall_thunk.h"
|
27
28
|
|
28
29
|
void dcbInitThunk(DCThunk* p, void (*entry)())
|
@@ -34,12 +35,11 @@ void dcbInitThunk(DCThunk* p, void (*entry)())
|
|
34
35
|
ldr %r15, [%r15, #-4]
|
35
36
|
*/
|
36
37
|
|
37
|
-
/* This code
|
38
|
-
/*
|
39
|
-
/*
|
40
|
-
/*
|
41
|
-
/* latest update of arm-eabi tools. */
|
38
|
+
/* This code stores a ptr to DCCallback in r12 (equals ptr to thunk, */
|
39
|
+
/* which is PC (r15) minus 8, as PC points to current instruction+8. */
|
40
|
+
/* Then it loads the callback 'entry' into PC. The -4 is needed, also bc */
|
41
|
+
/* of the PC pointing ahead. */
|
42
42
|
p->code[0] = 0xe24fc008UL; /* sub %r12, %r15, #8 */
|
43
43
|
p->code[1] = 0xe51ff004UL; /* ldr %r15, [%r15, #-4] */
|
44
|
-
p->entry = entry
|
44
|
+
p->entry = entry;
|
45
45
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Thunk - Header for ARM32 (ARM mode)
|
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
|
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
|
26
27
|
#ifndef DYNCALL_THUNK_ARM32_ARM_H
|
27
28
|
#define DYNCALL_THUNK_ARM32_ARM_H
|
28
29
|
|