rbdc 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bindings/ruby/rbdc/extconf.rb +57 -0
- data/bindings/ruby/rbdc/rbdc.c +304 -0
- data/dyncall/AUTHORS +4 -0
- data/dyncall/BUGS +3 -0
- data/dyncall/CMakeLists.txt +79 -0
- data/dyncall/ChangeLog +165 -0
- data/dyncall/LICENSE +15 -0
- data/dyncall/Makefile.M +15 -0
- data/dyncall/Makefile.embedded +71 -0
- data/dyncall/Makefile.generic +36 -0
- data/dyncall/Nmakefile +45 -0
- data/dyncall/README +92 -0
- data/dyncall/ToDo +114 -0
- data/dyncall/autovar/LICENSE.txt +15 -0
- data/dyncall/autovar/README.txt +69 -0
- data/dyncall/autovar/autovar_ABI.h +44 -0
- data/dyncall/autovar/autovar_ARCH.h +56 -0
- data/dyncall/autovar/autovar_CC.h +46 -0
- data/dyncall/autovar/autovar_OS.h +78 -0
- data/dyncall/autovar/autovar_OSFAMILY.h +39 -0
- data/dyncall/buildsys/cmake/Modules/FindDynCall.cmake +43 -0
- data/dyncall/buildsys/cmake/Modules/FindDynCallback.cmake +43 -0
- data/dyncall/buildsys/cmake/Modules/FindDynLoad.cmake +45 -0
- data/dyncall/buildsys/cmake/Modules/UseLATEX.cmake +811 -0
- data/dyncall/buildsys/dynmake/Makefile.base.M +82 -0
- data/dyncall/buildsys/dynmake/dynmake.bat +2 -0
- data/dyncall/buildsys/dynmake/dynmake.sh +4 -0
- data/dyncall/buildsys/lua/Makefile +10 -0
- data/dyncall/buildsys/lua/README.txt +4 -0
- data/dyncall/buildsys/lua/bootstrap.sh +34 -0
- data/dyncall/buildsys/lua/cleanup.sh +6 -0
- data/dyncall/buildsys/lua/mkfile +34 -0
- data/dyncall/buildsys/lua/setenv.sh +4 -0
- data/dyncall/buildsys/mk/app.mk +30 -0
- data/dyncall/buildsys/mk/dirs.mk +27 -0
- data/dyncall/buildsys/mk/epilog.mk +30 -0
- data/dyncall/buildsys/mk/lib.mk +23 -0
- data/dyncall/buildsys/mk/pcc.mk +60 -0
- data/dyncall/buildsys/mk/prolog.mk +35 -0
- data/dyncall/buildsys/nmake/common.nmake +61 -0
- data/dyncall/buildsys/nmake/epilog.nmake +28 -0
- data/dyncall/buildsys/nmake/prolog.nmake +76 -0
- data/dyncall/buildsys/nmake/tool_gcc.nmake +82 -0
- data/dyncall/buildsys/nmake/tool_msvc.nmake +67 -0
- data/dyncall/buildsys/scripts/batch-build-linux.sh +11 -0
- data/dyncall/buildsys/scripts/batch-build-minix.sh +11 -0
- data/dyncall/buildsys/scripts/batch-build-psp.sh +11 -0
- data/dyncall/buildsys/scripts/conf-nds.bat +41 -0
- data/dyncall/buildsys/scripts/setenv-cross-ios.sh +8 -0
- data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +22 -0
- data/dyncall/buildsys/vs2005/dyncall/dyncall.vcproj +245 -0
- data/dyncall/buildsys/vs2005/test_plain/test_plain.vcproj +202 -0
- data/dyncall/buildsys/vs2005/vs2005.sln +29 -0
- data/dyncall/configure +152 -0
- data/dyncall/configure.bat +157 -0
- data/dyncall/configure.rc +234 -0
- data/dyncall/dynMakefile +4 -0
- data/dyncall/dyncall/CMakeLists.txt +53 -0
- data/dyncall/dyncall/DynCallConfig.cmake +3 -0
- data/dyncall/dyncall/Makefile.M +10 -0
- data/dyncall/dyncall/Makefile.embedded +20 -0
- data/dyncall/dyncall/Makefile.generic +16 -0
- data/dyncall/dyncall/Nmakefile +62 -0
- data/dyncall/dyncall/README-Developer.txt +45 -0
- data/dyncall/dyncall/README.txt +65 -0
- data/dyncall/dyncall/TODO +9 -0
- data/dyncall/dyncall/dynMakefile +4 -0
- data/dyncall/dyncall/dyncall.3 +189 -0
- data/dyncall/dyncall/dyncall.h +135 -0
- data/dyncall/dyncall/dyncall_alloc.h +40 -0
- data/dyncall/dyncall/dyncall_api.c +167 -0
- data/dyncall/dyncall/dyncall_call.S +72 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +80 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +61 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +96 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +44 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +65 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_apple.s +80 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +121 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +101 -0
- data/dyncall/dyncall/dyncall_call_mips.h +50 -0
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +61 -0
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +115 -0
- data/dyncall/dyncall/dyncall_call_mips_gas.S +36 -0
- data/dyncall/dyncall/dyncall_call_mips_n32.h +67 -0
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +192 -0
- data/dyncall/dyncall/dyncall_call_mips_n64.h +67 -0
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +192 -0
- data/dyncall/dyncall/dyncall_call_mips_o32.h +70 -0
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +109 -0
- data/dyncall/dyncall/dyncall_call_ppc32.S +266 -0
- data/dyncall/dyncall/dyncall_call_ppc32.h +62 -0
- data/dyncall/dyncall/dyncall_call_sparc.S +192 -0
- data/dyncall/dyncall/dyncall_call_sparc.h +42 -0
- data/dyncall/dyncall/dyncall_call_sparc64.S +361 -0
- data/dyncall/dyncall/dyncall_call_sparc64.h +42 -0
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +220 -0
- data/dyncall/dyncall/dyncall_call_sparc_v9.h +42 -0
- data/dyncall/dyncall/dyncall_call_x64-att.S +146 -0
- data/dyncall/dyncall/dyncall_call_x64.S +149 -0
- data/dyncall/dyncall/dyncall_call_x64.h +63 -0
- data/dyncall/dyncall/dyncall_call_x64_generic_masm.asm +70 -0
- data/dyncall/dyncall/dyncall_call_x86.S +238 -0
- data/dyncall/dyncall/dyncall_call_x86.h +70 -0
- data/dyncall/dyncall/dyncall_call_x86_8a.s +127 -0
- data/dyncall/dyncall/dyncall_call_x86_generic_masm.asm +136 -0
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +234 -0
- data/dyncall/dyncall/dyncall_callf.c +112 -0
- data/dyncall/dyncall/dyncall_callf.h +52 -0
- data/dyncall/dyncall/dyncall_callvm.c +68 -0
- data/dyncall/dyncall/dyncall_callvm.h +88 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +250 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +59 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +204 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +63 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +271 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +59 -0
- data/dyncall/dyncall/dyncall_callvm_base.c +33 -0
- data/dyncall/dyncall/dyncall_callvm_mips.c +40 -0
- data/dyncall/dyncall/dyncall_callvm_mips.h +37 -0
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +181 -0
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +61 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +268 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +268 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +53 -0
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +235 -0
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +45 -0
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +372 -0
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +61 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.c +155 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.h +44 -0
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +239 -0
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +47 -0
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +182 -0
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +45 -0
- data/dyncall/dyncall/dyncall_callvm_x64.c +228 -0
- data/dyncall/dyncall/dyncall_callvm_x64.h +111 -0
- data/dyncall/dyncall/dyncall_callvm_x86.c +667 -0
- data/dyncall/dyncall/dyncall_callvm_x86.h +75 -0
- data/dyncall/dyncall/dyncall_config.h +46 -0
- data/dyncall/dyncall/dyncall_macros.h +248 -0
- data/dyncall/dyncall/dyncall_signature.h +71 -0
- data/dyncall/dyncall/dyncall_struct.c +255 -0
- data/dyncall/dyncall/dyncall_struct.h +69 -0
- data/dyncall/dyncall/dyncall_types.h +74 -0
- data/dyncall/dyncall/dyncall_utils.h +38 -0
- data/dyncall/dyncall/dyncall_value.h +73 -0
- data/dyncall/dyncall/dyncall_vector.c +52 -0
- data/dyncall/dyncall/dyncall_vector.h +56 -0
- data/dyncall/dyncall/gen-masm.sh +7 -0
- data/dyncall/dyncall/mkfile +29 -0
- data/dyncall/dyncallback/CMakeLists.txt +55 -0
- data/dyncall/dyncallback/DynCallbackConfig.cmake +2 -0
- data/dyncall/dyncallback/Makefile.M +10 -0
- data/dyncall/dyncallback/Makefile.embedded +15 -0
- data/dyncall/dyncallback/Makefile.generic +20 -0
- data/dyncall/dyncallback/Nmakefile +71 -0
- data/dyncall/dyncallback/README.txt +9 -0
- data/dyncall/dyncallback/TODO +4 -0
- data/dyncall/dyncallback/dynMakefile +4 -0
- data/dyncall/dyncallback/dyncall_alloc_wx.c +35 -0
- data/dyncall/dyncallback/dyncall_alloc_wx.h +46 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +40 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +42 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +42 -0
- data/dyncall/dyncallback/dyncall_args.c +45 -0
- data/dyncall/dyncallback/dyncall_args.h +65 -0
- data/dyncall/dyncallback/dyncall_args_arm32_arm.c +112 -0
- data/dyncall/dyncallback/dyncall_args_arm32_arm.h +40 -0
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +32 -0
- data/dyncall/dyncallback/dyncall_args_mips.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips.h +41 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +88 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.h +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.h +37 -0
- data/dyncall/dyncallback/dyncall_args_sparc64.c +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc64.h +37 -0
- data/dyncall/dyncallback/dyncall_args_x64.c +73 -0
- data/dyncall/dyncallback/dyncall_args_x64.h +44 -0
- data/dyncall/dyncallback/dyncall_args_x86.c +121 -0
- data/dyncall/dyncallback/dyncall_args_x86.h +58 -0
- data/dyncall/dyncallback/dyncall_callback.c +45 -0
- data/dyncall/dyncallback/dyncall_callback.h +51 -0
- data/dyncall/dyncallback/dyncall_callback_arch.S +71 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +63 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +45 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +73 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.s +73 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +33 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.s +32 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.s +32 -0
- data/dyncall/dyncallback/dyncall_callback_mips.c +61 -0
- data/dyncall/dyncallback/dyncall_callback_mips.h +42 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +33 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +60 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +43 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +180 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +57 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +43 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +30 -0
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +57 -0
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +30 -0
- data/dyncall/dyncallback/dyncall_callback_x64.S +187 -0
- data/dyncall/dyncallback/dyncall_callback_x64.c +69 -0
- data/dyncall/dyncallback/dyncall_callback_x64.h +44 -0
- data/dyncall/dyncallback/dyncall_callback_x64_apple.s +122 -0
- data/dyncall/dyncallback/dyncall_callback_x64_gas.s +119 -0
- data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +102 -0
- data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +89 -0
- data/dyncall/dyncallback/dyncall_callback_x86.S +115 -0
- data/dyncall/dyncallback/dyncall_callback_x86.c +281 -0
- data/dyncall/dyncallback/dyncall_callback_x86.h +49 -0
- data/dyncall/dyncallback/dyncall_callback_x86_8a.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +74 -0
- data/dyncall/dyncallback/dyncall_thunk.c +47 -0
- data/dyncall/dyncallback/dyncall_thunk.h +84 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +45 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +40 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +35 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.c +52 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.h +37 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +51 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +40 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +32 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +36 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +32 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +36 -0
- data/dyncall/dyncallback/dyncall_thunk_x64.c +48 -0
- data/dyncall/dyncallback/dyncall_thunk_x64.h +39 -0
- data/dyncall/dyncallback/dyncall_thunk_x86.c +44 -0
- data/dyncall/dyncallback/dyncall_thunk_x86.h +39 -0
- data/dyncall/dyncallback/dyncallback.3 +134 -0
- data/dyncall/dyncallback/gen-masm.sh +8 -0
- data/dyncall/dyncallback/mkfile +29 -0
- data/dyncall/dynload/CMakeLists.txt +25 -0
- data/dyncall/dynload/DynLoadConfig.cmake +3 -0
- data/dyncall/dynload/Makefile.M +10 -0
- data/dyncall/dynload/Makefile.embedded +22 -0
- data/dyncall/dynload/Makefile.generic +18 -0
- data/dyncall/dynload/Nmakefile +57 -0
- data/dyncall/dynload/README.txt +113 -0
- data/dyncall/dynload/TODO +20 -0
- data/dyncall/dynload/dynMakefile +4 -0
- data/dyncall/dynload/dynload.3 +64 -0
- data/dyncall/dynload/dynload.c +38 -0
- data/dyncall/dynload/dynload.h +65 -0
- data/dyncall/dynload/dynload_alloc.h +40 -0
- data/dyncall/dynload/dynload_darwin.c +89 -0
- data/dyncall/dynload/dynload_syms.c +38 -0
- data/dyncall/dynload/dynload_syms_elf.c +214 -0
- data/dyncall/dynload/dynload_syms_mach-o.c +167 -0
- data/dyncall/dynload/dynload_syms_pe.c +109 -0
- data/dyncall/dynload/dynload_unix.c +57 -0
- data/dyncall/dynload/dynload_windows.c +59 -0
- data/dyncall/mkfile +36 -0
- data/dyncall/portasm/README.txt +42 -0
- data/dyncall/portasm/gen-masm.sh +3 -0
- data/dyncall/portasm/portasm-arm.S +36 -0
- data/dyncall/portasm/portasm-ppc.S +98 -0
- data/dyncall/portasm/portasm-x64-att.S +155 -0
- data/dyncall/portasm/portasm-x86.S +127 -0
- metadata +311 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_mips_n64.h
|
6
|
+
Description: mips "n64" ABI call-kernel C interface.
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 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
|
+
#ifndef DYNCALL_CALL_MIPS_N64_H
|
28
|
+
#define DYNCALL_CALL_MIPS_N64_H
|
29
|
+
|
30
|
+
#include "dyncall_types.h"
|
31
|
+
|
32
|
+
#ifdef __cplusplus
|
33
|
+
extern "C" {
|
34
|
+
#endif
|
35
|
+
|
36
|
+
/*
|
37
|
+
two register-files for integer (promoted to 64-bit) and float (not promoted!)
|
38
|
+
are used.
|
39
|
+
|
40
|
+
arguments are transfered in a free slot on the corresponding register file.
|
41
|
+
the other register-file will be skipped by one.
|
42
|
+
|
43
|
+
float arguments are either loaded from single or double -
|
44
|
+
a auto-conversion into double and then loaded as double precision
|
45
|
+
turned out to fail for several tests.
|
46
|
+
|
47
|
+
therefore a union for storage of float or double is used instead.
|
48
|
+
a bitmask (mUseDouble) records which type is used and will be
|
49
|
+
interpreted in the call-kernel.
|
50
|
+
*/
|
51
|
+
|
52
|
+
struct DCRegData_mips_n64
|
53
|
+
{
|
54
|
+
DClonglong mIntData[8];
|
55
|
+
union { DCfloat f; DCdouble d; } mFloatData[8];
|
56
|
+
DClonglong mUseDouble; /* bitmask: lower 8 bits specifies to use float or double from union array. */
|
57
|
+
};
|
58
|
+
|
59
|
+
void dcCall_mips_n64(DCpointer target, struct DCRegData_mips_n64* regdata, DCsize stksize, DCpointer stkdata);
|
60
|
+
|
61
|
+
#ifdef __cplusplus
|
62
|
+
}
|
63
|
+
#endif
|
64
|
+
|
65
|
+
|
66
|
+
#endif /* DYNCALL_CALL_MIPS_N64_H */
|
67
|
+
|
@@ -0,0 +1,192 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_mips_n64_gas.s
|
6
|
+
Description: mips "n64" abi call kernel implementation in GNU Assembler
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 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
|
+
.section .mdebug.abi64
|
27
|
+
.previous
|
28
|
+
.abicalls
|
29
|
+
.text
|
30
|
+
.align 2
|
31
|
+
.globl dcCall_mips_n64
|
32
|
+
.ent dcCall_mips_n64
|
33
|
+
dcCall_mips_n64:
|
34
|
+
|
35
|
+
/* Stack-frame prolog */
|
36
|
+
|
37
|
+
# .frame $fp,64,$31 /* vars=16, regs=3/0, args=0, extra=16 */
|
38
|
+
# .mask 0xd0000000,-8
|
39
|
+
# .fmask 0x00000000,0
|
40
|
+
dsubu $sp,$sp,64
|
41
|
+
sd $31,48($sp) /* save return address register (ra) */
|
42
|
+
sd $30,40($sp) /* save frame pointer register (fp) */
|
43
|
+
sd $28,32($sp) /* save global pointer register (gp) */
|
44
|
+
move $fp,$sp
|
45
|
+
|
46
|
+
|
47
|
+
/* arguments: */
|
48
|
+
|
49
|
+
/* $4 target function */
|
50
|
+
/* $5 register data */
|
51
|
+
/* $6 stack size */
|
52
|
+
/* $7 stack data */
|
53
|
+
|
54
|
+
|
55
|
+
/* allocate argument stack space */
|
56
|
+
|
57
|
+
dsubu $sp, $sp, $6
|
58
|
+
|
59
|
+
/* copy stack data */
|
60
|
+
|
61
|
+
/* n64 abi call assumptions:
|
62
|
+
- stack data is 16-byte aligned.
|
63
|
+
- no extra-storage for arguments passed via registers.
|
64
|
+
*/
|
65
|
+
|
66
|
+
/* $12 source pointer (parameter stack data) */
|
67
|
+
/* $14 destination (stack pointer) */
|
68
|
+
/* $6 byte count */
|
69
|
+
|
70
|
+
move $12, $7
|
71
|
+
move $14, $sp
|
72
|
+
|
73
|
+
.next:
|
74
|
+
beq $6, $0, .skip
|
75
|
+
# nop
|
76
|
+
daddiu $6, $6, -8
|
77
|
+
ld $2, 0($12)
|
78
|
+
sd $2, 0($14)
|
79
|
+
daddiu $12,$12, 8
|
80
|
+
daddiu $14,$14, 8
|
81
|
+
b .next
|
82
|
+
.skip:
|
83
|
+
move $25, $4
|
84
|
+
|
85
|
+
/* load registers */
|
86
|
+
|
87
|
+
/* locals: */
|
88
|
+
/* $13 = register data */
|
89
|
+
/* $14 = useDouble flags */
|
90
|
+
move $13, $5
|
91
|
+
ld $14, 128($13)
|
92
|
+
|
93
|
+
/* load integer parameter registers */
|
94
|
+
|
95
|
+
ld $4 , 0($13)
|
96
|
+
ld $5 , 8($13)
|
97
|
+
ld $6 ,16($13)
|
98
|
+
ld $7 ,24($13)
|
99
|
+
ld $8 ,32($13)
|
100
|
+
ld $9 ,40($13)
|
101
|
+
ld $10,48($13)
|
102
|
+
ld $11,56($13)
|
103
|
+
|
104
|
+
/* load float-or-double floating pointer parameter registers
|
105
|
+
a 64-bit bitmask given at byte offset 128 of regdata indicates
|
106
|
+
if loading a float (bit cleared) or double (bit set), starting
|
107
|
+
at bit position 0 in bitmask.
|
108
|
+
*/
|
109
|
+
.t0:
|
110
|
+
and $15, $14, 1
|
111
|
+
bgtz $15, .d0
|
112
|
+
.f0:
|
113
|
+
l.s $f12, 64($13)
|
114
|
+
j .t1
|
115
|
+
.d0:
|
116
|
+
l.d $f12, 64($13)
|
117
|
+
|
118
|
+
.t1:
|
119
|
+
and $15, $14, 2
|
120
|
+
bgtz $15, .d1
|
121
|
+
.f1:
|
122
|
+
l.s $f13, 72($13)
|
123
|
+
j .t2
|
124
|
+
.d1:
|
125
|
+
l.d $f13, 72($13)
|
126
|
+
.t2:
|
127
|
+
and $15, $14, 4
|
128
|
+
bgtz $15, .d2
|
129
|
+
.f2:
|
130
|
+
l.s $f14, 80($13)
|
131
|
+
j .t3
|
132
|
+
.d2:
|
133
|
+
l.d $f14, 80($13)
|
134
|
+
.t3:
|
135
|
+
and $15, $14, 8
|
136
|
+
bgtz $15, .d3
|
137
|
+
.f3:
|
138
|
+
l.s $f15, 88($13)
|
139
|
+
j .t4
|
140
|
+
.d3:
|
141
|
+
l.d $f15, 88($13)
|
142
|
+
.t4:
|
143
|
+
and $15, $14, 16
|
144
|
+
bgtz $15, .d4
|
145
|
+
.f4:
|
146
|
+
l.s $f16, 96($13)
|
147
|
+
j .t5
|
148
|
+
.d4:
|
149
|
+
l.d $f16, 96($13)
|
150
|
+
.t5:
|
151
|
+
and $15, $14, 32
|
152
|
+
bgtz $15, .d5
|
153
|
+
.f5:
|
154
|
+
l.s $f17,104($13)
|
155
|
+
j .t6
|
156
|
+
.d5:
|
157
|
+
l.d $f17,104($13)
|
158
|
+
.t6:
|
159
|
+
and $15, $14, 64
|
160
|
+
bgtz $15, .d6
|
161
|
+
.f6:
|
162
|
+
l.s $f18,112($13)
|
163
|
+
j .t7
|
164
|
+
.d6:
|
165
|
+
l.d $f18,112($13)
|
166
|
+
.t7:
|
167
|
+
and $15, $14, 128
|
168
|
+
bgtz $15, .d7
|
169
|
+
.f7:
|
170
|
+
l.s $f19,120($13)
|
171
|
+
j .fregend
|
172
|
+
.d7:
|
173
|
+
l.d $f19,120($13)
|
174
|
+
|
175
|
+
.fregend:
|
176
|
+
|
177
|
+
/* jump-and-link to register $25 */
|
178
|
+
|
179
|
+
jal $31, $25
|
180
|
+
|
181
|
+
/* no nop according to gcc assembly output */
|
182
|
+
|
183
|
+
/* Stack-frame epilog */
|
184
|
+
move $sp,$fp
|
185
|
+
ld $ra,48($sp) /* restore ra register */
|
186
|
+
ld $fp,40($sp) /* restore fp register */
|
187
|
+
ld $gp,32($sp) /* restore gp register */
|
188
|
+
daddu $sp,$sp,64
|
189
|
+
j $ra
|
190
|
+
.end dcCall_mips_n64
|
191
|
+
.size dcCall_mips_n64, .-dcCall_mips_n64
|
192
|
+
|
@@ -0,0 +1,70 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_mips_o32.h
|
6
|
+
Description: mips "o32" abi call kernel C interface.
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 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
|
+
#ifndef DYNCALL_CALL_MIPS_O32_H
|
28
|
+
#define DYNCALL_CALL_MIPS_O32_H
|
29
|
+
|
30
|
+
#include "dyncall_types.h"
|
31
|
+
|
32
|
+
#ifdef __cplusplus
|
33
|
+
extern "C" {
|
34
|
+
#endif
|
35
|
+
|
36
|
+
/* Call-kernel register data:
|
37
|
+
|
38
|
+
Details:
|
39
|
+
The structure holds the argument data for transfering float/double arguments
|
40
|
+
via registers as well.
|
41
|
+
The call-kernel implements loads two doubles, which involves four
|
42
|
+
32-bit floating pointer registers.
|
43
|
+
Float arguments map as following:
|
44
|
+
|
45
|
+
float argument 0 is at floats[1] and
|
46
|
+
float argument 1 is at floats[3] of DCRegData_mips_o32 union.
|
47
|
+
|
48
|
+
*/
|
49
|
+
|
50
|
+
typedef struct DCRegData_mips_o32_
|
51
|
+
{
|
52
|
+
union {
|
53
|
+
double d;
|
54
|
+
float f[2];
|
55
|
+
} u[2];
|
56
|
+
} DCRegData_mips_o32;
|
57
|
+
|
58
|
+
|
59
|
+
/* Call kernel. */
|
60
|
+
|
61
|
+
void dcCall_mips_o32(DCpointer target, DCRegData_mips_o32* regdata, DCsize stksize, DCpointer stkdata);
|
62
|
+
|
63
|
+
|
64
|
+
#ifdef __cplusplus
|
65
|
+
}
|
66
|
+
#endif
|
67
|
+
|
68
|
+
|
69
|
+
#endif /* DYNCALL_CALL_MIPS_O32_H */
|
70
|
+
|
@@ -0,0 +1,109 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_mips_o32_gas.s
|
6
|
+
Description: mips "o32" abi call kernel implementation in GNU Assembler
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 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
|
+
/* $4 target function */
|
26
|
+
/* $5 register data */
|
27
|
+
/* $6 stack size (min 16-byte aligned to 8-bytes already) */
|
28
|
+
/* $7 stack data */
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
.section .mdebug.abi32
|
33
|
+
.previous
|
34
|
+
.abicalls
|
35
|
+
.text
|
36
|
+
.align 2
|
37
|
+
.globl dcCall_mips_o32
|
38
|
+
.ent dcCall_mips_o32
|
39
|
+
.type dcCall_mips_o32, @function
|
40
|
+
dcCall_mips_o32:
|
41
|
+
.frame $fp,40,$31 /* vars=8, regs=2/0, args=16, gp=8 */
|
42
|
+
.mask 0xc0000000,-4
|
43
|
+
.fmask 0x00000000,0
|
44
|
+
.set noreorder
|
45
|
+
.set nomacro
|
46
|
+
|
47
|
+
addiu $sp,$sp,-8
|
48
|
+
sw $31,4($sp) /* save link register */
|
49
|
+
sw $fp,0($sp) /* save frame pointer */
|
50
|
+
nop
|
51
|
+
move $fp,$sp /* frame pointer = sp */
|
52
|
+
sub $sp, $sp, $6 /* increment stack */
|
53
|
+
|
54
|
+
/* copy stack data */
|
55
|
+
|
56
|
+
/* $12 source pointer (parameter stack data) */
|
57
|
+
/* $14 destination (stack pointer) */
|
58
|
+
/* $6 byte count */
|
59
|
+
|
60
|
+
move $12, $7
|
61
|
+
move $14, $sp
|
62
|
+
|
63
|
+
.next:
|
64
|
+
beq $6, $0, .skip
|
65
|
+
nop
|
66
|
+
lw $2, 0($12)
|
67
|
+
nop
|
68
|
+
sw $2, 0($14)
|
69
|
+
addiu $12,$12, 4
|
70
|
+
addiu $14,$14, 4
|
71
|
+
addiu $6, $6, -4
|
72
|
+
j .next
|
73
|
+
nop
|
74
|
+
.skip:
|
75
|
+
|
76
|
+
/* load two double-precision floating-point argument registers ($f12, $f14) */
|
77
|
+
|
78
|
+
l.d $f12, 0($5)
|
79
|
+
l.d $f14, 8($5)
|
80
|
+
/* prepare call */
|
81
|
+
|
82
|
+
|
83
|
+
move $12, $7 /* $12 stack data */
|
84
|
+
move $25, $4 /* $25 target function */
|
85
|
+
|
86
|
+
/* load first four integer arguments ($4-$7) */
|
87
|
+
|
88
|
+
lw $4, 0($12)
|
89
|
+
lw $5, 4($12)
|
90
|
+
lw $6, 8($12)
|
91
|
+
lw $7,12($12)
|
92
|
+
|
93
|
+
/* call target function */
|
94
|
+
|
95
|
+
jalr $25
|
96
|
+
nop
|
97
|
+
move $sp,$fp /* restore stack pointer */
|
98
|
+
nop
|
99
|
+
lw $31,4($sp) /* restore return address */
|
100
|
+
lw $fp,0($sp) /* restore frame pointer */
|
101
|
+
addiu $sp,$sp,8 /* end stack frame */
|
102
|
+
j $31 /* return */
|
103
|
+
nop
|
104
|
+
|
105
|
+
.set macro
|
106
|
+
.set reorder
|
107
|
+
.end dcCall_mips_o32
|
108
|
+
.ident "handwritten"
|
109
|
+
|
@@ -0,0 +1,266 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_ppc32.S
|
6
|
+
Description: Call Kernel for PowerPC 32-bit Architecture
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 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 "../portasm/portasm-ppc.S"
|
28
|
+
|
29
|
+
/*
|
30
|
+
Call Kernel Implementations for PowerPC.
|
31
|
+
Supported Calling Conventions: sysv, darwin
|
32
|
+
|
33
|
+
*/
|
34
|
+
|
35
|
+
.machine ppc
|
36
|
+
.text
|
37
|
+
|
38
|
+
/* ============================================================================
|
39
|
+
DynCall Call Kernels for PPC32 Architecture
|
40
|
+
-------------------------------------------------------------------------
|
41
|
+
C Interface:
|
42
|
+
struct DCRegData { int i[8]; double d[13]; };
|
43
|
+
dcCall_ppc32_XXX(DCpointer target, struct DCRegData* pRegData, DCsize stacksize, DCptr stackdata);
|
44
|
+
|
45
|
+
Where XXX is one of the following Calling Conventions:
|
46
|
+
darwin, sysv
|
47
|
+
|
48
|
+
ChangeLog:
|
49
|
+
2011-04-03: Using portasm.
|
50
|
+
2009-01-09: Added Support for System V ABI.
|
51
|
+
2007-11-28: Initial Support for Darwin.
|
52
|
+
|
53
|
+
*/
|
54
|
+
|
55
|
+
/*---------------------------------------------------------------------------
|
56
|
+
|
57
|
+
Call Kernel for ppc32 Darwin
|
58
|
+
|
59
|
+
Input:
|
60
|
+
r3 : target address ptr
|
61
|
+
r4 : register data ptr (8 x GPR 32 bytes, 13 x FPR 64 bytes)
|
62
|
+
r5 : stack data size
|
63
|
+
r6 : stack data ptr
|
64
|
+
|
65
|
+
Details:
|
66
|
+
- Stack frames are always aligned on 16 byte
|
67
|
+
- The GPR3 .. GPR10 are loaded
|
68
|
+
- The FPR1 .. FPR13 are loaded
|
69
|
+
- No support for Vector Parameters so far.
|
70
|
+
- Parameter Area (min. 32 Bytes)
|
71
|
+
- Linkage Area (24 Bytes)
|
72
|
+
*/
|
73
|
+
|
74
|
+
.align 2
|
75
|
+
GLOBAL_C(dcCall_ppc32_darwin)
|
76
|
+
ENTRY_C(dcCall_ppc32_darwin)
|
77
|
+
|
78
|
+
|
79
|
+
mflr r0 /* r0 = return address */
|
80
|
+
stw r0,8(r1) /* store return address in caller link-area */
|
81
|
+
|
82
|
+
/* compute aligned stack-size */
|
83
|
+
|
84
|
+
/* add link area and align to 16 byte border */
|
85
|
+
|
86
|
+
addi r0,r5,24+15 /* r0 = stacksize + link area */
|
87
|
+
|
88
|
+
rlwinm r0,r0,0,0,27 /* r0 = r0 and -15 */
|
89
|
+
/* r0 = r0 and -15 */
|
90
|
+
neg r2,r0 /* r2 = -stacksize */
|
91
|
+
|
92
|
+
stwux r1,r1,r2 /* r1 = r1 - stacksize */
|
93
|
+
|
94
|
+
/* copy stack data */
|
95
|
+
|
96
|
+
subi r6,r6,4 /* r6 = 4 bytes before source stack ptr */
|
97
|
+
addi r7,r1,20 /* r7 = 4 bytes before target stack parameter-block */
|
98
|
+
|
99
|
+
srwi r5,r5,2 /* r5 = size in words */
|
100
|
+
|
101
|
+
cmpi cr0,r5,0 /* if stacksize != 0 .. */
|
102
|
+
beq cr0,.osx_done
|
103
|
+
|
104
|
+
mtctr r5 /* copy loop */
|
105
|
+
|
106
|
+
.osx_next:
|
107
|
+
lwzu r0, 4(r6)
|
108
|
+
stwu r0, 4(r7)
|
109
|
+
bdnz .osx_next
|
110
|
+
|
111
|
+
.osx_done:
|
112
|
+
|
113
|
+
mr r12, r3 /* r12 = target function */
|
114
|
+
mtctr r12 /* control register = target function */
|
115
|
+
mr r2, r4 /* r2 = reg data */
|
116
|
+
|
117
|
+
/* load 8 integer registers */
|
118
|
+
|
119
|
+
lwz r3 , 0(r2)
|
120
|
+
lwz r4 , 4(r2)
|
121
|
+
lwz r5 , 8(r2)
|
122
|
+
lwz r6 ,12(r2)
|
123
|
+
lwz r7 ,16(r2)
|
124
|
+
lwz r8 ,20(r2)
|
125
|
+
lwz r9 ,24(r2)
|
126
|
+
lwz r10,28(r2)
|
127
|
+
|
128
|
+
/* load 13 float registers */
|
129
|
+
|
130
|
+
lfd f1 ,32(r2)
|
131
|
+
lfd f2 ,40(r2)
|
132
|
+
lfd f3 ,48(r2)
|
133
|
+
lfd f4 ,56(r2)
|
134
|
+
lfd f5 ,64(r2)
|
135
|
+
lfd f6 ,72(r2)
|
136
|
+
lfd f7 ,80(r2)
|
137
|
+
lfd f8 ,88(r2)
|
138
|
+
lfd f9 ,96(r2)
|
139
|
+
lfd f10,104(r2)
|
140
|
+
lfd f11,112(r2)
|
141
|
+
lfd f12,120(r2)
|
142
|
+
lfd f13,128(r2)
|
143
|
+
|
144
|
+
/* branch */
|
145
|
+
|
146
|
+
bctrl
|
147
|
+
|
148
|
+
/* epilog */
|
149
|
+
|
150
|
+
lwz r1, 0(r1) /* restore stack */
|
151
|
+
lwz r0, 8(r1) /* r0 = return address */
|
152
|
+
mtlr r0 /* setup link register */
|
153
|
+
blr /* return */
|
154
|
+
|
155
|
+
/* ----------------------------------------------------------------------------
|
156
|
+
|
157
|
+
Call Kernel for ppc32 System
|
158
|
+
|
159
|
+
Input:
|
160
|
+
r3 : target address ptr
|
161
|
+
r4 : register data ptr (8 x GPR 32 bytes, 8 x FPR 64 bytes)
|
162
|
+
r5 : stack data size
|
163
|
+
r6 : stack data ptr
|
164
|
+
|
165
|
+
Details:
|
166
|
+
- Stack frames are always aligned on 16 byte
|
167
|
+
- Reserve GPR2 (System register)
|
168
|
+
- The GPR3 .. GPR10 are loaded
|
169
|
+
- The FPR1 .. FPR8 are loaded
|
170
|
+
- No support for Vector Parameters so far.
|
171
|
+
|
172
|
+
Frame structure:
|
173
|
+
|
174
|
+
on entry, parent frame layout:
|
175
|
+
|
176
|
+
offset
|
177
|
+
4: LR save word (Callee stores LR in parent frame)
|
178
|
+
0: parent stack frame (back-chain)
|
179
|
+
|
180
|
+
after frame initialization:
|
181
|
+
|
182
|
+
stack size = ( (8+15) + stacksize ) & -(16)
|
183
|
+
|
184
|
+
... locals and register spills
|
185
|
+
8: parameter list area
|
186
|
+
4: LR save word (Callee stores LR in parent frame)
|
187
|
+
0: parent stack frame (back-chain)
|
188
|
+
*/
|
189
|
+
|
190
|
+
.align 2
|
191
|
+
GLOBAL_C(dcCall_ppc32_sysv)
|
192
|
+
ENTRY_C(dcCall_ppc32_sysv)
|
193
|
+
mflr r0 /* r0 = return address */
|
194
|
+
stw r0,4(r1) /* store r0 to link-area */
|
195
|
+
|
196
|
+
/* compute aligned stack-size */
|
197
|
+
|
198
|
+
/* add link area (+8) and align to 16 byte (+15) */
|
199
|
+
|
200
|
+
/* r0 = stacksize + frame parameter(back-chain link, this callee's call return address) */
|
201
|
+
addi r0,r5,8+15 /* r0 = r5 + 8 + 15 */
|
202
|
+
rlwinm r0,r0,0,0,27 /* r0 = r0 and -15 */
|
203
|
+
neg r0,r0 /* r0 = -r0 */
|
204
|
+
stwux r1,r1,r0 /* store r1 and decrement */
|
205
|
+
|
206
|
+
/* copy stack data */
|
207
|
+
|
208
|
+
subi r6,r6,4 /* r6 = 4 bytes before source stack ptr */
|
209
|
+
|
210
|
+
/* 4 bytes before target stack parameter-block */
|
211
|
+
addi r7,r1,4 /* r7 = r1 + 8 offset - 4 displacement */
|
212
|
+
|
213
|
+
srwi r5,r5,2 /* r5 = size in words */
|
214
|
+
|
215
|
+
cmpi cr0,r5,0 /* if stacksize != 0 .. */
|
216
|
+
beq cr0,.sysv_done
|
217
|
+
|
218
|
+
mtctr r5 /* copy loop */
|
219
|
+
|
220
|
+
.sysv_next:
|
221
|
+
lwzu r0, 4(r6)
|
222
|
+
stwu r0, 4(r7)
|
223
|
+
bdnz .sysv_next
|
224
|
+
|
225
|
+
.sysv_done:
|
226
|
+
|
227
|
+
/* this call support using ctr branch register */
|
228
|
+
|
229
|
+
mr r12, r3 /* r12 = target function */
|
230
|
+
mtctr r12 /* control register = r12 */
|
231
|
+
mr r11, r4 /* r11 = reg data */
|
232
|
+
|
233
|
+
/* load 8 integer registers */
|
234
|
+
|
235
|
+
lwz r3 , 0(r11)
|
236
|
+
lwz r4 , 4(r11)
|
237
|
+
lwz r5 , 8(r11)
|
238
|
+
lwz r6 ,12(r11)
|
239
|
+
lwz r7 ,16(r11)
|
240
|
+
lwz r8 ,20(r11)
|
241
|
+
lwz r9 ,24(r11)
|
242
|
+
lwz r10,28(r11)
|
243
|
+
|
244
|
+
/* load 8 float registers */
|
245
|
+
|
246
|
+
lfd f1 ,32(r11)
|
247
|
+
lfd f2 ,40(r11)
|
248
|
+
lfd f3 ,48(r11)
|
249
|
+
lfd f4 ,56(r11)
|
250
|
+
lfd f5 ,64(r11)
|
251
|
+
lfd f6 ,72(r11)
|
252
|
+
lfd f7 ,80(r11)
|
253
|
+
lfd f8 ,88(r11)
|
254
|
+
|
255
|
+
creqv 6,6,6 /* used for ellipsis calls */
|
256
|
+
|
257
|
+
bctrl /* branch with this call support */
|
258
|
+
|
259
|
+
/* epilog */
|
260
|
+
|
261
|
+
lwz r1, 0(r1) /* restore stack */
|
262
|
+
lwz r0, 4(r1) /* r0 = return address */
|
263
|
+
mtlr r0 /* setup link register */
|
264
|
+
blr /* return */
|
265
|
+
|
266
|
+
|