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,112 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callf.c
|
6
|
+
Description: formatted call C interface (extension module)
|
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_callf.h"
|
28
|
+
|
29
|
+
void dcVCallF(DCCallVM* vm, DCValue* result, DCpointer funcptr, const DCsigchar* signature, va_list args)
|
30
|
+
{
|
31
|
+
const DCsigchar* ptr = signature;
|
32
|
+
DCsigchar ch;
|
33
|
+
dcReset(vm);
|
34
|
+
while ( (ch=*ptr++) != '\0' && ch != DC_SIGCHAR_ENDARG) {
|
35
|
+
|
36
|
+
switch(ch) {
|
37
|
+
case DC_SIGCHAR_BOOL:
|
38
|
+
dcArgBool (vm, (DCbool) va_arg( args, DCint ) );
|
39
|
+
break;
|
40
|
+
case DC_SIGCHAR_CHAR:
|
41
|
+
dcArgChar (vm, (DCchar) va_arg( args, DCint ) );
|
42
|
+
break;
|
43
|
+
case DC_SIGCHAR_UCHAR:
|
44
|
+
dcArgChar (vm, (DCchar) (DCuchar) va_arg( args, DCint ) );
|
45
|
+
break;
|
46
|
+
case DC_SIGCHAR_SHORT:
|
47
|
+
dcArgShort (vm, (DCshort) va_arg( args, DCint ) );
|
48
|
+
break;
|
49
|
+
case DC_SIGCHAR_USHORT:
|
50
|
+
dcArgShort (vm, (DCshort) (DCushort) va_arg( args, DCint ) );
|
51
|
+
break;
|
52
|
+
case DC_SIGCHAR_INT:
|
53
|
+
dcArgInt (vm, (DCint) va_arg( args, DCint ) );
|
54
|
+
break;
|
55
|
+
case DC_SIGCHAR_UINT:
|
56
|
+
dcArgInt (vm, (DCint) (DCuint) va_arg( args, DCint ) );
|
57
|
+
break;
|
58
|
+
case DC_SIGCHAR_LONG:
|
59
|
+
dcArgLong (vm, (DClong) va_arg( args, DClong ) );
|
60
|
+
break;
|
61
|
+
case DC_SIGCHAR_ULONG:
|
62
|
+
dcArgLong (vm, (DCulong) va_arg( args, DClong ) );
|
63
|
+
break;
|
64
|
+
case DC_SIGCHAR_LONGLONG:
|
65
|
+
dcArgLongLong (vm, (DClonglong) va_arg( args, DClonglong ) );
|
66
|
+
break;
|
67
|
+
case DC_SIGCHAR_ULONGLONG:
|
68
|
+
dcArgLongLong (vm, (DCulonglong) va_arg( args, DClonglong ) );
|
69
|
+
break;
|
70
|
+
case DC_SIGCHAR_FLOAT:
|
71
|
+
dcArgFloat (vm, (DCfloat) va_arg( args, DCdouble ) );
|
72
|
+
break;
|
73
|
+
case DC_SIGCHAR_DOUBLE:
|
74
|
+
dcArgDouble (vm, (DCdouble) va_arg( args, DCdouble ) );
|
75
|
+
break;
|
76
|
+
case DC_SIGCHAR_POINTER:
|
77
|
+
dcArgPointer (vm, (DCpointer) va_arg( args, DCpointer ) );
|
78
|
+
break;
|
79
|
+
case DC_SIGCHAR_STRING:
|
80
|
+
dcArgPointer (vm, (DCpointer) va_arg( args, DCpointer ) );
|
81
|
+
break;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
switch(*ptr) {
|
86
|
+
case DC_SIGCHAR_VOID: dcCallVoid (vm,funcptr); break;
|
87
|
+
case DC_SIGCHAR_BOOL: result->B = dcCallBool (vm,funcptr); break;
|
88
|
+
case DC_SIGCHAR_CHAR: result->c = dcCallChar (vm,funcptr); break;
|
89
|
+
case DC_SIGCHAR_UCHAR: result->C = (DCuchar) dcCallChar (vm,funcptr); break;
|
90
|
+
case DC_SIGCHAR_SHORT: result->s = dcCallShort (vm,funcptr); break;
|
91
|
+
case DC_SIGCHAR_USHORT: result->S = dcCallShort (vm,funcptr); break;
|
92
|
+
case DC_SIGCHAR_INT: result->i = dcCallInt (vm,funcptr); break;
|
93
|
+
case DC_SIGCHAR_UINT: result->I = dcCallInt (vm,funcptr); break;
|
94
|
+
case DC_SIGCHAR_LONG: result->j = dcCallLong (vm,funcptr); break;
|
95
|
+
case DC_SIGCHAR_ULONG: result->J = dcCallLong (vm,funcptr); break;
|
96
|
+
case DC_SIGCHAR_LONGLONG: result->l = dcCallLongLong (vm,funcptr); break;
|
97
|
+
case DC_SIGCHAR_ULONGLONG: result->L = dcCallLongLong (vm,funcptr); break;
|
98
|
+
case DC_SIGCHAR_FLOAT: result->f = dcCallFloat (vm,funcptr); break;
|
99
|
+
case DC_SIGCHAR_DOUBLE: result->d = dcCallDouble (vm,funcptr); break;
|
100
|
+
case DC_SIGCHAR_POINTER: result->p = dcCallPointer (vm,funcptr); break;
|
101
|
+
case DC_SIGCHAR_STRING: result->Z = dcCallPointer (vm,funcptr); break;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
void dcCallF(DCCallVM* vm, DCValue* result, DCpointer funcptr, const DCsigchar* signature, ...)
|
106
|
+
{
|
107
|
+
va_list va;
|
108
|
+
va_start(va, signature);
|
109
|
+
dcVCallF(vm,result,funcptr,signature,va);
|
110
|
+
va_end(va);
|
111
|
+
}
|
112
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callf.h
|
6
|
+
Description: formatted call interface to dyncall
|
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 formatted calls C API
|
30
|
+
|
31
|
+
REVISION
|
32
|
+
2007/12/11 initial
|
33
|
+
|
34
|
+
*/
|
35
|
+
|
36
|
+
|
37
|
+
#ifndef DYNCALL_CALLF_H
|
38
|
+
#define DYNCALL_CALLF_H
|
39
|
+
|
40
|
+
/* dyncall formatted calls */
|
41
|
+
|
42
|
+
#include "dyncall.h"
|
43
|
+
#include "dyncall_signature.h"
|
44
|
+
#include "dyncall_value.h"
|
45
|
+
|
46
|
+
#include <stdarg.h>
|
47
|
+
|
48
|
+
void dcCallF (DCCallVM* vm, DCValue* result, DCpointer funcptr, const DCsigchar* signature, ...);
|
49
|
+
void dcVCallF(DCCallVM* vm, DCValue* result, DCpointer funcptr, const DCsigchar* signature, va_list args);
|
50
|
+
|
51
|
+
#endif /* DYNCALL_CALLF_H */
|
52
|
+
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm.c
|
6
|
+
Description: auto-select default callvm (includes other C sources).
|
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_macros.h"
|
28
|
+
|
29
|
+
#if defined(DC__Arch_Intel_x86)
|
30
|
+
# include "dyncall_callvm_x86.c"
|
31
|
+
#elif defined(DC__Arch_AMD64)
|
32
|
+
# include "dyncall_callvm_x64.c"
|
33
|
+
#elif defined(DC__Arch_PowerPC)
|
34
|
+
# include "dyncall_callvm_ppc32.c"
|
35
|
+
#elif defined(DC__Arch_PPC64)
|
36
|
+
# include "dyncall_callvm_ppc64.c"
|
37
|
+
#elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
|
38
|
+
# if defined(DC__ABI_MIPS_EABI)
|
39
|
+
# include "dyncall_callvm_mips_eabi.c"
|
40
|
+
# elif defined(DC__ABI_MIPS_O32)
|
41
|
+
# include "dyncall_callvm_mips_o32.c"
|
42
|
+
# elif defined(DC__ABI_MIPS_N64)
|
43
|
+
# include "dyncall_callvm_mips_n64.c"
|
44
|
+
# elif defined(DC__ABI_MIPS_N32)
|
45
|
+
# include "dyncall_callvm_mips_n32.c"
|
46
|
+
# else
|
47
|
+
# error Unknown MIPS ABI.
|
48
|
+
# endif /* DC__Arch_MIPS || DC__Arch_MIPS64 */
|
49
|
+
#elif defined(DC__Arch_ARM_ARM)
|
50
|
+
# if defined(DC__ABI_ARM_HF)
|
51
|
+
# include "dyncall_callvm_arm32_arm_armhf.c"
|
52
|
+
# else
|
53
|
+
# include "dyncall_callvm_arm32_arm.c"
|
54
|
+
# endif
|
55
|
+
#elif defined(DC__Arch_ARM_THUMB)
|
56
|
+
# if defined(DC__ABI_ARM_HF)
|
57
|
+
# include "dyncall_callvm_arm32_arm_armhf.c"
|
58
|
+
# else
|
59
|
+
# include "dyncall_callvm_arm32_thumb.c"
|
60
|
+
# endif
|
61
|
+
#elif defined(DC__Arch_Sparc)
|
62
|
+
# include "dyncall_callvm_sparc.c"
|
63
|
+
#elif defined(DC__Arch_Sparcv9)
|
64
|
+
# include "dyncall_callvm_sparc_v9.c"
|
65
|
+
#else
|
66
|
+
# error unsupported platform
|
67
|
+
#endif
|
68
|
+
|
@@ -0,0 +1,88 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm.h
|
6
|
+
Description: Common call vm binary 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_H
|
28
|
+
#define DYNCALL_CALLVM_H
|
29
|
+
|
30
|
+
#include "dyncall.h"
|
31
|
+
|
32
|
+
/* --- callvm virtual function table --------------------------------------- */
|
33
|
+
|
34
|
+
/* NOTE: if something changes in DCCallVM_, update offset marks in dyncall_call_sparc.S */
|
35
|
+
|
36
|
+
typedef struct DCCallVM_vt_ DCCallVM_vt;
|
37
|
+
|
38
|
+
struct DCCallVM_
|
39
|
+
{
|
40
|
+
DCCallVM_vt* mVTpointer;
|
41
|
+
DCint mError;
|
42
|
+
};
|
43
|
+
|
44
|
+
struct DCCallVM_vt_
|
45
|
+
{
|
46
|
+
void (*free) (DCCallVM* vm);
|
47
|
+
void (*reset) (DCCallVM* vm);
|
48
|
+
void (*mode) (DCCallVM* vm,DCint mode);
|
49
|
+
void (*argBool) (DCCallVM* vm,DCbool B);
|
50
|
+
void (*argChar) (DCCallVM* vm,DCchar c);
|
51
|
+
void (*argShort) (DCCallVM* vm,DCshort s);
|
52
|
+
void (*argInt) (DCCallVM* vm,DCint i);
|
53
|
+
void (*argLong) (DCCallVM* vm,DClong l);
|
54
|
+
void (*argLongLong) (DCCallVM* vm,DClonglong L);
|
55
|
+
void (*argFloat) (DCCallVM* vm,DCfloat f);
|
56
|
+
void (*argDouble) (DCCallVM* vm,DCdouble d);
|
57
|
+
void (*argPointer) (DCCallVM* vm,DCpointer p);
|
58
|
+
void (*argStruct) (DCCallVM* vm,DCstruct* s, DCpointer p);
|
59
|
+
void (*callVoid) (DCCallVM* vm,DCpointer funcptr);
|
60
|
+
DCbool (*callBool) (DCCallVM* vm,DCpointer funcptr);
|
61
|
+
DCchar (*callChar) (DCCallVM* vm,DCpointer funcptr);
|
62
|
+
DCshort (*callShort) (DCCallVM* vm,DCpointer funcptr);
|
63
|
+
DCint (*callInt) (DCCallVM* vm,DCpointer funcptr);
|
64
|
+
DClong (*callLong) (DCCallVM* vm,DCpointer funcptr);
|
65
|
+
DClonglong (*callLongLong) (DCCallVM* vm,DCpointer funcptr);
|
66
|
+
DCfloat (*callFloat) (DCCallVM* vm,DCpointer funcptr);
|
67
|
+
DCdouble (*callDouble) (DCCallVM* vm,DCpointer funcptr);
|
68
|
+
DCpointer (*callPointer) (DCCallVM* vm,DCpointer funcptr);
|
69
|
+
void (*callStruct) (DCCallVM* vm,DCpointer funcptr,DCstruct* s, DCpointer returnValue);
|
70
|
+
};
|
71
|
+
|
72
|
+
typedef DCvoid (DCvoidvmfunc) (DCCallVM* vm,DCpointer funcptr);
|
73
|
+
typedef DCbool (DCboolvmfunc) (DCCallVM* vn,DCpointer funcptr);
|
74
|
+
typedef DCchar (DCcharvmfunc) (DCCallVM* vm,DCpointer funcptr);
|
75
|
+
typedef DCshort (DCshortvmfunc) (DCCallVM* vm,DCpointer funcptr);
|
76
|
+
typedef DCint (DCintvmfunc) (DCCallVM* vm,DCpointer funcptr);
|
77
|
+
typedef DClong (DClongvmfunc) (DCCallVM* vm,DCpointer funcptr);
|
78
|
+
typedef DClonglong (DClonglongvmfunc) (DCCallVM* vm,DCpointer funcptr);
|
79
|
+
typedef DCfloat (DCfloatvmfunc) (DCCallVM* vm,DCpointer funcptr);
|
80
|
+
typedef DCdouble (DCdoublevmfunc) (DCCallVM* vm,DCpointer funcptr);
|
81
|
+
typedef DCpointer (DCpointervmfunc) (DCCallVM* vm,DCpointer funcptr);
|
82
|
+
|
83
|
+
/* Common base functions for CallVM implementations. */
|
84
|
+
|
85
|
+
void dc_callvm_base_init(DCCallVM *pInstance, DCCallVM_vt* pVTable);
|
86
|
+
|
87
|
+
#endif /* DYNCALL_CALLVM_H */
|
88
|
+
|
@@ -0,0 +1,250 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_callvm_arm32_arm.c
|
6
|
+
Description: ARM 32-bit "arm" ABI callvm implementation
|
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 32bit ARM32 family of processors
|
30
|
+
|
31
|
+
SUPPORTED CALLING CONVENTIONS
|
32
|
+
armcall
|
33
|
+
|
34
|
+
REVISION
|
35
|
+
2007/12/11 initial
|
36
|
+
|
37
|
+
*/
|
38
|
+
|
39
|
+
|
40
|
+
#include "dyncall_callvm_arm32_arm.h"
|
41
|
+
#include "dyncall_alloc.h"
|
42
|
+
|
43
|
+
static void dc_callvm_mode_arm32_arm(DCCallVM* in_self,DCint mode);
|
44
|
+
|
45
|
+
static DCCallVM* dc_callvm_new_arm32_arm(DCCallVM_vt* vt, DCsize size)
|
46
|
+
{
|
47
|
+
/* Store at least 16 bytes (4 words) for internal spill area. Assembly code depends on it. */
|
48
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)dcAllocMem(sizeof(DCCallVM_arm32_arm)+size+16);
|
49
|
+
dc_callvm_base_init(&self->mInterface, vt);
|
50
|
+
dcVecInit(&self->mVecHead, size);
|
51
|
+
return (DCCallVM*)self;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
static void dc_callvm_free_arm32_arm(DCCallVM* in_self)
|
56
|
+
{
|
57
|
+
dcFreeMem(in_self);
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
static void dc_callvm_reset_arm32_arm(DCCallVM* in_self)
|
62
|
+
{
|
63
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
64
|
+
dcVecReset(&self->mVecHead);
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
static void dc_callvm_argInt_arm32_arm(DCCallVM* in_self, DCint x)
|
69
|
+
{
|
70
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
71
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DCint));
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
static void dc_callvm_argBool_arm32_arm(DCCallVM* in_self, DCbool x)
|
76
|
+
{
|
77
|
+
dc_callvm_argInt_arm32_arm(in_self, (DCint)x);
|
78
|
+
}
|
79
|
+
|
80
|
+
|
81
|
+
static void dc_callvm_argChar_arm32_arm(DCCallVM* in_self, DCchar x)
|
82
|
+
{
|
83
|
+
dc_callvm_argInt_arm32_arm(in_self, x);
|
84
|
+
}
|
85
|
+
|
86
|
+
|
87
|
+
static void dc_callvm_argShort_arm32_arm(DCCallVM* in_self, DCshort x)
|
88
|
+
{
|
89
|
+
dc_callvm_argInt_arm32_arm(in_self, x);
|
90
|
+
}
|
91
|
+
|
92
|
+
|
93
|
+
static void dc_callvm_argLong_arm32_arm(DCCallVM* in_self, DClong x)
|
94
|
+
{
|
95
|
+
dc_callvm_argInt_arm32_arm(in_self, x);
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
static void dc_callvm_argLongLong_arm32_arm(DCCallVM* in_self, DClonglong x)
|
100
|
+
{
|
101
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
102
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DClonglong));
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
static void dc_callvm_argLongLong_arm32_arm_eabi(DCCallVM* in_self, DClonglong x)
|
107
|
+
{
|
108
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
109
|
+
|
110
|
+
/* 64 bit values need to be aligned on 8 byte boundaries */
|
111
|
+
dcVecSkip(&self->mVecHead, dcVecSize(&self->mVecHead) & 4);
|
112
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DClonglong));
|
113
|
+
}
|
114
|
+
|
115
|
+
|
116
|
+
static void dc_callvm_argFloat_arm32_arm(DCCallVM* in_self, DCfloat x)
|
117
|
+
{
|
118
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
119
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DCfloat));
|
120
|
+
}
|
121
|
+
|
122
|
+
|
123
|
+
static void dc_callvm_argDouble_arm32_arm(DCCallVM* in_self, DCdouble x)
|
124
|
+
{
|
125
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
126
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DCdouble));
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
static void dc_callvm_argDouble_arm32_arm_eabi(DCCallVM* in_self, DCdouble x)
|
131
|
+
{
|
132
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
133
|
+
|
134
|
+
/* 64 bit values need to be aligned on 8 byte boundaries */
|
135
|
+
dcVecSkip(&self->mVecHead, dcVecSize(&self->mVecHead) & 4);
|
136
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DCdouble));
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
static void dc_callvm_argPointer_arm32_arm(DCCallVM* in_self, DCpointer x)
|
141
|
+
{
|
142
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
143
|
+
dcVecAppend(&self->mVecHead, &x, sizeof(DCpointer));
|
144
|
+
}
|
145
|
+
|
146
|
+
|
147
|
+
/* Call. */
|
148
|
+
void dc_callvm_call_arm32_arm(DCCallVM* in_self, DCpointer target)
|
149
|
+
{
|
150
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*)in_self;
|
151
|
+
dcCall_arm32_arm(target, dcVecData(&self->mVecHead), dcVecSize(&self->mVecHead));
|
152
|
+
}
|
153
|
+
|
154
|
+
|
155
|
+
DCCallVM_vt gVT_arm32_arm =
|
156
|
+
{
|
157
|
+
&dc_callvm_free_arm32_arm
|
158
|
+
, &dc_callvm_reset_arm32_arm
|
159
|
+
, &dc_callvm_mode_arm32_arm
|
160
|
+
, &dc_callvm_argBool_arm32_arm
|
161
|
+
, &dc_callvm_argChar_arm32_arm
|
162
|
+
, &dc_callvm_argShort_arm32_arm
|
163
|
+
, &dc_callvm_argInt_arm32_arm
|
164
|
+
, &dc_callvm_argLong_arm32_arm
|
165
|
+
, &dc_callvm_argLongLong_arm32_arm
|
166
|
+
, &dc_callvm_argFloat_arm32_arm
|
167
|
+
, &dc_callvm_argDouble_arm32_arm
|
168
|
+
, &dc_callvm_argPointer_arm32_arm
|
169
|
+
, NULL /* argStruct */
|
170
|
+
, (DCvoidvmfunc*) &dc_callvm_call_arm32_arm
|
171
|
+
, (DCboolvmfunc*) &dc_callvm_call_arm32_arm
|
172
|
+
, (DCcharvmfunc*) &dc_callvm_call_arm32_arm
|
173
|
+
, (DCshortvmfunc*) &dc_callvm_call_arm32_arm
|
174
|
+
, (DCintvmfunc*) &dc_callvm_call_arm32_arm
|
175
|
+
, (DClongvmfunc*) &dc_callvm_call_arm32_arm
|
176
|
+
, (DClonglongvmfunc*) &dc_callvm_call_arm32_arm
|
177
|
+
, (DCfloatvmfunc*) &dc_callvm_call_arm32_arm
|
178
|
+
, (DCdoublevmfunc*) &dc_callvm_call_arm32_arm
|
179
|
+
, (DCpointervmfunc*) &dc_callvm_call_arm32_arm
|
180
|
+
, NULL /* callStruct */
|
181
|
+
};
|
182
|
+
|
183
|
+
|
184
|
+
DCCallVM_vt gVT_arm32_arm_eabi =
|
185
|
+
{
|
186
|
+
&dc_callvm_free_arm32_arm
|
187
|
+
, &dc_callvm_reset_arm32_arm
|
188
|
+
, &dc_callvm_mode_arm32_arm
|
189
|
+
, &dc_callvm_argBool_arm32_arm
|
190
|
+
, &dc_callvm_argChar_arm32_arm
|
191
|
+
, &dc_callvm_argShort_arm32_arm
|
192
|
+
, &dc_callvm_argInt_arm32_arm
|
193
|
+
, &dc_callvm_argLong_arm32_arm
|
194
|
+
, &dc_callvm_argLongLong_arm32_arm_eabi
|
195
|
+
, &dc_callvm_argFloat_arm32_arm
|
196
|
+
, &dc_callvm_argDouble_arm32_arm_eabi
|
197
|
+
, &dc_callvm_argPointer_arm32_arm
|
198
|
+
, NULL /* argStruct */
|
199
|
+
, (DCvoidvmfunc*) &dc_callvm_call_arm32_arm
|
200
|
+
, (DCboolvmfunc*) &dc_callvm_call_arm32_arm
|
201
|
+
, (DCcharvmfunc*) &dc_callvm_call_arm32_arm
|
202
|
+
, (DCshortvmfunc*) &dc_callvm_call_arm32_arm
|
203
|
+
, (DCintvmfunc*) &dc_callvm_call_arm32_arm
|
204
|
+
, (DClongvmfunc*) &dc_callvm_call_arm32_arm
|
205
|
+
, (DClonglongvmfunc*) &dc_callvm_call_arm32_arm
|
206
|
+
, (DCfloatvmfunc*) &dc_callvm_call_arm32_arm
|
207
|
+
, (DCdoublevmfunc*) &dc_callvm_call_arm32_arm
|
208
|
+
, (DCpointervmfunc*) &dc_callvm_call_arm32_arm
|
209
|
+
, NULL /* callStruct */
|
210
|
+
};
|
211
|
+
|
212
|
+
|
213
|
+
DCCallVM* dcNewCallVM_arm32_arm(DCsize size)
|
214
|
+
{
|
215
|
+
/* Check OS if we need EABI as default. */
|
216
|
+
#if defined(DC__ABI_ARM_EABI)
|
217
|
+
return dc_callvm_new_arm32_arm(&gVT_arm32_arm_eabi, size);
|
218
|
+
#else
|
219
|
+
return dc_callvm_new_arm32_arm(&gVT_arm32_arm, size);
|
220
|
+
#endif
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
DCCallVM* dcNewCallVM(DCsize size)
|
225
|
+
{
|
226
|
+
return dcNewCallVM_arm32_arm(size);
|
227
|
+
}
|
228
|
+
|
229
|
+
static void dc_callvm_mode_arm32_arm(DCCallVM* in_self,DCint mode)
|
230
|
+
{
|
231
|
+
DCCallVM_arm32_arm* self = (DCCallVM_arm32_arm*) in_self;
|
232
|
+
DCCallVM_vt* vt;
|
233
|
+
switch(mode) {
|
234
|
+
/* Check OS if we need EABI as default. */
|
235
|
+
case DC_CALL_C_ELLIPSIS:
|
236
|
+
case DC_CALL_C_ELLIPSIS_VARARGS:
|
237
|
+
#if defined(DC__ABI_ARM_EABI)
|
238
|
+
case DC_CALL_C_DEFAULT: vt = &gVT_arm32_arm_eabi; break;
|
239
|
+
#else
|
240
|
+
case DC_CALL_C_DEFAULT: vt = &gVT_arm32_arm; break;
|
241
|
+
#endif
|
242
|
+
case DC_CALL_C_ARM_ARM: vt = &gVT_arm32_arm; break;
|
243
|
+
case DC_CALL_C_ARM_ARM_EABI: vt = &gVT_arm32_arm_eabi; break;
|
244
|
+
default:
|
245
|
+
in_self->mError = DC_ERROR_UNSUPPORTED_MODE;
|
246
|
+
return;
|
247
|
+
}
|
248
|
+
self->mInterface.mVTpointer = vt;
|
249
|
+
}
|
250
|
+
|