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,45 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm_mips_o32.h
|
6
|
+
Description: mips "o32" ABI callvm 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_CALLVM_MIPS_O32_H
|
28
|
+
#define DYNCALL_CALLVM_MIPS_O32_H
|
29
|
+
|
30
|
+
#include "dyncall_call_mips_o32.h"
|
31
|
+
#include "dyncall_callvm.h"
|
32
|
+
#include "dyncall_vector.h"
|
33
|
+
|
34
|
+
typedef struct
|
35
|
+
{
|
36
|
+
DCCallVM mInterface;
|
37
|
+
int mArgCount;
|
38
|
+
DCRegData_mips_o32 mRegData;
|
39
|
+
DCVecHead mVecHead;
|
40
|
+
} DCCallVM_mips_o32;
|
41
|
+
|
42
|
+
DCCallVM* dcNewCallVM_mips_o32(DCsize size);
|
43
|
+
|
44
|
+
#endif /* DYNCALL_CALLVM_MIPS_O32_H */
|
45
|
+
|
@@ -0,0 +1,372 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm_ppc32.c
|
6
|
+
Description:
|
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
|
+
/*
|
28
|
+
|
29
|
+
dyncall callvm for ppc32 architectures
|
30
|
+
|
31
|
+
SUPPORTED CALLING CONVENTIONS
|
32
|
+
ppc32/osx
|
33
|
+
ppc32/linux (sysv abi)
|
34
|
+
|
35
|
+
REVISION
|
36
|
+
2007/12/11 initial support for Darwin ABI
|
37
|
+
2009/01/09 added System V ABI support
|
38
|
+
|
39
|
+
*/
|
40
|
+
|
41
|
+
#include "dyncall_callvm_ppc32.h"
|
42
|
+
#include "dyncall_call_ppc32.h"
|
43
|
+
#include "dyncall_alloc.h"
|
44
|
+
#include "dyncall_macros.h"
|
45
|
+
#include "dyncall_types.h"
|
46
|
+
#include "dyncall_utils.h"
|
47
|
+
|
48
|
+
/* Support for Mac OS X (Darwin) and Systen V ABI for Power PC 32-bit */
|
49
|
+
|
50
|
+
#if defined(DC__OS_Darwin)
|
51
|
+
#define DC__ABI_Darwin
|
52
|
+
#elif defined(DC__OS_Linux) || defined(DC__OS_FreeBSD) || defined(DC__OS_OpenBSD) || defined(DC__OS_NetBSD) || defined(DC__OS_DragonFlyBSD) || defined(DC__OS_SunOS)
|
53
|
+
#define DC__ABI_SysV
|
54
|
+
#else
|
55
|
+
#error Unsupported OS for ppc32 architecture.
|
56
|
+
#endif
|
57
|
+
|
58
|
+
static void dc_callvm_free_ppc32(DCCallVM* in_self)
|
59
|
+
{
|
60
|
+
dcFreeMem(in_self);
|
61
|
+
}
|
62
|
+
|
63
|
+
static void dc_callvm_reset_ppc32(DCCallVM* in_self)
|
64
|
+
{
|
65
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
66
|
+
dcVecReset(&self->mVecHead);
|
67
|
+
self->mIntRegs = 0;
|
68
|
+
self->mFloatRegs = 0;
|
69
|
+
}
|
70
|
+
|
71
|
+
/* OS X/Darwin: fillup integer register file AND push on stack (for ellipsis) */
|
72
|
+
|
73
|
+
static void dc_callvm_argInt_ppc32_darwin(DCCallVM* in_self, DCint i)
|
74
|
+
{
|
75
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
76
|
+
/* fillup integer register file */
|
77
|
+
if (self->mIntRegs < 8)
|
78
|
+
self->mRegData.mIntData[self->mIntRegs++] = i;
|
79
|
+
/* AND push onto stack */
|
80
|
+
dcVecAppend(&self->mVecHead,&i,sizeof(DCint));
|
81
|
+
}
|
82
|
+
|
83
|
+
static void dc_callvm_argInt_ppc32_sysv(DCCallVM* in_self, DCint i)
|
84
|
+
{
|
85
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
86
|
+
/* fillup integer register file */
|
87
|
+
if (self->mIntRegs < 8)
|
88
|
+
self->mRegData.mIntData[self->mIntRegs++] = i;
|
89
|
+
/* OR push onto stack */
|
90
|
+
else
|
91
|
+
dcVecAppend(&self->mVecHead,&i,sizeof(DCint));
|
92
|
+
}
|
93
|
+
|
94
|
+
/** floating-point **/
|
95
|
+
|
96
|
+
/* double*/
|
97
|
+
|
98
|
+
static void dc_callvm_argDouble_ppc32_darwin(DCCallVM* in_self, DCdouble d)
|
99
|
+
{
|
100
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
101
|
+
if (self->mFloatRegs < 13) {
|
102
|
+
self->mRegData.mFloatData[self->mFloatRegs++] = d;
|
103
|
+
/* skip two integer register file entries */
|
104
|
+
if (self->mIntRegs < 8)
|
105
|
+
self->mRegData.mIntData[self->mIntRegs++] = ( (DCint*) &d )[0];
|
106
|
+
if (self->mIntRegs < 8)
|
107
|
+
self->mRegData.mIntData[self->mIntRegs++] = ( (DCint*) &d )[1];
|
108
|
+
}
|
109
|
+
/* push on stack */
|
110
|
+
dcVecAppend(&self->mVecHead, &d, sizeof(DCdouble));
|
111
|
+
}
|
112
|
+
|
113
|
+
#if 0
|
114
|
+
static void dc_callvm_argDouble_ppc32_sysv(DCCallVM* in_self, DCdouble d)
|
115
|
+
{
|
116
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
117
|
+
if (self->mFloatRegs < 8) {
|
118
|
+
self->mRegData.mFloatData[self->mFloatRegs++] = d;
|
119
|
+
/* skip two integer register file entries */
|
120
|
+
if (self->mIntRegs < 8)
|
121
|
+
self->mRegData.mIntData[self->mIntRegs++] = ( (DCint*) &d )[0];
|
122
|
+
if (self->mIntRegs < 8)
|
123
|
+
self->mRegData.mIntData[self->mIntRegs++] = ( (DCint*) &d )[1];
|
124
|
+
}
|
125
|
+
/* push on stack */
|
126
|
+
dcVecAppend(&self->mVecHead, &d, sizeof(DCdouble));
|
127
|
+
}
|
128
|
+
#endif
|
129
|
+
static void dc_callvm_argDouble_ppc32_sysv(DCCallVM* in_self, DCdouble d)
|
130
|
+
{
|
131
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
132
|
+
if (self->mFloatRegs < 8)
|
133
|
+
self->mRegData.mFloatData[self->mFloatRegs++] = d;
|
134
|
+
else /* OR push data on stack */
|
135
|
+
{
|
136
|
+
/* align stack to 8 byte boundary */
|
137
|
+
dcVecResize(&self->mVecHead , ( dcVecSize(&self->mVecHead) + 7UL ) & -8UL );
|
138
|
+
/* AND push data */
|
139
|
+
dcVecAppend(&self->mVecHead,(DCpointer) &d,sizeof(DCdouble));
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
/* Floating-point */
|
144
|
+
|
145
|
+
|
146
|
+
/* darwin:
|
147
|
+
* - skip one integer register file entry (write in - for ellipsis calls)
|
148
|
+
* sysv:
|
149
|
+
* -
|
150
|
+
*/
|
151
|
+
|
152
|
+
static void dc_callvm_argFloat_ppc32_darwin(DCCallVM* in_self, DCfloat f)
|
153
|
+
{
|
154
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
155
|
+
if (self->mFloatRegs < 13) {
|
156
|
+
self->mRegData.mFloatData[self->mFloatRegs++] = (DCdouble) (f);
|
157
|
+
}
|
158
|
+
|
159
|
+
/* AND skip one integer register file entry (write in - for ellipsis calls) */
|
160
|
+
|
161
|
+
if (self->mIntRegs < 8)
|
162
|
+
self->mRegData.mIntData[self->mIntRegs++] = *( (DCint*) &f );
|
163
|
+
|
164
|
+
/* AND push on stack */
|
165
|
+
|
166
|
+
dcVecAppend(&self->mVecHead, &f, sizeof(DCfloat));
|
167
|
+
}
|
168
|
+
|
169
|
+
static void dc_callvm_argFloat_ppc32_sysv(DCCallVM* in_self, DCfloat f)
|
170
|
+
{
|
171
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
172
|
+
|
173
|
+
/* Put as float register (casted to double) */
|
174
|
+
|
175
|
+
if (self->mFloatRegs < 8)
|
176
|
+
self->mRegData.mFloatData[self->mFloatRegs++] = (DCdouble) (f);
|
177
|
+
|
178
|
+
else /* OR put float on stack */
|
179
|
+
dcVecAppend(&self->mVecHead, &f, sizeof(DCfloat));
|
180
|
+
}
|
181
|
+
|
182
|
+
/* long long integer */
|
183
|
+
|
184
|
+
static void dc_callvm_argLongLong_ppc32_darwin(DCCallVM* in_self, DClonglong L)
|
185
|
+
{
|
186
|
+
DCint* p = (DCint*) &L;
|
187
|
+
dcArgInt(in_self, p[0]);
|
188
|
+
dcArgInt(in_self, p[1]);
|
189
|
+
}
|
190
|
+
|
191
|
+
static void dc_callvm_argLongLong_ppc32_sysv(DCCallVM* in_self, DClonglong L)
|
192
|
+
{
|
193
|
+
DCint* p = (DCint*) &L;
|
194
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
195
|
+
/* fillup integer register file */
|
196
|
+
if (self->mIntRegs < 7)
|
197
|
+
{
|
198
|
+
/* next free integer register is even (r0, r2, r3) ? */
|
199
|
+
/* if not, skip one integer */
|
200
|
+
if (self->mIntRegs & 1) self->mIntRegs++;
|
201
|
+
|
202
|
+
self->mRegData.mIntData[self->mIntRegs++] = p[0];
|
203
|
+
self->mRegData.mIntData[self->mIntRegs++] = p[1];
|
204
|
+
}
|
205
|
+
/* OR push onto stack */
|
206
|
+
else
|
207
|
+
{
|
208
|
+
/* in case, mIntRegs == 7, set it to 8 */
|
209
|
+
self->mIntRegs = 8;
|
210
|
+
/* align stack to 8 byte boundary */
|
211
|
+
dcVecResize(&self->mVecHead , ( dcVecSize(&self->mVecHead) + 7 ) & (-8UL) );
|
212
|
+
/* push data */
|
213
|
+
dcVecAppend(&self->mVecHead,&L,sizeof(DClonglong));
|
214
|
+
}
|
215
|
+
}
|
216
|
+
|
217
|
+
|
218
|
+
static void dc_callvm_argBool_ppc32(DCCallVM* in_self, DCbool x)
|
219
|
+
{
|
220
|
+
/* promote to integer */
|
221
|
+
dcArgInt(in_self, (x == 0) ? DC_FALSE : DC_TRUE );
|
222
|
+
}
|
223
|
+
|
224
|
+
|
225
|
+
static void dc_callvm_argChar_ppc32(DCCallVM* in_self, DCchar ch)
|
226
|
+
{
|
227
|
+
/* promote to integer */
|
228
|
+
dcArgInt(in_self, (DCint) ch );
|
229
|
+
}
|
230
|
+
|
231
|
+
|
232
|
+
static void dc_callvm_argShort_ppc32(DCCallVM* in_self, DCshort s)
|
233
|
+
{
|
234
|
+
/* promote to integer */
|
235
|
+
dcArgInt(in_self, (DCint) s );
|
236
|
+
}
|
237
|
+
|
238
|
+
|
239
|
+
static void dc_callvm_argLong_ppc32(DCCallVM* in_self, DClong l)
|
240
|
+
{
|
241
|
+
/* promote to integer */
|
242
|
+
dcArgInt(in_self, (DCint) l );
|
243
|
+
}
|
244
|
+
|
245
|
+
static void dc_callvm_argPointer_ppc32(DCCallVM* in_self, DCpointer p)
|
246
|
+
{
|
247
|
+
/* promote to integer */
|
248
|
+
dcArgInt(in_self, *(DCint*) &p );
|
249
|
+
}
|
250
|
+
|
251
|
+
|
252
|
+
void dc_callvm_call_ppc32_darwin(DCCallVM* in_self, DCpointer target)
|
253
|
+
{
|
254
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)in_self;
|
255
|
+
dcCall_ppc32_darwin(
|
256
|
+
target,
|
257
|
+
&self->mRegData,
|
258
|
+
DC_MAX(dcVecSize(&self->mVecHead), 8*4),
|
259
|
+
dcVecData(&self->mVecHead)
|
260
|
+
);
|
261
|
+
}
|
262
|
+
|
263
|
+
void dc_callvm_call_ppc32_sysv(DCCallVM* in_self, DCpointer target)
|
264
|
+
{
|
265
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*) in_self;
|
266
|
+
dcCall_ppc32_sysv( target, &self->mRegData, dcVecSize(&self->mVecHead) , dcVecData(&self->mVecHead));
|
267
|
+
}
|
268
|
+
|
269
|
+
void dc_callvm_mode_ppc32(DCCallVM* in_self, DCint mode);
|
270
|
+
|
271
|
+
DCCallVM_vt gVT_ppc32_darwin =
|
272
|
+
{
|
273
|
+
&dc_callvm_free_ppc32
|
274
|
+
, &dc_callvm_reset_ppc32
|
275
|
+
, &dc_callvm_mode_ppc32
|
276
|
+
, &dc_callvm_argBool_ppc32
|
277
|
+
, &dc_callvm_argChar_ppc32
|
278
|
+
, &dc_callvm_argShort_ppc32
|
279
|
+
, &dc_callvm_argInt_ppc32_darwin
|
280
|
+
, &dc_callvm_argLong_ppc32
|
281
|
+
, &dc_callvm_argLongLong_ppc32_darwin
|
282
|
+
, &dc_callvm_argFloat_ppc32_darwin
|
283
|
+
, &dc_callvm_argDouble_ppc32_darwin
|
284
|
+
, &dc_callvm_argPointer_ppc32
|
285
|
+
, NULL /* argStruct */
|
286
|
+
, (DCvoidvmfunc*) &dc_callvm_call_ppc32_darwin
|
287
|
+
, (DCboolvmfunc*) &dc_callvm_call_ppc32_darwin
|
288
|
+
, (DCcharvmfunc*) &dc_callvm_call_ppc32_darwin
|
289
|
+
, (DCshortvmfunc*) &dc_callvm_call_ppc32_darwin
|
290
|
+
, (DCintvmfunc*) &dc_callvm_call_ppc32_darwin
|
291
|
+
, (DClongvmfunc*) &dc_callvm_call_ppc32_darwin
|
292
|
+
, (DClonglongvmfunc*) &dc_callvm_call_ppc32_darwin
|
293
|
+
, (DCfloatvmfunc*) &dc_callvm_call_ppc32_darwin
|
294
|
+
, (DCdoublevmfunc*) &dc_callvm_call_ppc32_darwin
|
295
|
+
, (DCpointervmfunc*) &dc_callvm_call_ppc32_darwin
|
296
|
+
, NULL /* callStruct */
|
297
|
+
};
|
298
|
+
|
299
|
+
DCCallVM_vt gVT_ppc32_sysv =
|
300
|
+
{
|
301
|
+
&dc_callvm_free_ppc32
|
302
|
+
, &dc_callvm_reset_ppc32
|
303
|
+
, &dc_callvm_mode_ppc32
|
304
|
+
, &dc_callvm_argBool_ppc32
|
305
|
+
, &dc_callvm_argChar_ppc32
|
306
|
+
, &dc_callvm_argShort_ppc32
|
307
|
+
, &dc_callvm_argInt_ppc32_sysv
|
308
|
+
, &dc_callvm_argLong_ppc32
|
309
|
+
, &dc_callvm_argLongLong_ppc32_sysv
|
310
|
+
, &dc_callvm_argFloat_ppc32_sysv
|
311
|
+
, &dc_callvm_argDouble_ppc32_sysv
|
312
|
+
, &dc_callvm_argPointer_ppc32
|
313
|
+
, NULL /* argStruct */
|
314
|
+
, (DCvoidvmfunc*) &dc_callvm_call_ppc32_sysv
|
315
|
+
, (DCboolvmfunc*) &dc_callvm_call_ppc32_sysv
|
316
|
+
, (DCcharvmfunc*) &dc_callvm_call_ppc32_sysv
|
317
|
+
, (DCshortvmfunc*) &dc_callvm_call_ppc32_sysv
|
318
|
+
, (DCintvmfunc*) &dc_callvm_call_ppc32_sysv
|
319
|
+
, (DClongvmfunc*) &dc_callvm_call_ppc32_sysv
|
320
|
+
, (DClonglongvmfunc*) &dc_callvm_call_ppc32_sysv
|
321
|
+
, (DCfloatvmfunc*) &dc_callvm_call_ppc32_sysv
|
322
|
+
, (DCdoublevmfunc*) &dc_callvm_call_ppc32_sysv
|
323
|
+
, (DCpointervmfunc*) &dc_callvm_call_ppc32_sysv
|
324
|
+
, NULL /* callStruct */
|
325
|
+
};
|
326
|
+
|
327
|
+
void dc_callvm_mode_ppc32(DCCallVM* in_self, DCint mode)
|
328
|
+
{
|
329
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*) in_self;
|
330
|
+
DCCallVM_vt* vt;
|
331
|
+
switch(mode) {
|
332
|
+
|
333
|
+
case DC_CALL_C_PPC32_OSX:
|
334
|
+
|
335
|
+
#if defined(DC__ABI_Darwin)
|
336
|
+
case DC_CALL_C_DEFAULT:
|
337
|
+
case DC_CALL_C_ELLIPSIS:
|
338
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
339
|
+
#endif
|
340
|
+
|
341
|
+
vt = &gVT_ppc32_darwin;
|
342
|
+
break;
|
343
|
+
|
344
|
+
case DC_CALL_C_PPC32_SYSV:
|
345
|
+
|
346
|
+
#if defined(DC__ABI_SysV)
|
347
|
+
case DC_CALL_C_DEFAULT:
|
348
|
+
case DC_CALL_C_ELLIPSIS:
|
349
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
350
|
+
#endif
|
351
|
+
|
352
|
+
vt = &gVT_ppc32_sysv;
|
353
|
+
break;
|
354
|
+
|
355
|
+
default:
|
356
|
+
self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE;
|
357
|
+
return;
|
358
|
+
}
|
359
|
+
|
360
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
361
|
+
}
|
362
|
+
|
363
|
+
DCCallVM* dcNewCallVM(DCsize size)
|
364
|
+
{
|
365
|
+
DCCallVM_ppc32* self = (DCCallVM_ppc32*)dcAllocMem(sizeof(DCCallVM_ppc32)+size);
|
366
|
+
dcVecInit(&self->mVecHead, size);
|
367
|
+
self->mIntRegs = 0;
|
368
|
+
self->mFloatRegs = 0;
|
369
|
+
dc_callvm_mode_ppc32( (DCCallVM*) self, DC_CALL_C_DEFAULT );
|
370
|
+
return (DCCallVM*)self;
|
371
|
+
}
|
372
|
+
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm_ppc32.h
|
6
|
+
Description:
|
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_CALLVM_PPC32_H
|
28
|
+
#define DYNCALL_CALLVM_PPC32_H
|
29
|
+
|
30
|
+
/*
|
31
|
+
|
32
|
+
dyncall callvm for 32bit ppc architectures
|
33
|
+
|
34
|
+
SUPPORTED CALLING CONVENTIONS
|
35
|
+
standard and ... (ellipsis) calls
|
36
|
+
|
37
|
+
REVISION
|
38
|
+
2007/12/11 initial
|
39
|
+
|
40
|
+
*/
|
41
|
+
|
42
|
+
|
43
|
+
#include "dyncall_call_ppc32.h"
|
44
|
+
#include "dyncall_callvm.h"
|
45
|
+
#include "dyncall_vector.h"
|
46
|
+
|
47
|
+
typedef struct DCCallVM_ppc32_ DCCallVM_ppc32;
|
48
|
+
|
49
|
+
struct DCCallVM_ppc32_
|
50
|
+
{
|
51
|
+
DCCallVM mInterface;
|
52
|
+
int mIntRegs;
|
53
|
+
int mFloatRegs;
|
54
|
+
struct DCRegData_ppc32_ mRegData;
|
55
|
+
DCVecHead mVecHead;
|
56
|
+
};
|
57
|
+
|
58
|
+
DCCallVM* dcNewCallVM_ppc32(DCsize size);
|
59
|
+
|
60
|
+
#endif /* DYNCALL_CALLVM_PPC32_H */
|
61
|
+
|