rbdc 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dyncall/BUGS +1 -1
- data/dyncall/CMakeLists.txt +19 -7
- data/dyncall/ChangeLog +61 -20
- data/dyncall/LICENSE +1 -1
- data/dyncall/Makefile.generic +2 -0
- data/dyncall/ToDo +97 -29
- data/dyncall/autovar/README.txt +1 -0
- data/dyncall/autovar/autovar_ABI.h +4 -2
- data/dyncall/autovar/autovar_ARCH.h +9 -5
- data/dyncall/autovar/autovar_CC.h +3 -1
- data/dyncall/autovar/autovar_OS.h +2 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +1 -1
- data/dyncall/configure +94 -38
- data/dyncall/dyncall/dyncall.3 +8 -4
- data/dyncall/dyncall/dyncall.h +1 -1
- data/dyncall/dyncall/dyncall_alloc.h +1 -1
- data/dyncall/dyncall/dyncall_api.c +3 -1
- data/dyncall/dyncall/dyncall_call.S +13 -5
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +1 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +24 -26
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +3 -7
- data/dyncall/dyncall/dyncall_call_arm64.S +2 -2
- data/dyncall/dyncall/dyncall_call_arm64.h +2 -2
- data/dyncall/dyncall/dyncall_call_mips.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +16 -16
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -2
- data/dyncall/dyncall/dyncall_call_mips_n32.h +5 -4
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +4 -4
- data/dyncall/dyncall/dyncall_call_mips_n64.h +3 -3
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +2 -2
- data/dyncall/dyncall/dyncall_call_mips_o32.h +4 -3
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +1 -3
- data/dyncall/dyncall/dyncall_call_ppc32.S +1 -1
- data/dyncall/dyncall/dyncall_call_ppc32.h +1 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +1 -1
- data/dyncall/dyncall/{dyncall_call_sparc.S → dyncall_call_sparc.s} +39 -44
- data/dyncall/dyncall/dyncall_call_sparc64.h +5 -5
- data/dyncall/dyncall/dyncall_call_sparc64.s +177 -0
- data/dyncall/dyncall/dyncall_call_x64.S +83 -86
- data/dyncall/dyncall/dyncall_call_x64.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86.S +9 -9
- data/dyncall/dyncall/dyncall_call_x86.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +5 -5
- data/dyncall/dyncall/dyncall_callf.c +18 -18
- data/dyncall/dyncall/dyncall_callf.h +1 -1
- data/dyncall/dyncall/dyncall_callvm.c +3 -3
- data/dyncall/dyncall/dyncall_callvm.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +25 -40
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +25 -33
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +24 -36
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm64.c +23 -27
- data/dyncall/dyncall/dyncall_callvm_arm64.h +2 -6
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_base.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +30 -27
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +24 -30
- data/dyncall/dyncall/{dyncall_call_sparc_v9.h → dyncall_callvm_mips_n32.h} +18 -8
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +4 -6
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +31 -29
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +22 -20
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +54 -15
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +0 -2
- data/dyncall/dyncall/dyncall_callvm_sparc.c +34 -26
- data/dyncall/dyncall/dyncall_callvm_sparc.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +94 -150
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +11 -17
- data/dyncall/dyncall/dyncall_callvm_x64.c +37 -36
- data/dyncall/dyncall/dyncall_callvm_x64.h +1 -4
- data/dyncall/dyncall/dyncall_callvm_x86.c +22 -63
- data/dyncall/dyncall/dyncall_callvm_x86.h +1 -17
- data/dyncall/dyncall/dyncall_config.h +1 -1
- data/dyncall/dyncall/dyncall_macros.h +28 -19
- data/dyncall/dyncall/dyncall_signature.h +1 -1
- data/dyncall/dyncall/dyncall_types.h +17 -18
- data/dyncall/dyncall/dyncall_utils.h +1 -1
- data/dyncall/dyncall/dyncall_value.h +28 -21
- data/dyncall/dyncall/dyncall_vector.c +1 -1
- data/dyncall/dyncall/dyncall_vector.h +1 -1
- data/dyncall/dyncall/gen-masm.sh +2 -2
- data/dyncall/dyncallback/CMakeLists.txt +1 -2
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +4 -3
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +8 -2
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +67 -4
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +7 -2
- data/dyncall/dyncallback/dyncall_args.c +19 -15
- data/dyncall/dyncallback/dyncall_args.h +1 -1
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.c → dyncall_args_arm32.c} +4 -4
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.h → dyncall_args_arm32.h} +6 -6
- data/dyncall/dyncallback/dyncall_args_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +2 -2
- data/dyncall/dyncallback/dyncall_args_mips.c +26 -21
- data/dyncall/dyncallback/dyncall_args_mips.h +18 -6
- data/dyncall/dyncallback/dyncall_args_mips64.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips_o32.c +104 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc64.c +24 -3
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -15
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -2
- data/dyncall/dyncallback/dyncall_args_sparc64.c +28 -15
- data/dyncall/dyncallback/dyncall_args_sparc64.h +7 -3
- data/dyncall/dyncallback/dyncall_args_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +1 -1
- data/dyncall/dyncallback/dyncall_callback.c +10 -12
- data/dyncall/dyncallback/dyncall_callback.h +2 -4
- data/dyncall/dyncallback/dyncall_callback_arch.S +12 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm.c → dyncall_callback_arm32.c} +25 -10
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +7 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.S +9 -9
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.c +20 -14
- data/dyncall/dyncallback/dyncall_callback_mips.c +26 -9
- data/dyncall/dyncallback/dyncall_callback_mips_eabi_gas.s +99 -0
- data/dyncall/dyncallback/{dyncall_args_arm32_thumb.h → dyncall_callback_mips_gas.S} +14 -9
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.c → dyncall_callback_mips_n32_gas.s} +12 -7
- data/dyncall/dyncallback/dyncall_callback_mips_n64_gas.s +98 -0
- data/dyncall/dyncallback/dyncall_callback_mips_o32_gas.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +54 -54
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +92 -117
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +55 -4
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +89 -5
- data/dyncall/dyncallback/dyncall_callback_x64.S +8 -8
- data/dyncall/dyncallback/dyncall_callback_x64.c +19 -6
- data/dyncall/dyncallback/dyncall_callback_x86.S +29 -25
- data/dyncall/dyncallback/dyncall_callback_x86.c +24 -11
- data/dyncall/dyncallback/dyncall_thunk.c +6 -6
- data/dyncall/dyncallback/dyncall_thunk.h +9 -7
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.c → dyncall_thunk_arm32.c} +5 -3
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.h → dyncall_thunk_arm32.h} +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +8 -13
- data/dyncall/dyncallback/dyncall_thunk_mips.c +16 -20
- data/dyncall/dyncallback/dyncall_thunk_mips.h +4 -2
- data/dyncall/dyncallback/dyncall_thunk_mips64.c +103 -0
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.h → dyncall_thunk_mips64.h} +15 -8
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +4 -4
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +9 -9
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +19 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +5 -4
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +42 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +5 -5
- data/dyncall/dyncallback/dyncall_thunk_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -2
- data/dyncall/dyncallback/dyncall_thunk_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -2
- data/dyncall/dyncallback/dyncallback.3 +16 -11
- data/dyncall/dynload/dynload.3 +63 -8
- data/dyncall/dynload/dynload.c +2 -8
- data/dyncall/dynload/dynload.h +9 -5
- data/dyncall/dynload/dynload_alloc.h +1 -1
- data/dyncall/dynload/dynload_syms.c +1 -3
- data/dyncall/dynload/dynload_syms_elf.c +19 -11
- data/dyncall/dynload/dynload_syms_mach-o.c +151 -75
- data/dyncall/dynload/dynload_syms_pe.c +24 -24
- data/dyncall/dynload/dynload_unix.c +156 -13
- data/dyncall/dynload/dynload_windows.c +15 -11
- data/dyncall/portasm/portasm-arm.S +1 -1
- data/dyncall/portasm/portasm-ppc.S +1 -1
- data/dyncall/portasm/{portasm-x64-att.S → portasm-x64.S} +7 -4
- data/dyncall/portasm/portasm-x86.S +4 -2
- data/{dyncall-bindings/ruby/rbdc/extconf.rb → extconf.rb} +4 -4
- data/{dyncall-bindings/ruby/rbdc/rbdc.c → rbdc.c} +5 -5
- metadata +24 -48
- data/dyncall/Makefile.M +0 -15
- data/dyncall/buildsys/dynmake/Makefile.base.M +0 -82
- data/dyncall/buildsys/dynmake/dynmake.bat +0 -2
- data/dyncall/buildsys/dynmake/dynmake.sh +0 -4
- data/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/Makefile.M +0 -10
- data/dyncall/dyncall/TODO +0 -9
- data/dyncall/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/dyncall_call_sparc64.S +0 -362
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +0 -222
- data/dyncall/dyncall/dyncall_call_x64-att.S +0 -147
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +0 -182
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +0 -46
- data/dyncall/dyncallback/Makefile.M +0 -10
- data/dyncall/dyncallback/README.txt +0 -9
- data/dyncall/dyncallback/TODO +0 -4
- data/dyncall/dyncallback/dynMakefile +0 -4
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +0 -46
- data/dyncall/dyncallback/dyncall_callback_mips.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +0 -56
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +0 -44
- data/dyncall/dyncallback/dyncall_callback_x64.h +0 -45
- data/dyncall/dyncallback/dyncall_callback_x86.h +0 -50
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +0 -36
- data/dyncall/dynload/Makefile.M +0 -10
- data/dyncall/dynload/TODO +0 -20
- data/dyncall/dynload/dynMakefile +0 -4
- data/dyncall/dynload/dynload_darwin.c +0 -90
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
|
-
File: dyncallback/
|
6
|
-
Description: Callback's Arguments VM - Header for ARM32 (ARM mode)
|
5
|
+
File: dyncallback/dyncall_args_arm32.h
|
6
|
+
Description: Callback's Arguments VM - Header 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,8 +24,8 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
-
#ifndef
|
28
|
-
#define
|
27
|
+
#ifndef DYNCALLBACK_ARGS_ARM32_H
|
28
|
+
#define DYNCALLBACK_ARGS_ARM32_H
|
29
29
|
|
30
30
|
#include "dyncall_args.h"
|
31
31
|
|
@@ -42,5 +42,5 @@ struct DCArgs
|
|
42
42
|
#endif
|
43
43
|
};
|
44
44
|
|
45
|
-
#endif /*
|
45
|
+
#endif /* DYNCALLBACK_ARGS_ARM32_H */
|
46
46
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: Callback's Arguments VM - 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's Arguments VM - Implementation for Apple's 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
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncallback
|
5
5
|
File: dyncallback/dyncall_args_mips.c
|
6
|
-
Description: Callback's Arguments VM - Implementation for MIPS
|
6
|
+
Description: Callback's Arguments VM - Implementation for non-o32 MIPS
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2013-
|
9
|
+
Copyright (c) 2013-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,25 +26,31 @@
|
|
26
26
|
|
27
27
|
#include "dyncall_args_mips.h"
|
28
28
|
|
29
|
-
DCint dcbArgInt(DCArgs* p)
|
29
|
+
DCint dcbArgInt(DCArgs* p)
|
30
30
|
{
|
31
31
|
DCint value;
|
32
|
-
if(p->
|
33
|
-
value = p->ireg_data[p->
|
32
|
+
if(p->reg_count.i < DCARGS_MIPS_NUM_IREGS)
|
33
|
+
value = p->ireg_data[p->reg_count.i++];
|
34
34
|
else {
|
35
|
-
value = *((
|
36
|
-
p->stackptr += sizeof(
|
35
|
+
value = *((DCint*)p->stackptr);
|
36
|
+
p->stackptr += sizeof(DCint);
|
37
37
|
}
|
38
38
|
return value;
|
39
39
|
}
|
40
40
|
DCuint dcbArgUInt(DCArgs* p) { return (DCuint)dcbArgInt(p); }
|
41
41
|
|
42
|
-
DCulonglong dcbArgULongLong(DCArgs* p)
|
42
|
+
DCulonglong dcbArgULongLong(DCArgs* p)
|
43
43
|
{
|
44
44
|
DCulonglong value;
|
45
|
-
p->
|
45
|
+
p->reg_count.i += (p->reg_count.i & 1); /* Skip one reg if not aligned. */
|
46
|
+
p->stackptr += ((DCulong)p->stackptr & 4) & -4; /* 64bit values are also always aligned on stack */
|
47
|
+
#if defined(DC__Endian_LITTLE)
|
48
|
+
value = dcbArgUInt(p);
|
49
|
+
value |= ((DCulonglong)dcbArgUInt(p)) << 32;
|
50
|
+
#else
|
46
51
|
value = ((DCulonglong)dcbArgUInt(p)) << 32;
|
47
52
|
value |= dcbArgUInt(p);
|
53
|
+
#endif
|
48
54
|
return value;
|
49
55
|
}
|
50
56
|
DClonglong dcbArgLongLong(DCArgs* p) { return (DClonglong)dcbArgULongLong(p); }
|
@@ -59,24 +65,23 @@ DCbool dcbArgBool (DCArgs* p) { return (DCbool) dcbArgUInt(p); }
|
|
59
65
|
DCpointer dcbArgPointer(DCArgs* p) { return (DCpointer)dcbArgUInt(p); }
|
60
66
|
|
61
67
|
DCfloat dcbArgFloat(DCArgs* p)
|
62
|
-
{
|
68
|
+
{
|
63
69
|
DCfloat result;
|
64
|
-
if(p->
|
65
|
-
result =
|
70
|
+
if(p->reg_count.f < DCARGS_MIPS_NUM_FREGS)
|
71
|
+
result = p->freg_data[p->reg_count.f++];
|
66
72
|
else {
|
67
|
-
result = *((
|
68
|
-
p->stackptr += sizeof(
|
73
|
+
result = *((DCfloat*)p->stackptr);
|
74
|
+
p->stackptr += sizeof(DCfloat);
|
69
75
|
}
|
70
|
-
return result;
|
76
|
+
return result;
|
71
77
|
}
|
72
|
-
DCdouble dcbArgDouble(DCArgs* p)
|
73
|
-
{
|
78
|
+
DCdouble dcbArgDouble(DCArgs* p)
|
79
|
+
{
|
74
80
|
union {
|
75
81
|
DCdouble result;
|
76
|
-
|
82
|
+
DCulonglong i;
|
77
83
|
} d;
|
78
|
-
|
79
|
-
d.f[0] = dcbArgFloat(p);
|
80
|
-
d.f[1] = dcbArgFloat(p);
|
84
|
+
d.i = dcbArgULongLong(p); /* those are passed via int regs */
|
81
85
|
return d.result;
|
82
86
|
}
|
87
|
+
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Header for MIPS
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2013-
|
9
|
+
Copyright (c) 2013-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,11 +31,23 @@
|
|
31
31
|
|
32
32
|
struct DCArgs
|
33
33
|
{
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
/* Don't change order or types, laid out for asm code to fill in! */
|
35
|
+
#if defined(DC__Arch_MIPS) && defined(DC__ABI_MIPS_O32)
|
36
|
+
DCint freg_count;
|
37
|
+
#else
|
38
|
+
# define DCARGS_MIPS_NUM_IREGS 8
|
39
|
+
# define DCARGS_MIPS_NUM_FREGS 8
|
40
|
+
# if defined(DC__Arch_MIPS)
|
41
|
+
DCint ireg_data[DCARGS_MIPS_NUM_IREGS];
|
42
|
+
DCfloat freg_data[DCARGS_MIPS_NUM_FREGS];
|
43
|
+
struct { DCshort i; DCshort f; } reg_count;
|
44
|
+
# elif defined(DC__Arch_MIPS64)
|
45
|
+
DClonglong ireg_data[DCARGS_MIPS_NUM_IREGS];
|
46
|
+
DCdouble freg_data[DCARGS_MIPS_NUM_FREGS];
|
47
|
+
DClonglong reg_count;
|
48
|
+
# endif
|
49
|
+
#endif
|
50
|
+
DCuchar* stackptr;
|
39
51
|
};
|
40
52
|
|
41
53
|
#endif /* DYNCALLBACK_ARGS_MIPS_H */
|
@@ -0,0 +1,81 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_args_mips64.c
|
6
|
+
Description: Callback's Arguments VM - Implementation for MIPS64 n32&n64
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2016-2018 Tassilo Philipp <tphilipp@potion-studios.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
|
+
|
26
|
+
#include "dyncall_args_mips.h"
|
27
|
+
|
28
|
+
/* @@@ test and add n32 code here, also, if needed */
|
29
|
+
|
30
|
+
DClonglong dcbArgLongLong(DCArgs* p)
|
31
|
+
{
|
32
|
+
DClonglong value;
|
33
|
+
if(p->reg_count < DCARGS_MIPS_NUM_IREGS)
|
34
|
+
value = p->ireg_data[p->reg_count++];
|
35
|
+
else {
|
36
|
+
value = *((DClonglong*)p->stackptr);
|
37
|
+
p->stackptr += sizeof(DClonglong);
|
38
|
+
}
|
39
|
+
return value;
|
40
|
+
}
|
41
|
+
DCulonglong dcbArgULongLong(DCArgs* p) { return (DCulonglong)dcbArgLongLong(p); }
|
42
|
+
|
43
|
+
DCint dcbArgInt (DCArgs* p) { return (DCint) dcbArgLongLong(p); }
|
44
|
+
DCuint dcbArgUInt (DCArgs* p) { return (DCuint) dcbArgLongLong(p); }
|
45
|
+
DClong dcbArgLong (DCArgs* p) { return (DClong) dcbArgLongLong(p); }
|
46
|
+
DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgLongLong(p); }
|
47
|
+
DCchar dcbArgChar (DCArgs* p) { return (DCchar) dcbArgLongLong(p); }
|
48
|
+
DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgLongLong(p); }
|
49
|
+
DCshort dcbArgShort (DCArgs* p) { return (DCshort) dcbArgLongLong(p); }
|
50
|
+
DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgLongLong(p); }
|
51
|
+
DCbool dcbArgBool (DCArgs* p) { return (DCbool) dcbArgLongLong(p); }
|
52
|
+
DCpointer dcbArgPointer(DCArgs* p) { return (DCpointer)dcbArgLongLong(p); }
|
53
|
+
|
54
|
+
DCdouble dcbArgDouble(DCArgs* p)
|
55
|
+
{
|
56
|
+
DCdouble result;
|
57
|
+
if(p->reg_count < DCARGS_MIPS_NUM_FREGS)
|
58
|
+
result = p->freg_data[p->reg_count++];
|
59
|
+
else {
|
60
|
+
result = *((DCdouble*)p->stackptr);
|
61
|
+
p->stackptr += sizeof(DCdouble);
|
62
|
+
}
|
63
|
+
return result;
|
64
|
+
}
|
65
|
+
DCfloat dcbArgFloat(DCArgs* p)
|
66
|
+
{
|
67
|
+
DCfloat result;
|
68
|
+
if(p->reg_count < DCARGS_MIPS_NUM_FREGS) {
|
69
|
+
result = ((DCfloat*)&p->freg_data[p->reg_count++])
|
70
|
+
#if defined(DC__Endian_LITTLE)
|
71
|
+
[0];
|
72
|
+
#else
|
73
|
+
[1]; /* single precision floats are right-justified in big-endian registers */
|
74
|
+
#endif
|
75
|
+
} else {
|
76
|
+
result = *((DCfloat*)p->stackptr); /* single precision floats are left-justified on stack in 64bit slots */
|
77
|
+
p->stackptr += sizeof(DCdouble);
|
78
|
+
}
|
79
|
+
return result;
|
80
|
+
}
|
81
|
+
|
@@ -0,0 +1,104 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_args_mips_o32.c
|
6
|
+
Description: Callback's Arguments VM - Implementation for MIPS o32
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2013-2018 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_args_mips.h"
|
28
|
+
|
29
|
+
DCint dcbArgInt(DCArgs* p)
|
30
|
+
{
|
31
|
+
DCint value;
|
32
|
+
p->freg_count = 2; /* first int will disable float reg use. */
|
33
|
+
value = *((int*)p->stackptr);
|
34
|
+
p->stackptr += sizeof(int);
|
35
|
+
return value;
|
36
|
+
}
|
37
|
+
DCuint dcbArgUInt(DCArgs* p) { return (DCuint)dcbArgInt(p); }
|
38
|
+
|
39
|
+
DCulonglong dcbArgULongLong(DCArgs* p)
|
40
|
+
{
|
41
|
+
DCulonglong value;
|
42
|
+
p->stackptr += ((int)p->stackptr & 4); /* Skip one slot if not aligned. */
|
43
|
+
#if defined(DC__Endian_LITTLE)
|
44
|
+
value = dcbArgUInt(p);
|
45
|
+
value |= ((DCulonglong)dcbArgUInt(p)) << 32;
|
46
|
+
#else
|
47
|
+
value = ((DCulonglong)dcbArgUInt(p)) << 32;
|
48
|
+
value |= dcbArgUInt(p);
|
49
|
+
#endif
|
50
|
+
return value;
|
51
|
+
}
|
52
|
+
DClonglong dcbArgLongLong(DCArgs* p) { return (DClonglong)dcbArgULongLong(p); }
|
53
|
+
|
54
|
+
DClong dcbArgLong (DCArgs* p) { return (DClong) dcbArgUInt(p); }
|
55
|
+
DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgUInt(p); }
|
56
|
+
DCchar dcbArgChar (DCArgs* p) { return (DCchar) dcbArgUInt(p); }
|
57
|
+
DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgUInt(p); }
|
58
|
+
DCshort dcbArgShort (DCArgs* p) { return (DCshort) dcbArgUInt(p); }
|
59
|
+
DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgUInt(p); }
|
60
|
+
DCbool dcbArgBool (DCArgs* p) { return (DCbool) dcbArgUInt(p); }
|
61
|
+
DCpointer dcbArgPointer(DCArgs* p) { return (DCpointer)dcbArgUInt(p); }
|
62
|
+
|
63
|
+
DCfloat dcbArgFloat(DCArgs* p)
|
64
|
+
{
|
65
|
+
DCfloat result;
|
66
|
+
if(p->freg_count < 2) {
|
67
|
+
/* Stored float regs (max 2) are always 8b aligned. The way we look them up, */
|
68
|
+
/* relative to a diverging p->stackptr, we need consider this. Only works */
|
69
|
+
/* with up to two float args, which is all we need. Hacky, but saves us */
|
70
|
+
/* from one more variable and more bookkeeping in DCArgs. */
|
71
|
+
result = ((DCfloat*)(p->stackptr + ((int)p->stackptr & 4)) - 4) /* '-4' b/c those regs are stored right before the args */
|
72
|
+
#if defined(DC__Endian_LITTLE)
|
73
|
+
[0];
|
74
|
+
#else
|
75
|
+
[1];
|
76
|
+
#endif
|
77
|
+
++p->freg_count;
|
78
|
+
} else {
|
79
|
+
result = *((DCfloat*)p->stackptr);
|
80
|
+
}
|
81
|
+
p->stackptr += sizeof(DCfloat);
|
82
|
+
return result;
|
83
|
+
}
|
84
|
+
DCdouble dcbArgDouble(DCArgs* p)
|
85
|
+
{
|
86
|
+
union {
|
87
|
+
DCdouble result;
|
88
|
+
DCfloat f[2];
|
89
|
+
} d;
|
90
|
+
p->stackptr += ((int)p->stackptr & 4); /* Skip one slot if not aligned. */
|
91
|
+
if(p->freg_count < 2) {
|
92
|
+
/*result = *((DCdouble*)p->stackptr-2); this changes the value, slightly*/
|
93
|
+
d.f[0] = ((DCfloat*)p->stackptr-4)[0]; /* '-4' b/c those regs are stored right before the args */
|
94
|
+
d.f[1] = ((DCfloat*)p->stackptr-4)[1];
|
95
|
+
++p->freg_count;
|
96
|
+
} else {
|
97
|
+
/*result = *((DCdouble*)p->stackptr); this changes the value, slightly*/
|
98
|
+
d.f[0] = ((DCfloat*)p->stackptr)[0];
|
99
|
+
d.f[1] = ((DCfloat*)p->stackptr)[1];
|
100
|
+
}
|
101
|
+
p->stackptr += sizeof(DCdouble);
|
102
|
+
return d.result;
|
103
|
+
}
|
104
|
+
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Implementation for ppc32
|
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
|
@@ -41,7 +41,7 @@ DCuint dcbArgUInt (DCArgs* p) { return (DCuint) dcbArgInt(p); }
|
|
41
41
|
DCulonglong dcbArgULongLong (DCArgs* p)
|
42
42
|
{
|
43
43
|
DCulonglong value;
|
44
|
-
value = ( (DCulonglong) dcbArgUInt(p) ) <<
|
44
|
+
value = ( (DCulonglong) dcbArgUInt(p) ) << 32UL;
|
45
45
|
value |= dcbArgUInt(p);
|
46
46
|
return value;
|
47
47
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Header for ppc32
|
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 Args Implementation for PowerPC 32-bit System V ABI
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>
|
9
|
+
Copyright (c) 2015-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
|
@@ -50,8 +50,8 @@ DCbool dcbArgBool (DCArgs* p) { return (DCbool) dcbArgLongLong(p); }
|
|
50
50
|
|
51
51
|
DCpointer dcbArgPointer (DCArgs* p) { return (DCpointer)dcbArgLongLong(p); }
|
52
52
|
|
53
|
-
DCdouble dcbArgDouble (DCArgs* p)
|
54
|
-
{
|
53
|
+
DCdouble dcbArgDouble (DCArgs* p)
|
54
|
+
{
|
55
55
|
DCdouble result;
|
56
56
|
|
57
57
|
if (p->freg_count < 13) {
|
@@ -67,5 +67,26 @@ DCdouble dcbArgDouble (DCArgs* p)
|
|
67
67
|
return result;
|
68
68
|
}
|
69
69
|
|
70
|
-
DCfloat
|
70
|
+
DCfloat dcbArgFloat (DCArgs* p)
|
71
|
+
{
|
72
|
+
DCfloat result;
|
73
|
+
|
74
|
+
#if defined(DC__Endian_BIG)
|
75
|
+
struct sf { DCfloat f_pad; DCfloat f; } sf;
|
76
|
+
#else /* Endian_LITTLE */
|
77
|
+
struct sf { DCfloat f; DCfloat f_pad; } sf;
|
78
|
+
#endif
|
71
79
|
|
80
|
+
if (p->freg_count < 13) {
|
81
|
+
result = (float)p->freg_data[p->freg_count++];
|
82
|
+
if (p->ireg_count < 8) {
|
83
|
+
p->ireg_count++;
|
84
|
+
}
|
85
|
+
} else {
|
86
|
+
sf = * ( (struct sf*) p->stackptr );
|
87
|
+
result = sf.f;
|
88
|
+
}
|
89
|
+
|
90
|
+
p->stackptr += sizeof(double);
|
91
|
+
return result;
|
92
|
+
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Callback's Arguments VM - Implementation for sparc32 - 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,43 @@
|
|
26
26
|
|
27
27
|
#include "dyncall_args_sparc32.h"
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
29
|
+
/* Compiler aligns this to 8-byte boundaries, b/c of dword members, a fact needed below */
|
30
|
+
typedef union {
|
31
|
+
DCdouble d;
|
32
|
+
DCulonglong L;
|
33
|
+
DCulong l[2];
|
34
|
+
} DCAligned64BitVal_t;
|
35
|
+
|
36
|
+
static void* sparc_word(DCArgs* args)
|
37
|
+
{
|
38
|
+
return args->arg_ptr++;
|
39
|
+
}
|
40
|
+
|
41
|
+
static void* sparc_dword(DCArgs* args)
|
42
|
+
{
|
43
|
+
void *p = args->arg_ptr;
|
44
|
+
args->arg_ptr += 2;
|
45
|
+
return p;
|
46
|
+
}
|
47
|
+
|
48
|
+
/* copy words so that dwords are 8-byte aligned, for 64bit value indirection; unaligned
|
49
|
+
access results in SIGBUS; not quite sure why compiler doesn't abstract this (maybe b/c
|
50
|
+
of not having any idea about our assembler code?) */
|
51
|
+
DCulonglong dcbArgULongLong(DCArgs* p) { DCAligned64BitVal_t v; DCulong *l = (DCulong*)sparc_dword(p); v.l[0]=l[0]; v.l[1]=l[1]; return v.L; }
|
52
|
+
DCdouble dcbArgDouble (DCArgs* p) { DCAligned64BitVal_t v; DCulong *l = (DCulong*)sparc_dword(p); v.l[0]=l[0]; v.l[1]=l[1]; return v.d; }
|
53
|
+
|
54
|
+
/* rest of getters based on above functions */
|
55
|
+
DCuint dcbArgUInt (DCArgs* p) { return *(DCuint*)sparc_word(p); }
|
56
|
+
DClonglong dcbArgLongLong (DCArgs* p) { return (DClonglong)dcbArgULongLong(p); }
|
57
|
+
DCint dcbArgInt (DCArgs* p) { return (DCint) dcbArgUInt(p); }
|
58
|
+
DClong dcbArgLong (DCArgs* p) { return (DClong) dcbArgUInt(p); }
|
59
|
+
DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgUInt(p); }
|
60
|
+
DCchar dcbArgChar (DCArgs* p) { return (DCchar) dcbArgUInt(p); }
|
61
|
+
DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgUInt(p); }
|
62
|
+
DCshort dcbArgShort (DCArgs* p) { return (DCshort) dcbArgUInt(p); }
|
63
|
+
DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgUInt(p); }
|
64
|
+
DCbool dcbArgBool (DCArgs* p) { return (DCbool) dcbArgUInt(p); }
|
65
|
+
DCpointer dcbArgPointer (DCArgs* p) { return (DCpointer) dcbArgUInt(p); }
|
66
|
+
|
67
|
+
DCfloat dcbArgFloat (DCArgs* p) { return *(DCfloat*) sparc_word(p); }
|
68
|
+
|