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: Callback's Arguments VM - Header for sparc32
|
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
|
@@ -31,7 +31,7 @@
|
|
31
31
|
|
32
32
|
struct DCArgs
|
33
33
|
{
|
34
|
-
int
|
34
|
+
int *arg_ptr;
|
35
35
|
};
|
36
36
|
|
37
37
|
#endif /* DYNCALLBACK_ARGS_SPARC32_H */
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Implementation for sparc64 - not yet
|
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
|
@@ -26,17 +26,30 @@
|
|
26
26
|
|
27
27
|
#include "dyncall_args_sparc64.h"
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
DCbool dcbArgBool (DCArgs* p) { return (DCbool)
|
40
|
-
DCpointer dcbArgPointer (DCArgs* p) { return (DCpointer)
|
41
|
-
|
42
|
-
|
29
|
+
DCulonglong dcbArgULongLong(DCArgs* p) { return p->arg_ptr[p->i++]; }
|
30
|
+
DClonglong dcbArgLongLong (DCArgs* p) { return (DClonglong)dcbArgULongLong(p); }
|
31
|
+
DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgULongLong(p); }
|
32
|
+
DClong dcbArgLong (DCArgs* p) { return (DClong) dcbArgULongLong(p); }
|
33
|
+
DCuint dcbArgUInt (DCArgs* p) { return (DCuint) dcbArgULongLong(p); }
|
34
|
+
DCint dcbArgInt (DCArgs* p) { return (DCint) dcbArgULongLong(p); }
|
35
|
+
DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgULongLong(p); }
|
36
|
+
DCchar dcbArgChar (DCArgs* p) { return (DCchar) dcbArgULongLong(p); }
|
37
|
+
DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgULongLong(p); }
|
38
|
+
DCshort dcbArgShort (DCArgs* p) { return (DCshort) dcbArgULongLong(p); }
|
39
|
+
DCbool dcbArgBool (DCArgs* p) { return (DCbool) dcbArgULongLong(p); }
|
40
|
+
DCpointer dcbArgPointer (DCArgs* p) { return (DCpointer) dcbArgULongLong(p); }
|
41
|
+
|
42
|
+
DCdouble dcbArgDouble(DCArgs* p)
|
43
|
+
{
|
44
|
+
return (p->i < DCARGS_SPARC64_NUM_DOUBLE_REGS)
|
45
|
+
? p->dreg_data[p->i++]
|
46
|
+
: *(DCdouble*)(p->arg_ptr + p->i++);
|
47
|
+
}
|
48
|
+
|
49
|
+
DCfloat dcbArgFloat(DCArgs* p)
|
50
|
+
{
|
51
|
+
return (p->i < DCARGS_SPARC64_NUM_DOUBLE_REGS)
|
52
|
+
? *((DCfloat*)(p->dreg_data + p->i++)+1) /* +1 bc single-prec fp args are */
|
53
|
+
: *((DCfloat*)(p->arg_ptr + p->i++)+1); /* right aligned in 64bit slot */
|
54
|
+
}
|
55
|
+
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
5
|
File: dyncallback/dyncall_args_sparc64.h
|
6
|
-
Description: Callback's Arguments VM - Header for
|
6
|
+
Description: Callback's Arguments VM - Header for sparc64 - not yet
|
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
|
@@ -29,9 +29,13 @@
|
|
29
29
|
|
30
30
|
#include "dyncall_args.h"
|
31
31
|
|
32
|
+
#define DCARGS_SPARC64_NUM_DOUBLE_REGS 16
|
32
33
|
struct DCArgs
|
33
34
|
{
|
34
|
-
|
35
|
+
/* Don't change order or types, laid out for asm code to fill in! */
|
36
|
+
DClonglong *arg_ptr;
|
37
|
+
DCdouble dreg_data[DCARGS_SPARC64_NUM_DOUBLE_REGS];
|
38
|
+
DClonglong i; /* args fetched */
|
35
39
|
};
|
36
40
|
|
37
41
|
#endif /* DYNCALLBACK_ARGS_SPARC64_H */
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Implementation for x64
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Header for x64
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Implementation for x86
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Header for x86
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - Implementation back-end selector
|
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
|
@@ -28,23 +28,21 @@
|
|
28
28
|
|
29
29
|
#if defined(DC__Arch_Intel_x86)
|
30
30
|
#include "dyncall_callback_x86.c"
|
31
|
-
#elif defined
|
31
|
+
#elif defined(DC__Arch_AMD64)
|
32
32
|
#include "dyncall_callback_x64.c"
|
33
|
-
#elif defined
|
33
|
+
#elif defined(DC__Arch_PPC32)
|
34
34
|
#include "dyncall_callback_ppc32.c"
|
35
|
-
#elif defined
|
35
|
+
#elif defined(DC__Arch_PPC64)
|
36
36
|
#include "dyncall_callback_ppc64.c"
|
37
|
-
#elif defined
|
38
|
-
#include "
|
39
|
-
#elif defined (
|
40
|
-
#include "dyncall_callback_arm32_thumb.c"
|
41
|
-
#elif defined (DC__Arch_MIPS)
|
37
|
+
#elif defined(DC__Arch_ARM)
|
38
|
+
#include "dyncall_callback_arm32.c"
|
39
|
+
#elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
|
42
40
|
#include "dyncall_callback_mips.c"
|
43
|
-
#elif defined
|
41
|
+
#elif defined(DC__Arch_Sparc)
|
44
42
|
#include "dyncall_callback_sparc32.c"
|
45
|
-
#elif defined
|
43
|
+
#elif defined(DC__Arch_Sparc64)
|
46
44
|
#include "dyncall_callback_sparc64.c"
|
47
|
-
#elif defined
|
45
|
+
#elif defined(DC__Arch_ARM64)
|
48
46
|
#include "dyncall_callback_arm64.c"
|
49
47
|
#endif
|
50
48
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback - 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
|
@@ -32,8 +32,7 @@
|
|
32
32
|
|
33
33
|
typedef struct DCCallback DCCallback;
|
34
34
|
|
35
|
-
//
|
36
|
-
|
35
|
+
// return value is the type encoded as a signature char (character of the set [vBcCsSiIjJlLfd]).
|
37
36
|
typedef char (DCCallbackHandler)(DCCallback* pcb, DCArgs* args, DCValue* result, void* userdata);
|
38
37
|
|
39
38
|
#ifdef __cplusplus
|
@@ -45,7 +44,6 @@ void dcbInitCallback(DCCallback* pcb, const char* signature, DCCallbackHa
|
|
45
44
|
void dcbFreeCallback(DCCallback* pcb);
|
46
45
|
void* dcbGetUserData (DCCallback* pcb);
|
47
46
|
|
48
|
-
|
49
47
|
#ifdef __cplusplus
|
50
48
|
}
|
51
49
|
#endif
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback Thunk - Implementation Back-end selector
|
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
|
@@ -64,16 +64,26 @@
|
|
64
64
|
# include "dyncall_callback_ppc32.S"
|
65
65
|
# elif defined(DC__Arch_PPC64)
|
66
66
|
# include "dyncall_callback_ppc64.S"
|
67
|
+
# elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
|
68
|
+
# include "dyncall_callback_mips_gas.S"
|
67
69
|
# elif defined(DC__Arch_ARM_ARM)
|
68
70
|
# include "dyncall_callback_arm32_arm_gas.S"
|
69
71
|
# elif defined(DC__Arch_ARM_THUMB)
|
70
72
|
# include "dyncall_callback_arm32_thumb_gas.S"
|
71
73
|
# elif defined(DC__Arch_Sparc)
|
72
74
|
# include "dyncall_callback_sparc32.s"
|
73
|
-
# elif defined(
|
75
|
+
# elif defined(DC__Arch_Sparc64)
|
74
76
|
# include "dyncall_callback_sparc64.s"
|
75
77
|
# elif defined(DC__Arch_ARM64)
|
76
78
|
# include "dyncall_callback_arm64.S"
|
77
79
|
# endif
|
78
80
|
#endif
|
79
81
|
|
82
|
+
|
83
|
+
/* Use .note.GNU-stack to explicitly indicate a non-exec stack, b/c of bad */
|
84
|
+
/* default behaviour when translating handwritten assembly files (needed on */
|
85
|
+
/* GNU platforms, Android and FreeBSD, as tests have shown). */
|
86
|
+
#if (defined(DC__C_CLANG) || defined(DC__C_GNU)) && defined(__ELF__) && (defined(DC__OS_Linux) || defined(DC__OS_FreeBSD))
|
87
|
+
.section .note.GNU-stack,"",%progbits
|
88
|
+
#endif
|
89
|
+
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/
|
6
|
-
Description: Callback - Implementation for ARM32 (ARM mode)
|
5
|
+
File: dyncallback/dyncall_callback_arm32.c
|
6
|
+
Description: Callback - Implementation for ARM32 (ARM and THUMB mode)
|
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
|
@@ -24,15 +24,21 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
-
|
28
|
-
#include "dyncall_callback_arm32_arm.h"
|
29
|
-
#include "dyncall_args_arm32_arm.h"
|
30
|
-
|
27
|
+
#include "dyncall_callback.h"
|
31
28
|
#include "dyncall_alloc_wx.h"
|
32
|
-
#include "
|
29
|
+
#include "dyncall_thunk.h"
|
33
30
|
|
31
|
+
/* Callback symbol. */
|
34
32
|
extern void dcCallbackThunkEntry();
|
35
33
|
|
34
|
+
struct DCCallback
|
35
|
+
{
|
36
|
+
DCThunk thunk; // offset 0
|
37
|
+
DCCallbackHandler* handler; // offset 12
|
38
|
+
void* userdata; // offset 16
|
39
|
+
};
|
40
|
+
|
41
|
+
|
36
42
|
void dcbInitCallback(DCCallback* pcb, const char* signature, DCCallbackHandler* handler, void* userdata)
|
37
43
|
{
|
38
44
|
pcb->handler = handler;
|
@@ -45,10 +51,18 @@ DCCallback* dcbNewCallback(const char* signature, DCCallbackHandler* handler, vo
|
|
45
51
|
int err;
|
46
52
|
DCCallback* pcb;
|
47
53
|
err = dcAllocWX(sizeof(DCCallback), (void**)&pcb);
|
48
|
-
if(err
|
49
|
-
return
|
54
|
+
if(err)
|
55
|
+
return NULL;
|
56
|
+
|
50
57
|
dcbInitThunk(&pcb->thunk, dcCallbackThunkEntry);
|
51
58
|
dcbInitCallback(pcb, signature, handler, userdata);
|
59
|
+
|
60
|
+
err = dcInitExecWX(pcb, sizeof(DCCallback));
|
61
|
+
if(err) {
|
62
|
+
dcFreeWX(pcb, sizeof(DCCallback));
|
63
|
+
return NULL;
|
64
|
+
}
|
65
|
+
|
52
66
|
return pcb;
|
53
67
|
}
|
54
68
|
|
@@ -62,3 +76,4 @@ void* dcbGetUserData(DCCallback* pcb)
|
|
62
76
|
{
|
63
77
|
return pcb->userdata;
|
64
78
|
}
|
79
|
+
|
@@ -30,15 +30,15 @@
|
|
30
30
|
.globl _dcCallbackThunkEntry
|
31
31
|
.align 4
|
32
32
|
/* sizes */
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
DCThunk_size = 8
|
34
|
+
DCArgs_size = 24
|
35
|
+
DCCallback_size = 20
|
36
|
+
DCValue_size = 8
|
37
37
|
|
38
38
|
/* struct DCCallback offsets and size */
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
CTX_thunk = 0
|
40
|
+
CTX_handler = 12
|
41
|
+
CTX_userdata = 16
|
42
42
|
|
43
43
|
|
44
44
|
/* Called by thunk - thunk stores pointer to DCCallback in r12 */
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback Thunk - Implementation for ARM32 (ARM mode)
|
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
|
@@ -31,16 +31,16 @@
|
|
31
31
|
.globl dcCallbackThunkEntry
|
32
32
|
|
33
33
|
/* sizes */
|
34
|
-
/*
|
35
|
-
/*
|
36
|
-
/*
|
37
|
-
/*
|
38
|
-
|
34
|
+
/* DCThunk_size = 8 */
|
35
|
+
/* DCArgs_size = 24 */ /* for EABI/ATPCS/... */
|
36
|
+
/* DCArgs_size = 96 */ /* for armhf */
|
37
|
+
/* DCCallback_size = 20 */
|
38
|
+
DCValue_size = 8
|
39
39
|
|
40
40
|
/* struct DCCallback offsets and size */
|
41
|
-
/*
|
42
|
-
|
43
|
-
|
41
|
+
/* CTX_thunk = 0 */
|
42
|
+
CTX_handler = 12
|
43
|
+
CTX_userdata = 16
|
44
44
|
|
45
45
|
|
46
46
|
/* Called by thunk - thunk stores pointer to DCCallback in r12 */
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback Thunk - Implementation for ARM32 (THUMB mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback Thunk - Implementation for ARM32 (THUMB mode)
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: Callback Thunk - Implementation for ARM64 / ARMv8 / AAPCS64
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
-
|
9
|
+
Copyright (c) 2015-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
13
13
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: Callback - Implementation for ARM64 / ARMv8 / AAPCS64
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
-
|
9
|
+
Copyright (c) 2015-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
13
13
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -23,23 +23,21 @@
|
|
23
23
|
|
24
24
|
*/
|
25
25
|
|
26
|
+
|
26
27
|
#include "dyncall_callback.h"
|
27
28
|
#include "dyncall_alloc_wx.h"
|
28
29
|
#include "dyncall_thunk.h"
|
29
30
|
|
31
|
+
/* Callback symbol. */
|
30
32
|
extern void dcCallbackThunkEntry();
|
31
33
|
|
32
|
-
struct DCCallback
|
33
|
-
{
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
//
|
40
|
-
// size 48
|
41
|
-
// aligned 48
|
42
|
-
};
|
34
|
+
struct DCCallback /* off size */
|
35
|
+
{ /* ----|----- */
|
36
|
+
DCThunk thunk; /* 0 32 */
|
37
|
+
DCCallbackHandler* handler; /* 32 8 */
|
38
|
+
void* userdata; /* 40 8 */
|
39
|
+
}; /* total 48 */
|
40
|
+
/* aligned 48 */
|
43
41
|
|
44
42
|
void dcbInitCallback(DCCallback* pcb, const char* signature, DCCallbackHandler* handler, void* userdata)
|
45
43
|
{
|
@@ -52,10 +50,18 @@ DCCallback* dcbNewCallback(const char* signature, DCCallbackHandler* handler, vo
|
|
52
50
|
int err;
|
53
51
|
DCCallback* pcb;
|
54
52
|
err = dcAllocWX(sizeof(DCCallback), (void**) &pcb);
|
55
|
-
if
|
53
|
+
if(err)
|
54
|
+
return NULL;
|
56
55
|
|
57
56
|
dcbInitThunk(&pcb->thunk, dcCallbackThunkEntry);
|
58
57
|
dcbInitCallback(pcb, signature, handler, userdata);
|
58
|
+
|
59
|
+
err = dcInitExecWX(pcb, sizeof(DCCallback));
|
60
|
+
if(err) {
|
61
|
+
dcFreeWX(pcb, sizeof(DCCallback));
|
62
|
+
return NULL;
|
63
|
+
}
|
64
|
+
|
59
65
|
return pcb;
|
60
66
|
}
|
61
67
|
|