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,45 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_arm64.h
|
6
|
+
Description: ARM 64-bit
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
#ifndef DYNCALL_CALL_ARM64_DEBIAN_H
|
29
|
+
#define DYNCALL_CALL_ARM64_DEBIAN_H
|
30
|
+
|
31
|
+
|
32
|
+
#include "dyncall_types.h"
|
33
|
+
|
34
|
+
#ifdef __cplusplus
|
35
|
+
extern "C" {
|
36
|
+
#endif
|
37
|
+
|
38
|
+
void dcCall_arm64(DCpointer target, DCpointer data, DCsize size, DCpointer regdata);
|
39
|
+
|
40
|
+
#ifdef __cplusplus
|
41
|
+
}
|
42
|
+
#endif
|
43
|
+
|
44
|
+
|
45
|
+
#endif /* DYNCALL_CALL_ARM64_DEBIAN_H */
|
@@ -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-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
/*
|
28
29
|
|
29
30
|
dyncall MIPS call kernel C interface for all ABIs
|
@@ -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-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_CALL_MIPS_EABI_H
|
28
29
|
#define DYNCALL_CALL_MIPS_EABI_H
|
29
30
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: auto-select (via gnu c preprocessor) mips abi call kernel
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#if defined(DC__ABI_MIPS_O32)
|
28
29
|
#include "dyncall_call_mips_o32_gas.s"
|
29
30
|
#elif defined(DC__ABI_MIPS_N64)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: mips "n32" ABI call-kernel C interface.
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -24,6 +24,7 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#ifndef DYNCALL_CALL_MIPS_N32_H
|
28
29
|
#define DYNCALL_CALL_MIPS_N32_H
|
29
30
|
|
@@ -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-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_CALL_MIPS_N64_H
|
28
29
|
#define DYNCALL_CALL_MIPS_N64_H
|
29
30
|
|
@@ -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-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_CALL_MIPS_O32_H
|
28
29
|
#define DYNCALL_CALL_MIPS_O32_H
|
29
30
|
|
@@ -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-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,11 +24,12 @@
|
|
24
24
|
*/
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
#include "../portasm/portasm-ppc.S"
|
28
29
|
|
29
30
|
/*
|
30
31
|
Call Kernel Implementations for PowerPC.
|
31
|
-
Supported Calling Conventions: sysv, darwin
|
32
|
+
Supported Calling Conventions: sysv, darwin, syscall
|
32
33
|
|
33
34
|
*/
|
34
35
|
|
@@ -46,6 +47,7 @@
|
|
46
47
|
darwin, sysv
|
47
48
|
|
48
49
|
ChangeLog:
|
50
|
+
2015-01-15: Added support for system calls.
|
49
51
|
2011-04-03: Using portasm.
|
50
52
|
2009-01-09: Added Support for System V ABI.
|
51
53
|
2007-11-28: Initial Support for Darwin.
|
@@ -264,3 +266,26 @@ ENTRY_C(dcCall_ppc32_sysv)
|
|
264
266
|
blr /* return */
|
265
267
|
|
266
268
|
|
269
|
+
.align 2
|
270
|
+
|
271
|
+
GLOBAL_C(dcCall_ppc32_syscall)
|
272
|
+
ENTRY_C(dcCall_ppc32_syscall)
|
273
|
+
mflr r0 /* r0 = return address */
|
274
|
+
stw r0,4(r1) /* store r0 to link-area */
|
275
|
+
li r0, -8
|
276
|
+
stwux r1,r1,r0 /* store r1 and decrement */
|
277
|
+
|
278
|
+
mr r0, r3 /* r0 = syscall number ( passed as 'target function' ) */
|
279
|
+
mr r11, r4 /* r11 = reg data */
|
280
|
+
lwz r3 , 0(r11)
|
281
|
+
lwz r4 , 4(r11)
|
282
|
+
lwz r5 , 8(r11)
|
283
|
+
lwz r6 ,12(r11)
|
284
|
+
lwz r7 ,16(r11)
|
285
|
+
sc
|
286
|
+
|
287
|
+
lwz r1, 0(r1) /* restore stack */
|
288
|
+
lwz r0, 4(r1) /* r0 = return address */
|
289
|
+
mtlr r0 /* setup link register */
|
290
|
+
blr
|
291
|
+
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
9
|
+
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
10
|
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and distribute this software for any
|
@@ -36,7 +36,7 @@ extern "C" {
|
|
36
36
|
struct DCRegData_ppc32_
|
37
37
|
{
|
38
38
|
DCint mIntData[8];
|
39
|
-
DCdouble mFloatData[13];
|
39
|
+
DCdouble mFloatData[13]; /* 13 for darwin, 8 for sysv */
|
40
40
|
};
|
41
41
|
|
42
42
|
/*
|
@@ -0,0 +1,210 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_ppc64.S
|
6
|
+
Description: Call Kernel for PowerPC 64-bit Architecture
|
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
|
+
|
26
|
+
#include "../portasm/portasm-ppc64.S"
|
27
|
+
|
28
|
+
/*
|
29
|
+
Call Kernel Implementations for PowerPC64.
|
30
|
+
*/
|
31
|
+
|
32
|
+
/* ============================================================================
|
33
|
+
DynCall Call Kernels for PPC64 Architecture
|
34
|
+
-------------------------------------------------------------------------
|
35
|
+
C Interface:
|
36
|
+
struct DCRegData { int i[8]; double d[13]; };
|
37
|
+
dcCall_ppc64(DCpointer target, struct DCRegData* pRegData, DCsize stacksize, DCptr stackdata);
|
38
|
+
|
39
|
+
ChangeLog:
|
40
|
+
2015-07-08: Added support for system calls
|
41
|
+
2014-08-07: Initial Support
|
42
|
+
|
43
|
+
*/
|
44
|
+
|
45
|
+
/* ----------------------------------------------------------------------------
|
46
|
+
|
47
|
+
Call Kernel for ppc64
|
48
|
+
|
49
|
+
Input:
|
50
|
+
r3 : target address ptr
|
51
|
+
r4 : register data ptr (8 x GPR 64 bytes, 13 x FPR 64 bytes)
|
52
|
+
r5 : stack data size
|
53
|
+
r6 : stack data ptr
|
54
|
+
|
55
|
+
Details:
|
56
|
+
- Stack frames are always aligned on 16 byte
|
57
|
+
- Reserve GPR2 (System register)
|
58
|
+
- The GPR3 .. GPR10 are loaded
|
59
|
+
- The FPR1 .. FPR8 are loaded
|
60
|
+
- No support for Vector Parameters so far.
|
61
|
+
- Parameter Area (min. v1:64 Bytes v2:0 Byte)
|
62
|
+
- Frame Header Area (v1:48 Bytes v2:32 Bytes)
|
63
|
+
|
64
|
+
Frame structure:
|
65
|
+
|
66
|
+
on entry, parent frame layout:
|
67
|
+
|
68
|
+
offset
|
69
|
+
16: LR save word (Callee stores LR in parent frame)
|
70
|
+
0: parent stack frame (back-chain)
|
71
|
+
|
72
|
+
after frame initialization:
|
73
|
+
|
74
|
+
v1: stack size = ( (48+64+8+15) + stacksize ) & -(16)
|
75
|
+
v2: stack size = ( (32+0+8+15) + stacksize ) & -(16)
|
76
|
+
|
77
|
+
... locals and register spills
|
78
|
+
48 or 32: parameter list area
|
79
|
+
16: LR save word (Callee stores LR in parent frame)
|
80
|
+
0: parent stack frame (back-chain)
|
81
|
+
*/
|
82
|
+
|
83
|
+
/* Constants */
|
84
|
+
#if DC__ABI_PPC64_ELF_V != 2
|
85
|
+
STACK_MIN = 120 /* v1 */
|
86
|
+
TOC_SAVE = 40
|
87
|
+
PARAM_SAVE = 48
|
88
|
+
#else
|
89
|
+
STACK_MIN = 40 /* v2 */
|
90
|
+
TOC_SAVE = 24
|
91
|
+
PARAM_SAVE = 32
|
92
|
+
#endif
|
93
|
+
|
94
|
+
.text
|
95
|
+
.align 2
|
96
|
+
GLOBAL_C(dcCall_ppc64)
|
97
|
+
ENTRY_C(dcCall_ppc64)
|
98
|
+
mflr r0 /* r0 = return address */
|
99
|
+
std r0,16(r1) /* store r0 to link-area */
|
100
|
+
std r31,-8(r1)
|
101
|
+
|
102
|
+
/* compute aligned stack-size */
|
103
|
+
|
104
|
+
/* add link area and align to 16 byte (+15) */
|
105
|
+
|
106
|
+
/* r0 = stacksize + frame parameter(back-chain link, this callee's call return address) */
|
107
|
+
addi r0,r5,STACK_MIN+15 /* r0 = r5 + STACK_MIN + 15 */
|
108
|
+
rlwinm r0,r0,0,0,27 /* r0 = r0 and -15 */
|
109
|
+
neg r0,r0 /* r0 = -r0 */
|
110
|
+
stdux r1,r1,r0 /* store r1 and decrement */
|
111
|
+
|
112
|
+
/* copy stack data */
|
113
|
+
|
114
|
+
subi r6,r6,8 /* r6 = 8 bytes before source stack ptr */
|
115
|
+
addi r7,r1,PARAM_SAVE-8 /* r7 = 8 bytes before target stack parameter-block */
|
116
|
+
|
117
|
+
srwi r5,r5,3 /* r5 = size in double words */
|
118
|
+
|
119
|
+
cmpi cr0,r5,0 /* if stacksize != 0 .. */
|
120
|
+
beq cr0,.copy_done
|
121
|
+
|
122
|
+
mtctr r5 /* copy loop */
|
123
|
+
|
124
|
+
.copy_next:
|
125
|
+
ldu r0, 8(r6)
|
126
|
+
stdu r0, 8(r7)
|
127
|
+
bdnz .copy_next
|
128
|
+
|
129
|
+
.copy_done:
|
130
|
+
|
131
|
+
/* this call support using ctr branch register */
|
132
|
+
|
133
|
+
mr r12, r3 /* r12 = target function */
|
134
|
+
std r2,TOC_SAVE(r1)
|
135
|
+
#if DC__ABI_PPC64_ELF_V != 2
|
136
|
+
ld r2,8(r12)
|
137
|
+
ld r0,0(r12)
|
138
|
+
mtctr r0
|
139
|
+
#else
|
140
|
+
mtctr r12
|
141
|
+
#endif
|
142
|
+
mr r11, r4 /* r11 = reg data */
|
143
|
+
|
144
|
+
/* load 8 integer registers */
|
145
|
+
|
146
|
+
ld r3 , 0(r11)
|
147
|
+
ld r4 , 8(r11)
|
148
|
+
ld r5 ,16(r11)
|
149
|
+
ld r6 ,24(r11)
|
150
|
+
ld r7 ,32(r11)
|
151
|
+
ld r8 ,40(r11)
|
152
|
+
ld r9 ,48(r11)
|
153
|
+
ld r10,56(r11)
|
154
|
+
|
155
|
+
/* load 13 float registers */
|
156
|
+
|
157
|
+
lfd f1 , 64(r11)
|
158
|
+
lfd f2 , 72(r11)
|
159
|
+
lfd f3 , 80(r11)
|
160
|
+
lfd f4 , 88(r11)
|
161
|
+
lfd f5 , 96(r11)
|
162
|
+
lfd f6 ,104(r11)
|
163
|
+
lfd f7 ,112(r11)
|
164
|
+
lfd f8 ,120(r11)
|
165
|
+
lfd f9 ,128(r11)
|
166
|
+
lfd f10,136(r11)
|
167
|
+
lfd f11,144(r11)
|
168
|
+
lfd f12,152(r11)
|
169
|
+
lfd f13,160(r11)
|
170
|
+
|
171
|
+
bctrl /* branch with this call support */
|
172
|
+
|
173
|
+
/* epilog */
|
174
|
+
|
175
|
+
ld r2,TOC_SAVE(r1)
|
176
|
+
ld r1, 0(r1) /* restore stack */
|
177
|
+
ld r31,-8(r1)
|
178
|
+
ld r0,16(r1) /* r0 = return address */
|
179
|
+
mtlr r0 /* setup link register */
|
180
|
+
blr /* return */
|
181
|
+
|
182
|
+
.align 2
|
183
|
+
GLOBAL_C(dcCall_ppc64_syscall)
|
184
|
+
ENTRY_C(dcCall_ppc64_syscall)
|
185
|
+
mflr r0 /* r0 = return address */
|
186
|
+
std r0,16(r1) /* store r0 to link-area */
|
187
|
+
std r31,-8(r1)
|
188
|
+
li r0, -STACK_MIN
|
189
|
+
stdux r1,r1,r0 /* store r1 and decrement */
|
190
|
+
|
191
|
+
mr r0, r3 /* r0 = syscall number ( passed as 'target function' ) */
|
192
|
+
mr r11, r4 /* r11 = reg data */
|
193
|
+
|
194
|
+
/* load 5 integer registers */
|
195
|
+
ld r3 , 0(r11)
|
196
|
+
ld r4 , 8(r11)
|
197
|
+
ld r5 ,16(r11)
|
198
|
+
ld r6 ,24(r11)
|
199
|
+
ld r7 ,32(r11)
|
200
|
+
|
201
|
+
sc /* system call */
|
202
|
+
|
203
|
+
/* epilog */
|
204
|
+
|
205
|
+
ld r2,TOC_SAVE(r1)
|
206
|
+
ld r1, 0(r1) /* restore stack */
|
207
|
+
ld r31,-8(r1)
|
208
|
+
ld r0,16(r1) /* r0 = return address */
|
209
|
+
mtlr r0 /* setup link register */
|
210
|
+
blr /* return */
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_ppc64.h
|
6
|
+
Description:
|
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
|
+
|
26
|
+
#ifndef DYNCALL_PPC64_H
|
27
|
+
#define DYNCALL_PPC64_H
|
28
|
+
|
29
|
+
#include "dyncall_types.h"
|
30
|
+
|
31
|
+
#ifdef __cplusplus
|
32
|
+
extern "C" {
|
33
|
+
#endif
|
34
|
+
|
35
|
+
struct DCRegData_ppc64_
|
36
|
+
{
|
37
|
+
DClonglong mIntData[8];
|
38
|
+
DCdouble mFloatData[13];
|
39
|
+
};
|
40
|
+
|
41
|
+
/*
|
42
|
+
** PowerPC 64-bit calling convention call
|
43
|
+
**
|
44
|
+
** - hybrid return-type call (bool ... pointer)
|
45
|
+
**
|
46
|
+
*/
|
47
|
+
|
48
|
+
void dcCall_ppc64(DCpointer target, struct DCRegData_ppc64_* ppc64data, DCsize stksize, DCpointer stkdata);
|
49
|
+
|
50
|
+
#ifdef __cplusplus
|
51
|
+
}
|
52
|
+
#endif
|
53
|
+
|
54
|
+
#endif /* DYNCALL_PPC64_H */
|
55
|
+
|