rbdc 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dyncall/BUGS +1 -1
- data/dyncall/CMakeLists.txt +19 -7
- data/dyncall/ChangeLog +61 -20
- data/dyncall/LICENSE +1 -1
- data/dyncall/Makefile.generic +2 -0
- data/dyncall/ToDo +97 -29
- data/dyncall/autovar/README.txt +1 -0
- data/dyncall/autovar/autovar_ABI.h +4 -2
- data/dyncall/autovar/autovar_ARCH.h +9 -5
- data/dyncall/autovar/autovar_CC.h +3 -1
- data/dyncall/autovar/autovar_OS.h +2 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +1 -1
- data/dyncall/configure +94 -38
- data/dyncall/dyncall/dyncall.3 +8 -4
- data/dyncall/dyncall/dyncall.h +1 -1
- data/dyncall/dyncall/dyncall_alloc.h +1 -1
- data/dyncall/dyncall/dyncall_api.c +3 -1
- data/dyncall/dyncall/dyncall_call.S +13 -5
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +1 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +24 -26
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +3 -7
- data/dyncall/dyncall/dyncall_call_arm64.S +2 -2
- data/dyncall/dyncall/dyncall_call_arm64.h +2 -2
- data/dyncall/dyncall/dyncall_call_mips.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +16 -16
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -2
- data/dyncall/dyncall/dyncall_call_mips_n32.h +5 -4
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +4 -4
- data/dyncall/dyncall/dyncall_call_mips_n64.h +3 -3
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +2 -2
- data/dyncall/dyncall/dyncall_call_mips_o32.h +4 -3
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +1 -3
- data/dyncall/dyncall/dyncall_call_ppc32.S +1 -1
- data/dyncall/dyncall/dyncall_call_ppc32.h +1 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +1 -1
- data/dyncall/dyncall/{dyncall_call_sparc.S → dyncall_call_sparc.s} +39 -44
- data/dyncall/dyncall/dyncall_call_sparc64.h +5 -5
- data/dyncall/dyncall/dyncall_call_sparc64.s +177 -0
- data/dyncall/dyncall/dyncall_call_x64.S +83 -86
- data/dyncall/dyncall/dyncall_call_x64.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86.S +9 -9
- data/dyncall/dyncall/dyncall_call_x86.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +5 -5
- data/dyncall/dyncall/dyncall_callf.c +18 -18
- data/dyncall/dyncall/dyncall_callf.h +1 -1
- data/dyncall/dyncall/dyncall_callvm.c +3 -3
- data/dyncall/dyncall/dyncall_callvm.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +25 -40
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +25 -33
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +24 -36
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm64.c +23 -27
- data/dyncall/dyncall/dyncall_callvm_arm64.h +2 -6
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_base.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +30 -27
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +24 -30
- data/dyncall/dyncall/{dyncall_call_sparc_v9.h → dyncall_callvm_mips_n32.h} +18 -8
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +4 -6
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +31 -29
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +22 -20
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +54 -15
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +0 -2
- data/dyncall/dyncall/dyncall_callvm_sparc.c +34 -26
- data/dyncall/dyncall/dyncall_callvm_sparc.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +94 -150
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +11 -17
- data/dyncall/dyncall/dyncall_callvm_x64.c +37 -36
- data/dyncall/dyncall/dyncall_callvm_x64.h +1 -4
- data/dyncall/dyncall/dyncall_callvm_x86.c +22 -63
- data/dyncall/dyncall/dyncall_callvm_x86.h +1 -17
- data/dyncall/dyncall/dyncall_config.h +1 -1
- data/dyncall/dyncall/dyncall_macros.h +28 -19
- data/dyncall/dyncall/dyncall_signature.h +1 -1
- data/dyncall/dyncall/dyncall_types.h +17 -18
- data/dyncall/dyncall/dyncall_utils.h +1 -1
- data/dyncall/dyncall/dyncall_value.h +28 -21
- data/dyncall/dyncall/dyncall_vector.c +1 -1
- data/dyncall/dyncall/dyncall_vector.h +1 -1
- data/dyncall/dyncall/gen-masm.sh +2 -2
- data/dyncall/dyncallback/CMakeLists.txt +1 -2
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +4 -3
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +8 -2
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +67 -4
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +7 -2
- data/dyncall/dyncallback/dyncall_args.c +19 -15
- data/dyncall/dyncallback/dyncall_args.h +1 -1
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.c → dyncall_args_arm32.c} +4 -4
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.h → dyncall_args_arm32.h} +6 -6
- data/dyncall/dyncallback/dyncall_args_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +2 -2
- data/dyncall/dyncallback/dyncall_args_mips.c +26 -21
- data/dyncall/dyncallback/dyncall_args_mips.h +18 -6
- data/dyncall/dyncallback/dyncall_args_mips64.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips_o32.c +104 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc64.c +24 -3
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -15
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -2
- data/dyncall/dyncallback/dyncall_args_sparc64.c +28 -15
- data/dyncall/dyncallback/dyncall_args_sparc64.h +7 -3
- data/dyncall/dyncallback/dyncall_args_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +1 -1
- data/dyncall/dyncallback/dyncall_callback.c +10 -12
- data/dyncall/dyncallback/dyncall_callback.h +2 -4
- data/dyncall/dyncallback/dyncall_callback_arch.S +12 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm.c → dyncall_callback_arm32.c} +25 -10
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +7 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.S +9 -9
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.c +20 -14
- data/dyncall/dyncallback/dyncall_callback_mips.c +26 -9
- data/dyncall/dyncallback/dyncall_callback_mips_eabi_gas.s +99 -0
- data/dyncall/dyncallback/{dyncall_args_arm32_thumb.h → dyncall_callback_mips_gas.S} +14 -9
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.c → dyncall_callback_mips_n32_gas.s} +12 -7
- data/dyncall/dyncallback/dyncall_callback_mips_n64_gas.s +98 -0
- data/dyncall/dyncallback/dyncall_callback_mips_o32_gas.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +54 -54
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +92 -117
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +55 -4
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +89 -5
- data/dyncall/dyncallback/dyncall_callback_x64.S +8 -8
- data/dyncall/dyncallback/dyncall_callback_x64.c +19 -6
- data/dyncall/dyncallback/dyncall_callback_x86.S +29 -25
- data/dyncall/dyncallback/dyncall_callback_x86.c +24 -11
- data/dyncall/dyncallback/dyncall_thunk.c +6 -6
- data/dyncall/dyncallback/dyncall_thunk.h +9 -7
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.c → dyncall_thunk_arm32.c} +5 -3
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.h → dyncall_thunk_arm32.h} +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +8 -13
- data/dyncall/dyncallback/dyncall_thunk_mips.c +16 -20
- data/dyncall/dyncallback/dyncall_thunk_mips.h +4 -2
- data/dyncall/dyncallback/dyncall_thunk_mips64.c +103 -0
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.h → dyncall_thunk_mips64.h} +15 -8
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +4 -4
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +9 -9
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +19 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +5 -4
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +42 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +5 -5
- data/dyncall/dyncallback/dyncall_thunk_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -2
- data/dyncall/dyncallback/dyncall_thunk_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -2
- data/dyncall/dyncallback/dyncallback.3 +16 -11
- data/dyncall/dynload/dynload.3 +63 -8
- data/dyncall/dynload/dynload.c +2 -8
- data/dyncall/dynload/dynload.h +9 -5
- data/dyncall/dynload/dynload_alloc.h +1 -1
- data/dyncall/dynload/dynload_syms.c +1 -3
- data/dyncall/dynload/dynload_syms_elf.c +19 -11
- data/dyncall/dynload/dynload_syms_mach-o.c +151 -75
- data/dyncall/dynload/dynload_syms_pe.c +24 -24
- data/dyncall/dynload/dynload_unix.c +156 -13
- data/dyncall/dynload/dynload_windows.c +15 -11
- data/dyncall/portasm/portasm-arm.S +1 -1
- data/dyncall/portasm/portasm-ppc.S +1 -1
- data/dyncall/portasm/{portasm-x64-att.S → portasm-x64.S} +7 -4
- data/dyncall/portasm/portasm-x86.S +4 -2
- data/{dyncall-bindings/ruby/rbdc/extconf.rb → extconf.rb} +4 -4
- data/{dyncall-bindings/ruby/rbdc/rbdc.c → rbdc.c} +5 -5
- metadata +24 -48
- data/dyncall/Makefile.M +0 -15
- data/dyncall/buildsys/dynmake/Makefile.base.M +0 -82
- data/dyncall/buildsys/dynmake/dynmake.bat +0 -2
- data/dyncall/buildsys/dynmake/dynmake.sh +0 -4
- data/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/Makefile.M +0 -10
- data/dyncall/dyncall/TODO +0 -9
- data/dyncall/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/dyncall_call_sparc64.S +0 -362
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +0 -222
- data/dyncall/dyncall/dyncall_call_x64-att.S +0 -147
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +0 -182
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +0 -46
- data/dyncall/dyncallback/Makefile.M +0 -10
- data/dyncall/dyncallback/README.txt +0 -9
- data/dyncall/dyncallback/TODO +0 -4
- data/dyncall/dyncallback/dynMakefile +0 -4
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +0 -46
- data/dyncall/dyncallback/dyncall_callback_mips.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +0 -56
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +0 -44
- data/dyncall/dyncallback/dyncall_callback_x64.h +0 -45
- data/dyncall/dyncallback/dyncall_callback_x86.h +0 -50
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +0 -36
- data/dyncall/dynload/Makefile.M +0 -10
- data/dyncall/dynload/TODO +0 -20
- data/dyncall/dynload/dynMakefile +0 -4
- data/dyncall/dynload/dynload_darwin.c +0 -90
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Call Kernel for ARM 32-bit ARM Architecture - Hard Float
|
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
|
@@ -51,38 +51,36 @@ GLOBAL_C(dcCall_arm32_armhf)
|
|
51
51
|
ENTRY_C(dcCall_arm32_armhf)
|
52
52
|
|
53
53
|
/* Prolog. This function never needs to spill inside its prolog, so just store the permanent registers. */
|
54
|
-
mov
|
55
|
-
stmdb
|
54
|
+
mov r12 , r13 /* Stack ptr (r13) -> temporary (r12). */
|
55
|
+
stmdb r13!, {r4-r5, r11, r12, r14} /* Permanent registers and stack pointer (now in r12), etc... -> save area on stack (except counter). */
|
56
56
|
|
57
|
-
mov
|
58
|
-
mov
|
59
|
-
|
60
|
-
|
61
|
-
/* Load 16 single-precision registers (= 8 double-precision registers). */
|
62
|
-
fldmiad r3, {d0-d7}
|
57
|
+
mov r11, r12 /* Set frame ptr. */
|
58
|
+
mov r4, r0 /* r4 = fptr */
|
59
|
+
add r5, r1, #16 /* r5 = stack args (after intreg ones) */
|
63
60
|
|
64
|
-
|
65
|
-
|
66
|
-
ble armhf_call
|
61
|
+
/* Load 16 single-precision registers (= 8 double-precision registers). */
|
62
|
+
fldmiad r3, {d0-d7}
|
67
63
|
|
68
|
-
|
69
|
-
|
64
|
+
/* prep stack parameter area (includes room for spill area, callee spills if needed) */
|
65
|
+
sub r13, r13, r2
|
66
|
+
and r13, r13, #-8 /* align 8-byte. */
|
70
67
|
|
71
|
-
|
72
|
-
|
68
|
+
sub r2, r2, #16 /* loop counters for stack params to copy */
|
69
|
+
mov r3, #0
|
73
70
|
armhf_pushArgs:
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
71
|
+
cmp r2, r3
|
72
|
+
ble armhf_call
|
73
|
+
ldr r0, [r5, +r3] /* load word into r0 ... */
|
74
|
+
str r0, [r13, +r3] /* ... then push onto stack */
|
75
|
+
add r3, r3, #4
|
76
|
+
b armhf_pushArgs
|
79
77
|
|
80
78
|
armhf_call:
|
81
|
-
ldmia
|
82
|
-
|
83
|
-
mov
|
84
|
-
bx
|
79
|
+
ldmia r1, {r0-r3} /* Load first 4 arguments for new call into r0-r3. */
|
80
|
+
/* 'blx %r4' workaround for ARMv4t: */
|
81
|
+
mov r14, r15 /* Branch return address(r15) -> link register (r14) -- r15 always points to address of current + 2 instructions (= Epilog code). */
|
82
|
+
bx r4 /* Call (ARM/THUMB), available for ARMv4t. */
|
85
83
|
|
86
84
|
/* Epilog. */
|
87
|
-
ldmdb
|
85
|
+
ldmdb r11, {r4-r5, r11, r13, r15} /* Restore permanent registers (ignore temporary (r12), restore stack ptr and program counter).@@@db not needed since we rewrite r13? */
|
88
86
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
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:
|
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: Call Kernel for ARM 32-bit ARM Architecture - Hard Float in Thumb code
|
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
|
@@ -36,17 +36,13 @@
|
|
36
36
|
dcCall_arm32_thumb:
|
37
37
|
|
38
38
|
/* Prolog. This function never needs to spill inside its prolog, so just store the permanent registers. */
|
39
|
-
|
39
|
+
/* Code below is not using high registers, so not storing them in prolog, which is more involved with thumb, anyways. */
|
40
|
+
push {%r4-%r7, %r14} /* Frame ptr, permanent registers, link register -> save area on stack. */
|
40
41
|
mov %r7, %r13 /* Set frame ptr. */
|
42
|
+
sub %r13, #4 /* Realign stack to 8 bytes (b/c we stored 5 regs = 20b). */
|
41
43
|
|
42
44
|
/* Call. */
|
43
45
|
mov %r4, %r0 /* Move 'fptr' to r4 (1st argument is passed in r0). */
|
44
|
-
|
45
|
-
/* Disable 'thumb' address forcing... */
|
46
|
-
|
47
|
-
/* mov %r0, #1 */ /* Assure that LSB is set to 1 (THUMB call). - Not Required and not useful for interworking calls */
|
48
|
-
/* orr %r4, %r0 */
|
49
|
-
|
50
46
|
mov %r5, %r1 /* Move 'args' to r5 (2nd argument is passed in r1). */
|
51
47
|
mov %r6, %r2 /* Move 'size' to r6 (3rd argument is passed in r2). */
|
52
48
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
Description: Call Kernel for ARM 64-bit Architecture (aka ARM64, AArch64)
|
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: ARM 64-bit
|
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,7 +6,7 @@
|
|
6
6
|
Description: mips call-kernel C interfaces.
|
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: mips "eabi" abi call kernel C 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
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_call_mips_eabi_gas.s
|
6
|
-
Description:
|
6
|
+
Description: mips "eabi" abi call kernel implementation in GNU Assembler
|
7
7
|
License:
|
8
8
|
|
9
9
|
Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
dcCall_mips_eabi:
|
39
39
|
/* $4 target function */
|
40
|
-
|
40
|
+
/* $5 register data */
|
41
41
|
/* $6 stack size */
|
42
42
|
/* $7 stack data */
|
43
43
|
addiu $sp,$sp,-16
|
@@ -46,7 +46,7 @@ dcCall_mips_eabi:
|
|
46
46
|
sw $fp,0($sp)
|
47
47
|
|
48
48
|
move $fp,$sp
|
49
|
-
|
49
|
+
|
50
50
|
move $2, $0
|
51
51
|
add $2, 8
|
52
52
|
neg $2
|
@@ -57,9 +57,9 @@ dcCall_mips_eabi:
|
|
57
57
|
move $12,$4 /* target function */
|
58
58
|
move $13,$5 /* register data */
|
59
59
|
move $16,$6 /* stack size */
|
60
|
-
|
60
|
+
|
61
61
|
sub $sp,$sp,$16 /* allocate stack frame */
|
62
|
-
|
62
|
+
|
63
63
|
/* copy stack data */
|
64
64
|
|
65
65
|
.next:
|
@@ -73,8 +73,8 @@ dcCall_mips_eabi:
|
|
73
73
|
addiu $sp,$sp, 4
|
74
74
|
j .next
|
75
75
|
nop
|
76
|
-
|
77
|
-
.skip:
|
76
|
+
|
77
|
+
.skip:
|
78
78
|
|
79
79
|
sub $sp,$sp,$16
|
80
80
|
|
@@ -89,16 +89,16 @@ dcCall_mips_eabi:
|
|
89
89
|
lw $10,24($13)
|
90
90
|
lw $11,28($13)
|
91
91
|
|
92
|
-
/* load single-
|
92
|
+
/* load single-precision floating pointer parameter registers */
|
93
93
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
94
|
+
l.s $f12, 32($13)
|
95
|
+
l.s $f13, 36($13)
|
96
|
+
l.s $f14, 40($13)
|
97
|
+
l.s $f15, 44($13)
|
98
|
+
l.s $f16, 48($13)
|
99
|
+
l.s $f17, 52($13)
|
100
|
+
l.s $f18, 56($13)
|
101
|
+
l.s $f19, 60($13)
|
102
102
|
|
103
103
|
jal $12
|
104
104
|
nop
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_call_mips_gas.S
|
6
|
-
Description: auto-select (via
|
6
|
+
Description: auto-select (via C preprocessor) mips abi call kernel
|
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
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_call_mips_n32.h
|
6
|
-
Description:
|
6
|
+
Description: mips64 "n32" ABI call-kernel C 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
|
@@ -52,12 +52,13 @@ extern "C" {
|
|
52
52
|
|
53
53
|
struct DCRegData_mips_n32
|
54
54
|
{
|
55
|
-
DClonglong
|
55
|
+
DClonglong mIntData[8];
|
56
56
|
union { DCfloat f; DCdouble d; } mFloatData[8];
|
57
|
-
DClonglong
|
57
|
+
DClonglong mUseDouble; /* bitmask: lower 8 bits specify to use float or double from union array. */
|
58
58
|
};
|
59
59
|
|
60
60
|
void dcCall_mips_n32(DCpointer target, struct DCRegData_mips_n32* regdata, DCsize stksize, DCpointer stkdata);
|
61
|
+
/* @@@ this is the same as n64, combine code */
|
61
62
|
|
62
63
|
#ifdef __cplusplus
|
63
64
|
}
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Package: dyncall
|
4
4
|
Library: dyncall
|
5
5
|
File: dyncall/dyncall_call_mips_n32_gas.s
|
6
|
-
Description:
|
6
|
+
Description: mips64 "n32" abi call kernel implementation in GNU Assembler
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2016 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
|
@@ -177,8 +177,8 @@ dcCall_mips_n32:
|
|
177
177
|
/* jump-and-link to register $25 */
|
178
178
|
|
179
179
|
jal $31, $25
|
180
|
-
|
181
|
-
|
180
|
+
nop /* branch-delay slot - no nop according to gcc assembly */
|
181
|
+
/* output, but let's play safe */
|
182
182
|
|
183
183
|
/* Stack-frame epilog */
|
184
184
|
move $sp,$fp
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "n64" ABI call-kernel C 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
|
@@ -52,9 +52,9 @@ extern "C" {
|
|
52
52
|
|
53
53
|
struct DCRegData_mips_n64
|
54
54
|
{
|
55
|
-
DClonglong
|
55
|
+
DClonglong mIntData[8];
|
56
56
|
union { DCfloat f; DCdouble d; } mFloatData[8];
|
57
|
-
DClonglong
|
57
|
+
DClonglong mUseDouble; /* bitmask: lower 8 bits specify to use float or double from union array. */
|
58
58
|
};
|
59
59
|
|
60
60
|
void dcCall_mips_n64(DCpointer target, struct DCRegData_mips_n64* regdata, DCsize stksize, DCpointer stkdata);
|
@@ -177,8 +177,8 @@ dcCall_mips_n64:
|
|
177
177
|
/* jump-and-link to register $25 */
|
178
178
|
|
179
179
|
jal $31, $25
|
180
|
-
|
181
|
-
|
180
|
+
nop /* branch-delay slot - no nop according to gcc assembly */
|
181
|
+
/* output, but let's play safe */
|
182
182
|
|
183
183
|
/* Stack-frame epilog */
|
184
184
|
move $sp,$fp
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "o32" abi call kernel C 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
|
@@ -43,8 +43,9 @@ extern "C" {
|
|
43
43
|
32-bit floating pointer registers.
|
44
44
|
Float arguments map as following:
|
45
45
|
|
46
|
-
float argument 0 is at
|
47
|
-
float argument 1 is at
|
46
|
+
float argument 0 is at u[0][0] for little, u[0][1] for big endian and
|
47
|
+
float argument 1 is at u[1][0] for little, u[1][1] for big endian of
|
48
|
+
DCRegData_mips_o32 union.
|
48
49
|
|
49
50
|
*/
|
50
51
|
|
@@ -42,7 +42,6 @@ dcCall_mips_o32:
|
|
42
42
|
.mask 0xc0000000,-4
|
43
43
|
.fmask 0x00000000,0
|
44
44
|
.set noreorder
|
45
|
-
.set nomacro
|
46
45
|
|
47
46
|
addiu $sp,$sp,-8
|
48
47
|
sw $31,4($sp) /* save link register */
|
@@ -77,8 +76,8 @@ dcCall_mips_o32:
|
|
77
76
|
|
78
77
|
l.d $f12, 0($5)
|
79
78
|
l.d $f14, 8($5)
|
80
|
-
/* prepare call */
|
81
79
|
|
80
|
+
/* prepare call */
|
82
81
|
|
83
82
|
move $12, $7 /* $12 stack data */
|
84
83
|
move $25, $4 /* $25 target function */
|
@@ -102,7 +101,6 @@ dcCall_mips_o32:
|
|
102
101
|
j $31 /* return */
|
103
102
|
nop
|
104
103
|
|
105
|
-
.set macro
|
106
104
|
.set reorder
|
107
105
|
.end dcCall_mips_o32
|
108
106
|
.ident "handwritten"
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: Call Kernel for PowerPC 32-bit Architecture
|
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:
|
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:
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011-
|
9
|
+
Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>
|
10
10
|
|
11
11
|
Permission to use, copy, modify, and distribute this software for any
|
12
12
|
purpose with or without fee is hereby granted, provided that the above
|
@@ -27,6 +27,8 @@
|
|
27
27
|
|
28
28
|
/* ---------------------------------------------------------------------------
|
29
29
|
|
30
|
+
@@@ this should all go in manual
|
31
|
+
|
30
32
|
call kernel for sparc 32-bit
|
31
33
|
----------------------------
|
32
34
|
tested on linux/debian [gcc54.fsffrance.org - thanx to the farm!]
|
@@ -45,7 +47,7 @@ in sparc, this is simply a leaf-function layer using %o3.
|
|
45
47
|
|
46
48
|
old C Interface:
|
47
49
|
void dcCall_sparc (DCpointer target, DCsize size, DCpointer data);
|
48
|
-
|
50
|
+
%i0 , %i1 , %i2
|
49
51
|
|
50
52
|
|
51
53
|
Input:
|
@@ -95,11 +97,11 @@ Stack Layout 32-Bit Model:
|
|
95
97
|
0: 16 registers save area
|
96
98
|
|
97
99
|
Stack Layout 64-Bit Model:
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
100
|
+
XX: should be 16 byte aligned (min stack frame size is 172).
|
101
|
+
168: on stack argument 6
|
102
|
+
136: input argument 0 spill
|
103
|
+
128: struct/union poiner return value
|
104
|
+
0: 16 registers save area
|
103
105
|
|
104
106
|
|
105
107
|
|
@@ -121,26 +123,20 @@ r24-r31 -> ins
|
|
121
123
|
|
122
124
|
*/
|
123
125
|
|
124
|
-
|
125
|
-
|
126
|
-
#error invalid arch
|
127
|
-
#else
|
128
|
-
#define REGSIZE 4
|
129
|
-
#endif
|
130
|
-
|
131
|
-
#define ALIGN 16
|
126
|
+
REGSIZE = 4
|
127
|
+
ALIGN = 16
|
132
128
|
CALLVM_size = 12
|
133
129
|
CALLVM_dataoff = 16
|
130
|
+
|
131
|
+
.text
|
134
132
|
.global dcCall_sparc
|
135
133
|
dcCall_sparc:
|
136
134
|
|
137
135
|
/* Basic Prolog: supports up to 6 arguments. */
|
138
136
|
|
139
|
-
/* new C interface */
|
140
137
|
/* o0-1: callvm,target */
|
141
|
-
|
142
|
-
or %
|
143
|
-
or %o1, %g0, %o0 /* %o0: target */
|
138
|
+
or %o0, %g0, %o3 /* %o3: callvm */
|
139
|
+
or %o1, %g0, %o0 /* %o0: target */
|
144
140
|
ld [%o3+CALLVM_size], %o1 /* %o1: size */
|
145
141
|
add %o3, CALLVM_dataoff, %o2 /* %o2: data */
|
146
142
|
/*o0-2:target,size,data*/
|
@@ -148,46 +144,45 @@ dcCall_sparc:
|
|
148
144
|
/*leaf functions: may use the first six output registers.*/
|
149
145
|
/*o3-5:free to use */
|
150
146
|
|
151
|
-
/* Compute a
|
152
|
-
|
147
|
+
/* Compute a matching stack size (approximate): o3 = align(92+o1,16) */
|
153
148
|
add %o1, (16+1+6)*REGSIZE+ALIGN-1, %o3
|
154
149
|
and %o3, -ALIGN, %o3
|
155
150
|
neg %o3
|
156
|
-
|
151
|
+
|
157
152
|
/* Prolog. */
|
158
|
-
save
|
159
|
-
|
160
|
-
/* Load output registers. */
|
153
|
+
save %sp, %o3, %sp /* min stack size (16+1+6)*sizeof(ptr)=92 paddded to 8-byte alignment => min frame size of 96 bytes. */
|
161
154
|
|
162
|
-
|
163
|
-
ld
|
164
|
-
ld
|
165
|
-
ld
|
166
|
-
ld
|
167
|
-
ld
|
155
|
+
/* Load output registers. */
|
156
|
+
ld [%i2 ],%o0
|
157
|
+
ld [%i2+REGSIZE*1 ],%o1
|
158
|
+
ld [%i2+REGSIZE*2 ],%o2
|
159
|
+
ld [%i2+REGSIZE*3 ],%o3
|
160
|
+
ld [%i2+REGSIZE*4 ],%o4
|
161
|
+
ld [%i2+REGSIZE*5 ],%o5
|
168
162
|
|
169
163
|
/* Copy on stack? */
|
170
|
-
sub
|
171
|
-
cmp
|
172
|
-
|
164
|
+
sub %i1, REGSIZE*6, %i1 /* i1 = decrement copy size by 6 regs (=6 regs x 4 bytes = 24 bytes total). */
|
165
|
+
cmp %i1, 0
|
166
|
+
ble .do_call
|
173
167
|
nop
|
174
168
|
|
175
169
|
/* Copy loop: */
|
176
|
-
add %i2,
|
177
|
-
or %g0, %g0, %l0
|
178
|
-
add %sp,
|
170
|
+
add %i2, REGSIZE*6, %i2 /* i2 = address of 7th word of args buffer. */
|
171
|
+
or %g0, %g0, %l0 /* l0 = offset initialized to 0. */
|
172
|
+
add %sp, (16+1+6)*REGSIZE, %l2 /* l2 = argument area on stack space (7th word). (64+4+6*4 = byte offset 92). */
|
179
173
|
.next:
|
180
|
-
ld [%i2+%l0],%l1
|
181
|
-
st %l1, [%l2+%l0]
|
182
|
-
add %l0, REGSIZE, %l0
|
183
|
-
sub %i1, REGSIZE, %i1
|
174
|
+
ld [%i2+%l0],%l1 /* Read from arg buffer(%i2) to %l1. */
|
175
|
+
st %l1, [%l2+%l0] /* Write %l1 to stack space(%l2). */
|
176
|
+
add %l0, REGSIZE, %l0 /* Increment offset. */
|
177
|
+
sub %i1, REGSIZE, %i1 /* Decrement copy size. */
|
184
178
|
cmp %i1, 0
|
185
179
|
bgt .next
|
186
180
|
nop
|
187
181
|
.do_call:
|
188
|
-
call %i0
|
182
|
+
call %i0 /* Call target. */
|
189
183
|
nop
|
190
|
-
|
191
|
-
|
192
|
-
jmpl
|
184
|
+
or %o0, %g0, %i0
|
185
|
+
or %o1, %g0, %i1
|
186
|
+
jmpl %i7 + 8, %g0 /* optimized restore;retl;nop */
|
193
187
|
restore
|
188
|
+
|