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,167 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_api.c
|
6
|
+
Description: C interface to call vm
|
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 "dyncall.h"
|
28
|
+
#include "dyncall_callvm.h"
|
29
|
+
#include "dyncall_alloc.h"
|
30
|
+
|
31
|
+
void dcReset(DCCallVM* vm)
|
32
|
+
{
|
33
|
+
vm->mVTpointer->reset(vm);
|
34
|
+
}
|
35
|
+
|
36
|
+
void dcFree(DCCallVM* vm)
|
37
|
+
{
|
38
|
+
vm->mVTpointer->free(vm);
|
39
|
+
}
|
40
|
+
|
41
|
+
void dcMode(DCCallVM* vm,DCint mode)
|
42
|
+
{
|
43
|
+
vm->mVTpointer->mode(vm,mode);
|
44
|
+
/* dcReset(vm); -- in order to support ellipsis calls, we need to allow
|
45
|
+
* a dcMode(callvm, DC_CALL_C_ELLIPSIS_VARARGS) */
|
46
|
+
}
|
47
|
+
|
48
|
+
void dcArgBool(DCCallVM* vm,DCbool x)
|
49
|
+
{
|
50
|
+
vm->mVTpointer->argBool(vm, x);
|
51
|
+
}
|
52
|
+
|
53
|
+
void dcArgChar(DCCallVM* vm,DCchar x)
|
54
|
+
{
|
55
|
+
vm->mVTpointer->argChar(vm, x);
|
56
|
+
}
|
57
|
+
|
58
|
+
void dcArgShort(DCCallVM* vm,DCshort x)
|
59
|
+
{
|
60
|
+
vm->mVTpointer->argShort(vm, x);
|
61
|
+
}
|
62
|
+
|
63
|
+
void dcArgInt(DCCallVM* vm,DCint x)
|
64
|
+
{
|
65
|
+
vm->mVTpointer->argInt(vm, x);
|
66
|
+
}
|
67
|
+
|
68
|
+
void dcArgLong(DCCallVM* vm,DClong x)
|
69
|
+
{
|
70
|
+
vm->mVTpointer->argLong(vm, x);
|
71
|
+
}
|
72
|
+
|
73
|
+
void dcArgLongLong(DCCallVM* vm, DClonglong x)
|
74
|
+
{
|
75
|
+
vm->mVTpointer->argLongLong(vm, x);
|
76
|
+
}
|
77
|
+
|
78
|
+
void dcArgFloat(DCCallVM* vm, DCfloat x)
|
79
|
+
{
|
80
|
+
vm->mVTpointer->argFloat(vm, x);
|
81
|
+
}
|
82
|
+
|
83
|
+
void dcArgDouble(DCCallVM* vm, DCdouble x)
|
84
|
+
{
|
85
|
+
vm->mVTpointer->argDouble(vm, x);
|
86
|
+
}
|
87
|
+
|
88
|
+
void dcArgPointer(DCCallVM* vm, DCpointer x)
|
89
|
+
{
|
90
|
+
vm->mVTpointer->argPointer(vm, x);
|
91
|
+
}
|
92
|
+
|
93
|
+
void dcArgStruct(DCCallVM* vm, DCstruct* s, DCpointer x)
|
94
|
+
{
|
95
|
+
vm->mVTpointer->argStruct(vm, s, x);
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
void dcCallVoid(DCCallVM* vm, DCpointer funcptr)
|
100
|
+
{
|
101
|
+
vm->mVTpointer->callVoid(vm, funcptr);
|
102
|
+
}
|
103
|
+
|
104
|
+
DCchar dcCallChar(DCCallVM* vm, DCpointer funcptr)
|
105
|
+
{
|
106
|
+
return vm->mVTpointer->callChar(vm, funcptr);
|
107
|
+
}
|
108
|
+
|
109
|
+
DCbool dcCallBool(DCCallVM* vm, DCpointer funcptr)
|
110
|
+
{
|
111
|
+
return vm->mVTpointer->callBool(vm, funcptr);
|
112
|
+
}
|
113
|
+
|
114
|
+
DCshort dcCallShort(DCCallVM* vm, DCpointer funcptr)
|
115
|
+
{
|
116
|
+
return vm->mVTpointer->callShort(vm, funcptr);
|
117
|
+
}
|
118
|
+
|
119
|
+
DCint dcCallInt(DCCallVM* vm, DCpointer funcptr)
|
120
|
+
{
|
121
|
+
return vm->mVTpointer->callInt(vm, funcptr);
|
122
|
+
}
|
123
|
+
|
124
|
+
DClong dcCallLong(DCCallVM* vm, DCpointer funcptr)
|
125
|
+
{
|
126
|
+
return vm->mVTpointer->callLong(vm, funcptr);
|
127
|
+
}
|
128
|
+
|
129
|
+
DClonglong dcCallLongLong(DCCallVM* vm, DCpointer funcptr)
|
130
|
+
{
|
131
|
+
return vm->mVTpointer->callLongLong(vm, funcptr);
|
132
|
+
}
|
133
|
+
|
134
|
+
DCfloat dcCallFloat(DCCallVM* vm, DCpointer funcptr)
|
135
|
+
{
|
136
|
+
return vm->mVTpointer->callFloat(vm, funcptr);
|
137
|
+
}
|
138
|
+
|
139
|
+
DCdouble dcCallDouble(DCCallVM* vm, DCpointer funcptr)
|
140
|
+
{
|
141
|
+
return vm->mVTpointer->callDouble(vm, funcptr);
|
142
|
+
}
|
143
|
+
|
144
|
+
DCpointer dcCallPointer(DCCallVM* vm, DCpointer funcptr)
|
145
|
+
{
|
146
|
+
return vm->mVTpointer->callPointer(vm, funcptr);
|
147
|
+
}
|
148
|
+
|
149
|
+
void dcCallStruct(DCCallVM* vm, DCpointer funcptr, DCstruct* s, DCpointer x)
|
150
|
+
{
|
151
|
+
vm->mVTpointer->callStruct(vm, funcptr, s, x);
|
152
|
+
}
|
153
|
+
|
154
|
+
DCint dcGetError(DCCallVM *vm)
|
155
|
+
{
|
156
|
+
return vm->mError;
|
157
|
+
}
|
158
|
+
|
159
|
+
const char* dcGetErrorString(int mode)
|
160
|
+
{
|
161
|
+
switch(mode) {
|
162
|
+
case DC_ERROR_NONE: return "none";
|
163
|
+
case DC_ERROR_UNSUPPORTED_MODE: return "unsupported mode";
|
164
|
+
default: return "(unknown mode id)";
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call.S
|
6
|
+
Description: assembly call kernel, auto-selected by gcc / Plan9 build system
|
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
|
+
#include "dyncall_macros.h"
|
27
|
+
/* Plan9 */
|
28
|
+
#if defined(DC__OS_Plan9)
|
29
|
+
# if defined(DC__Arch_Intel_x86)
|
30
|
+
# include "dyncall_call_x86_8a.s"
|
31
|
+
# else
|
32
|
+
# error Unsupported Architecture on Plan9.
|
33
|
+
# endif
|
34
|
+
#elif defined(DC__C_MSVC)
|
35
|
+
# if defined(DC__OS_Win32)
|
36
|
+
# include "dyncall_call_x86_generic_masm.asm"
|
37
|
+
# elif defined(DC__OS_Win64)
|
38
|
+
# include "dyncall_call_x64_generic_masm.asm"
|
39
|
+
# endif
|
40
|
+
#else
|
41
|
+
# if defined(DC__Arch_Intel_x86)
|
42
|
+
# include "dyncall_call_x86.S"
|
43
|
+
# elif defined(DC__Arch_AMD64)
|
44
|
+
# include "dyncall_call_x64-att.S"
|
45
|
+
# elif defined(DC__Arch_ARM_ARM)
|
46
|
+
# if defined(DC__ABI_ARM_HF)
|
47
|
+
# include "dyncall_call_arm32_arm_armhf.S"
|
48
|
+
# else
|
49
|
+
# include "dyncall_call_arm32_arm.S"
|
50
|
+
# endif
|
51
|
+
# elif defined(DC__Arch_ARM_THUMB)
|
52
|
+
# if defined(DC__OS_Darwin)
|
53
|
+
# include "dyncall_call_arm32_thumb_apple.s"
|
54
|
+
# else
|
55
|
+
# if defined(DC__ABI_ARM_HF)
|
56
|
+
# include "dyncall_call_arm32_thumb_armhf.S"
|
57
|
+
# else
|
58
|
+
# include "dyncall_call_arm32_thumb_gas.s"
|
59
|
+
# endif
|
60
|
+
# endif
|
61
|
+
# elif defined(DC__Arch_PowerPC)
|
62
|
+
# include "dyncall_call_ppc32.S"
|
63
|
+
# elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
|
64
|
+
# include "dyncall_call_mips_gas.S"
|
65
|
+
# elif defined(DC__Arch_Sparcv9)
|
66
|
+
# include "dyncall_call_sparc_v9.S"
|
67
|
+
# elif defined(DC__Arch_Sparc)
|
68
|
+
# include "dyncall_call_sparc.S"
|
69
|
+
# else
|
70
|
+
# error Unsupported Architecture.
|
71
|
+
# endif
|
72
|
+
#endif
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_arm32_arm.S
|
6
|
+
Description: Call Kernel for ARM 32-bit ARM 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-arm.S"
|
28
|
+
|
29
|
+
/* ============================================================================
|
30
|
+
DynCall Call Kernel for ARM 32-bit ARM Architecture
|
31
|
+
----------------------------------------------------------------------------
|
32
|
+
C Interface:
|
33
|
+
dcCall_arm32_arm(DCpointer target, DCpointer argv, DCsize size);
|
34
|
+
|
35
|
+
This Call Kernel works across multiple OS.
|
36
|
+
It has been tested on Nintendo DS, Linux and Darwin(iOS).
|
37
|
+
|
38
|
+
*/
|
39
|
+
|
40
|
+
.text
|
41
|
+
.code 32 /* ARM mode */
|
42
|
+
.align 4
|
43
|
+
GLOBAL_C(dcCall_arm32_arm)
|
44
|
+
ENTRY_C(dcCall_arm32_arm)
|
45
|
+
/* Prolog. This function never needs to spill inside its prolog, so just store the permanent registers. */
|
46
|
+
mov r12, r13 /* Stack ptr (r13) -> temporary (r12). */
|
47
|
+
stmdb r13!, {r4-r12, r14} /* Permanent registers and stack pointer (now in r12), etc... -> save area on stack (except counter). */
|
48
|
+
mov r11, r12 /* Set frame ptr. */
|
49
|
+
|
50
|
+
/* Call. */
|
51
|
+
mov r4, r0 /* r4 = 'fptr' (1st argument is passed in r0). */
|
52
|
+
mov r5, r1 /* r5 = 'args' (2nd argument is passed in r1). */
|
53
|
+
mov r6, r2 /* r6 = 'size' (3rd argument is passed in r2). */
|
54
|
+
ldmia r5!, {r0-r3} /* Load first 4 arguments for new call into r0-r3. */
|
55
|
+
|
56
|
+
subs r6, r6, #16 /* Size of remaining arguments. */
|
57
|
+
ble call /* Jump to call if no more arguments. */
|
58
|
+
|
59
|
+
sub r13, r13, r6 /* Set stack pointer to top of stack. */
|
60
|
+
and r9, r6, #7 /* Align stack on 8 byte boundaries. */
|
61
|
+
sub r13, r13, r9
|
62
|
+
|
63
|
+
mov r8, r13 /* Temp. destination pointer. */
|
64
|
+
mov r9, #0 /* Init byte counter. */
|
65
|
+
|
66
|
+
pushArgs:
|
67
|
+
ldrb r7, [r5, r9] /* Load a byte into r7. */
|
68
|
+
strb r7, [r8, r9] /* Push byte onto stack. */
|
69
|
+
add r9, r9, #1 /* Increment byte counter. */
|
70
|
+
cmp r9, r6
|
71
|
+
bne pushArgs
|
72
|
+
|
73
|
+
call:
|
74
|
+
/* 'blx %r4' workaround for ARMv4t: */
|
75
|
+
mov r14, r15 /* Branch return address(r15) -> link register (r14) -- r15 always points to address of current + 2 instructions (= Epilog code). */
|
76
|
+
bx r4 /* Call (ARM/THUMB), available for ARMv4t. */
|
77
|
+
|
78
|
+
/* Epilog. */
|
79
|
+
ldmdb r11, {r4-r11, r13, r15} /* Restore permanent registers (ignore temporary (r12), restore stack ptr and program counter).@@@db not needed since we rewrite r13? */
|
80
|
+
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_arm32_arm.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
|
+
/*
|
28
|
+
|
29
|
+
dyncall 32bit ARM32 family interface (ARM mode)
|
30
|
+
|
31
|
+
REVISION
|
32
|
+
2007/12/11 initial
|
33
|
+
|
34
|
+
*/
|
35
|
+
|
36
|
+
|
37
|
+
#ifndef DYNCALL_CALL_ARM32_ARM_H
|
38
|
+
#define DYNCALL_CALL_ARM32_ARM_H
|
39
|
+
|
40
|
+
|
41
|
+
#include "dyncall_types.h"
|
42
|
+
|
43
|
+
#ifdef __cplusplus
|
44
|
+
extern "C" {
|
45
|
+
#endif
|
46
|
+
|
47
|
+
/*
|
48
|
+
** arm32 arm mode calling convention calls
|
49
|
+
**
|
50
|
+
** - hybrid return-type call (bool ... pointer)
|
51
|
+
**
|
52
|
+
*/
|
53
|
+
|
54
|
+
void dcCall_arm32_arm(DCpointer target, DCpointer stackdata, DCsize size);
|
55
|
+
|
56
|
+
#ifdef __cplusplus
|
57
|
+
}
|
58
|
+
#endif
|
59
|
+
|
60
|
+
|
61
|
+
#endif /* DYNCALL_CALL_ARM32_ARM_H */
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_arm32_arm_armhf.S
|
6
|
+
Description: Call Kernel for ARM 32-bit ARM Architecture - Hard Float
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2012 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-arm.S"
|
28
|
+
|
29
|
+
/* ============================================================================
|
30
|
+
DynCall Call Kernel for ARM 32-bit ARM Architecture Hard-Float
|
31
|
+
----------------------------------------------------------------------------
|
32
|
+
C Interface:
|
33
|
+
dcCall_arm32_armhf (DCpointer target, DCpointer argv, DCsize size, DCfloat* regdata);
|
34
|
+
|
35
|
+
This Call Kernel was tested on Raspberry Pi/Raspbian (Debian)
|
36
|
+
*/
|
37
|
+
|
38
|
+
.text
|
39
|
+
.code 32 /* ARM mode */
|
40
|
+
.arch armv6
|
41
|
+
.fpu vfp
|
42
|
+
|
43
|
+
GLOBAL_C(dcCall_arm32_armhf)
|
44
|
+
ENTRY_C(dcCall_arm32_armhf)
|
45
|
+
|
46
|
+
/* Prolog. This function never needs to spill inside its prolog, so just store the permanent registers. */
|
47
|
+
mov r12 , r13 /* Stack ptr (r13) -> temporary (r12). */
|
48
|
+
stmdb r13!, {r4-r5, r11, r12, r14} /* Permanent registers and stack pointer (now in r12), etc... -> save area on stack (except counter). */
|
49
|
+
|
50
|
+
mov r11 , r12 /* Set frame ptr. */
|
51
|
+
mov r4 , r0 /* r4 = 'fptr' (1st argument is passed in r0). */
|
52
|
+
mov r5 , r1 /* r5 = 'args' (2nd argument is passed in r1). */
|
53
|
+
|
54
|
+
/* Load 16 single-precision registers (= 8 double-precision registers). */
|
55
|
+
flds s0, [r3,#0 ]
|
56
|
+
flds s1, [r3,#4 ]
|
57
|
+
flds s2, [r3,#8 ]
|
58
|
+
flds s3, [r3,#12]
|
59
|
+
flds s4, [r3,#16]
|
60
|
+
flds s5, [r3,#20]
|
61
|
+
flds s6, [r3,#24]
|
62
|
+
flds s7, [r3,#28]
|
63
|
+
flds s8, [r3,#32]
|
64
|
+
flds s9, [r3,#36]
|
65
|
+
flds s10, [r3,#40]
|
66
|
+
flds s11, [r3,#44]
|
67
|
+
flds s12, [r3,#48]
|
68
|
+
flds s13, [r3,#52]
|
69
|
+
flds s14, [r3,#56]
|
70
|
+
flds s15, [r3,#60]
|
71
|
+
|
72
|
+
sub r2 , r2 , #16
|
73
|
+
cmp r2, #0
|
74
|
+
ble armhf_call
|
75
|
+
|
76
|
+
sub r13, r13, r2
|
77
|
+
and r13, r13, #-8 /* align 8-byte. */
|
78
|
+
|
79
|
+
mov r3, #0 /* Init byte counter. */
|
80
|
+
add r1 , r1 , #16
|
81
|
+
armhf_pushArgs:
|
82
|
+
ldr r0, [r1, +r3] /* Load word into r0. */
|
83
|
+
str r0, [r13, +r3] /* Push word onto stack. */
|
84
|
+
add r3, r3, #4 /* Increment byte counter. */
|
85
|
+
cmp r2, r3
|
86
|
+
bne armhf_pushArgs
|
87
|
+
|
88
|
+
armhf_call:
|
89
|
+
ldmia r5, {r0-r3} /* Load first 4 arguments for new call into r0-r3. */
|
90
|
+
/* 'blx %r4' workaround for ARMv4t: */
|
91
|
+
mov r14, r15 /* Branch return address(r15) -> link register (r14) -- r15 always points to address of current + 2 instructions (= Epilog code). */
|
92
|
+
bx r4 /* Call (ARM/THUMB), available for ARMv4t. */
|
93
|
+
|
94
|
+
/* Epilog. */
|
95
|
+
ldmdb r11, {r4-r5, r11, r13, r15} /* Restore permanent registers (ignore temporary (r12), restore stack ptr and program counter).@@@db not needed since we rewrite r13? */
|
96
|
+
|