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,44 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_callback_x64.h
|
6
|
+
Description: Callback - Header for x64
|
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_CALLBACK_X64_H_
|
28
|
+
#define DYNCALL_CALLBACK_X64_H_
|
29
|
+
|
30
|
+
#include "dyncall_callback.h"
|
31
|
+
|
32
|
+
#include "dyncall_thunk.h"
|
33
|
+
#include "dyncall_args_x64.h"
|
34
|
+
|
35
|
+
|
36
|
+
struct DCCallback
|
37
|
+
{
|
38
|
+
DCThunk thunk; // offset 0, size 24
|
39
|
+
DCCallbackHandler* handler; // offset 24
|
40
|
+
void* userdata; // offset 32
|
41
|
+
};
|
42
|
+
|
43
|
+
#endif /* DYNCALL_CALLBACK_X64_H_ */
|
44
|
+
|
@@ -0,0 +1,122 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_callback_x64_apple.s
|
6
|
+
Description: Callback Thunk - Implementation for x64 (Apple as assembly)
|
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
|
+
.intel_syntax
|
28
|
+
.text
|
29
|
+
|
30
|
+
/* sizes */
|
31
|
+
|
32
|
+
.set DCThunk_size , 24
|
33
|
+
.set DCArgs_size , 128
|
34
|
+
.set DCValue_size , 8
|
35
|
+
|
36
|
+
/* frame local variable offsets relative to %rbp*/
|
37
|
+
|
38
|
+
.set FRAME_arg0 , 16
|
39
|
+
.set FRAME_return , 8
|
40
|
+
.set FRAME_parent , 0
|
41
|
+
.set FRAME_DCArgs ,-128
|
42
|
+
.set FRAME_DCValue ,-136
|
43
|
+
|
44
|
+
/* struct DCCallback */
|
45
|
+
|
46
|
+
.set CTX_thunk , 0
|
47
|
+
.set CTX_handler , 24
|
48
|
+
.set CTX_userdata , 32
|
49
|
+
.set DCCallback_size , 40
|
50
|
+
|
51
|
+
.globl _dcCallbackThunkEntry
|
52
|
+
_dcCallbackThunkEntry:
|
53
|
+
|
54
|
+
pushq %rbp
|
55
|
+
movq %rbp, %rsp
|
56
|
+
|
57
|
+
// initialize DCArgs
|
58
|
+
|
59
|
+
// float parameters (8 registers spill to DCArgs)
|
60
|
+
sub %rsp, 8*8
|
61
|
+
movq [%rsp+8*7], %xmm7 # struct offset 120: float parameter 7
|
62
|
+
movq [%rsp+8*6], %xmm6 # struct offset 112: float parameter 6
|
63
|
+
movq [%rsp+8*5], %xmm5 # struct offset 104: float parameter 5
|
64
|
+
movq [%rsp+8*4], %xmm4 # struct offset 96: float parameter 4
|
65
|
+
movq [%rsp+8*3], %xmm3 # struct offset 88: float parameter 3
|
66
|
+
movq [%rsp+8*2], %xmm2 # struct offset 80: float parameter 2
|
67
|
+
movq [%rsp+8*1], %xmm1 # struct offset 72: float parameter 1
|
68
|
+
movq [%rsp+8*0], %xmm0 # struct offset 64: float parameter 0
|
69
|
+
|
70
|
+
// integer parameters (6 registers spill to DCArgs)
|
71
|
+
pushq %r9 # struct offset 56: parameter 5
|
72
|
+
pushq %r8 # struct offset 48: parameter 4
|
73
|
+
pushq %rcx # struct offset 40: parameter 3
|
74
|
+
pushq %rdx # struct offset 32: parameter 2
|
75
|
+
pushq %rsi # struct offset 24: parameter 1
|
76
|
+
pushq %rdi # struct offset 16: parameter 0
|
77
|
+
|
78
|
+
// register counts for integer/pointer and float regs
|
79
|
+
# struct offset 12: fcount
|
80
|
+
pushq 0 # struct offset 8: icount
|
81
|
+
|
82
|
+
lea %rdx, [%rbp+FRAME_arg0] # struct offset 0: stack pointer
|
83
|
+
pushq %rdx
|
84
|
+
|
85
|
+
mov %rsi, %rsp # parameter 1 (RSI) = DCArgs*
|
86
|
+
|
87
|
+
// initialize DCValue
|
88
|
+
|
89
|
+
pushq 0 # structo offset 0: return value (max long long)
|
90
|
+
|
91
|
+
// call handler( *ctx, *args, *value, *userdata)
|
92
|
+
|
93
|
+
mov %rdi, %rax # parameter 0 (RDI) = DCCallback* (RAX)
|
94
|
+
mov %rcx, [%rdi+CTX_userdata] # arg3 = userdata*
|
95
|
+
mov %rdx, %rsp # arg2 (RDX) = DCValue*
|
96
|
+
|
97
|
+
pushq 0 # align to 16 bytes
|
98
|
+
|
99
|
+
call [%rax+CTX_handler]
|
100
|
+
|
101
|
+
// pass return type via registers
|
102
|
+
// distinguish two basic classes 'integer' and 'float'
|
103
|
+
|
104
|
+
mov %dl, %al
|
105
|
+
movq %rax, [%rbp+FRAME_DCValue]
|
106
|
+
|
107
|
+
ASCII_f = 102
|
108
|
+
ASCII_d = 100
|
109
|
+
|
110
|
+
cmpb %dl, ASCII_f
|
111
|
+
je .float
|
112
|
+
cmpb %dl, ASCII_d
|
113
|
+
jne .return
|
114
|
+
.float:
|
115
|
+
movd %xmm0, %rax
|
116
|
+
|
117
|
+
.return:
|
118
|
+
mov %rsp, %rbp
|
119
|
+
pop %rbp
|
120
|
+
ret
|
121
|
+
|
122
|
+
|
@@ -0,0 +1,119 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_callback_x64_gas.s
|
6
|
+
Description: Callback Thunk - Implementation for x64 (GNU as assembler)
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
.intel_syntax
|
27
|
+
.text
|
28
|
+
.globl dcCallbackThunkEntry
|
29
|
+
|
30
|
+
/* sizes */
|
31
|
+
|
32
|
+
.set DCThunk_size , 24
|
33
|
+
.set DCArgs_size , 128
|
34
|
+
.set DCValue_size , 8
|
35
|
+
|
36
|
+
/* frame local variable offsets relative to %rbp*/
|
37
|
+
|
38
|
+
.set FRAME_arg0 , 16
|
39
|
+
.set FRAME_return , 8
|
40
|
+
.set FRAME_parent , 0
|
41
|
+
.set FRAME_DCArgs ,-128
|
42
|
+
.set FRAME_DCValue ,-136
|
43
|
+
|
44
|
+
/* struct DCCallback */
|
45
|
+
|
46
|
+
.set CTX_thunk , 0
|
47
|
+
.set CTX_handler , 24
|
48
|
+
.set CTX_userdata , 32
|
49
|
+
.set DCCallback_size , 40
|
50
|
+
|
51
|
+
dcCallbackThunkEntry:
|
52
|
+
|
53
|
+
pushq %rbp
|
54
|
+
movq %rbp, %rsp
|
55
|
+
|
56
|
+
// initialize DCArgs
|
57
|
+
|
58
|
+
// float parameters (8 registers spill to DCArgs)
|
59
|
+
sub %rsp, 8*8
|
60
|
+
movq [%rsp+8*7], %xmm7 # struct offset 120: float parameter 7
|
61
|
+
movq [%rsp+8*6], %xmm6 # struct offset 112: float parameter 6
|
62
|
+
movq [%rsp+8*5], %xmm5 # struct offset 104: float parameter 5
|
63
|
+
movq [%rsp+8*4], %xmm4 # struct offset 96: float parameter 4
|
64
|
+
movq [%rsp+8*3], %xmm3 # struct offset 88: float parameter 3
|
65
|
+
movq [%rsp+8*2], %xmm2 # struct offset 80: float parameter 2
|
66
|
+
movq [%rsp+8*1], %xmm1 # struct offset 72: float parameter 1
|
67
|
+
movq [%rsp+8*0], %xmm0 # struct offset 64: float parameter 0
|
68
|
+
|
69
|
+
// fill integer parameters (6 registers spill to DCArgs)
|
70
|
+
pushq %r9 # struct offset 56: parameter 5
|
71
|
+
pushq %r8 # struct offset 48: parameter 4
|
72
|
+
pushq %rcx # struct offset 40: parameter 3
|
73
|
+
pushq %rdx # struct offset 32: parameter 2
|
74
|
+
pushq %rsi # struct offset 24: parameter 1
|
75
|
+
pushq %rdi # struct offset 16: parameter 0
|
76
|
+
|
77
|
+
// fill register counts for integer/pointer and float regs
|
78
|
+
pushq 0 # struct offset 12: fcount
|
79
|
+
# struct offset 8: icount
|
80
|
+
|
81
|
+
// fill argument stack pointer
|
82
|
+
lea %rdx, [%rbp+FRAME_arg0]
|
83
|
+
pushq %rdx # struct offset 0: stack pointer
|
84
|
+
|
85
|
+
mov %rsi, %rsp # arg1 (RSI) = DCArgs*
|
86
|
+
|
87
|
+
// initialize DCValue:
|
88
|
+
pushq 0 # structo offset 0: return value (max long long)
|
89
|
+
|
90
|
+
// call handler( *ctx, *args, *value, *userdata)
|
91
|
+
|
92
|
+
mov %rdi, %rax # arg0 (RDI) = DCCallback* (RAX)
|
93
|
+
mov %rcx, [%rdi+CTX_userdata] # arg3 = userdata*
|
94
|
+
mov %rdx, %rsp # arg2 (RDX) = DCValue*
|
95
|
+
|
96
|
+
pushq 0 # align to 16 bytes
|
97
|
+
|
98
|
+
call [%rax+CTX_handler]
|
99
|
+
|
100
|
+
// pass return type via registers
|
101
|
+
// distinguish two basic classes 'integer' and 'float'
|
102
|
+
|
103
|
+
mov %dl, %al
|
104
|
+
movq %rax, [%rbp+FRAME_DCValue]
|
105
|
+
|
106
|
+
cmp %dl, 'f'
|
107
|
+
je .float
|
108
|
+
cmp %dl, 'd'
|
109
|
+
je .float
|
110
|
+
.int:
|
111
|
+
jmp .return
|
112
|
+
.float:
|
113
|
+
movd %xmm0, %rax
|
114
|
+
|
115
|
+
.return:
|
116
|
+
mov %rsp, %rbp
|
117
|
+
pop %rbp
|
118
|
+
ret
|
119
|
+
|
@@ -0,0 +1,102 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncallback
|
5
|
+
File: dyncallback/dyncall_callback_x64_gas_w64.s
|
6
|
+
Description: Callback Thunk - Implementation for x64 (GNU as assembler)
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
.intel_syntax
|
27
|
+
.text
|
28
|
+
.globl dcCallbackThunkEntry
|
29
|
+
|
30
|
+
/* sizes */
|
31
|
+
|
32
|
+
.set DCThunk_size , 24
|
33
|
+
.set DCArgs_size , 80 /* 128 */
|
34
|
+
.set DCValue_size , 8
|
35
|
+
|
36
|
+
/* frame local variable offsets relative to %rbp*/
|
37
|
+
|
38
|
+
.set FRAME_arg0 , 48 /* 16 */
|
39
|
+
.set FRAME_return , 8
|
40
|
+
.set FRAME_parent , 0
|
41
|
+
.set FRAME_DCArgs , -80 /* -128 */
|
42
|
+
.set FRAME_DCValue , -80 /* -136 */
|
43
|
+
|
44
|
+
/* struct DCCallback */
|
45
|
+
|
46
|
+
.set CTX_thunk , 0
|
47
|
+
.set CTX_handler , 24
|
48
|
+
.set CTX_userdata , 32
|
49
|
+
.set DCCallback_size , 40
|
50
|
+
|
51
|
+
dcCallbackThunkEntry:
|
52
|
+
|
53
|
+
pushq %rbp
|
54
|
+
movq %rbp, %rsp
|
55
|
+
|
56
|
+
// initialize DCArgs
|
57
|
+
|
58
|
+
// float parameters (4 registers spill to DCArgs)
|
59
|
+
sub %rsp, 4*8
|
60
|
+
movq [%rsp+8*3], %xmm3 # struct offset 72: float parameter 3
|
61
|
+
movq [%rsp+8*2], %xmm2 # struct offset 64: float parameter 2
|
62
|
+
movq [%rsp+8*1], %xmm1 # struct offset 56: float parameter 1
|
63
|
+
movq [%rsp+8*0], %xmm0 # struct offset 48: float parameter 0
|
64
|
+
|
65
|
+
// fill integer parameters (4 registers spill to DCArgs)
|
66
|
+
pushq %r9 # struct offset 40: int parameter 3
|
67
|
+
pushq %r8 # struct offset 32: int parameter 2
|
68
|
+
pushq %rdx # struct offset 24: int parameter 1
|
69
|
+
pushq %rcx # struct offset 16: int parameter 0
|
70
|
+
|
71
|
+
// fill register counts for integer/pointer and float regs
|
72
|
+
pushq 0 # struct offset 8: register count
|
73
|
+
|
74
|
+
// fill argument stack pointer
|
75
|
+
lea %rdx, [%rbp+FRAME_arg0]
|
76
|
+
pushq %rdx # struct offset 0: stack pointer
|
77
|
+
|
78
|
+
mov %rdx, %rsp # arg1 (RDX) = DCArgs*
|
79
|
+
|
80
|
+
// initialize DCValue:
|
81
|
+
// pushq 0 # structo offset 0: return value (max long long)
|
82
|
+
|
83
|
+
// call handler( *ctx, *args, *value, *userdata)
|
84
|
+
|
85
|
+
mov %rcx, %rax # arg0 (RCX) = DCCallback* (RAX)
|
86
|
+
mov %r9, [%rax+CTX_userdata] # arg3 (R9) = userdata*
|
87
|
+
mov %r8, %rsp # arg2 (RDX) = DCValue*
|
88
|
+
|
89
|
+
sub %rsp, 4*8 # make foom for spill area and call
|
90
|
+
|
91
|
+
call [%rax+CTX_handler]
|
92
|
+
|
93
|
+
// pass return type via registers
|
94
|
+
// distinguish two basic classes 'integer' and 'float'
|
95
|
+
|
96
|
+
movq %rax, [%rbp+FRAME_DCValue]
|
97
|
+
movd %xmm0, %rax
|
98
|
+
|
99
|
+
mov %rsp, %rbp
|
100
|
+
pop %rbp
|
101
|
+
ret
|
102
|
+
|
@@ -0,0 +1,89 @@
|
|
1
|
+
; auto-generated by gen-masm.sh
|
2
|
+
.CODE
|
3
|
+
DCThunk_size = 24
|
4
|
+
DCArgs_size_win64 = 80
|
5
|
+
DCArgs_size_sysv = 128
|
6
|
+
DCValue_size = 8
|
7
|
+
FRAME_arg0_win64 = 48
|
8
|
+
FRAME_arg0_sysv = 16
|
9
|
+
FRAME_return = 8
|
10
|
+
FRAME_parent = 0
|
11
|
+
FRAME_DCArgs_sysv = -128
|
12
|
+
FRAME_DCValue_sysv = -136
|
13
|
+
FRAME_DCArgs_win64 = -80
|
14
|
+
FRAME_DCValue_win64 = -80
|
15
|
+
CTX_thunk = 0
|
16
|
+
CTX_handler = 24
|
17
|
+
CTX_userdata = 32
|
18
|
+
DCCallback_size = 40
|
19
|
+
dcCallback_x64_sysv PROC
|
20
|
+
OPTION PROLOGUE:NONE, EPILOGUE:NONE
|
21
|
+
push RBP
|
22
|
+
mov RBP,RSP
|
23
|
+
sub RSP,8*8
|
24
|
+
movsd qword ptr [RSP+8*7],XMM7
|
25
|
+
movsd qword ptr [RSP+8*6],XMM6
|
26
|
+
movsd qword ptr [RSP+8*5],XMM5
|
27
|
+
movsd qword ptr [RSP+8*4],XMM4
|
28
|
+
movsd qword ptr [RSP+8*3],XMM3
|
29
|
+
movsd qword ptr [RSP+8*2],XMM2
|
30
|
+
movsd qword ptr [RSP+8*1],XMM1
|
31
|
+
movsd qword ptr [RSP+8*0],XMM0
|
32
|
+
push R9
|
33
|
+
push R8
|
34
|
+
push RCX
|
35
|
+
push RDX
|
36
|
+
push RSI
|
37
|
+
push RDI
|
38
|
+
push 0
|
39
|
+
lea RDX,qword ptr [RBP+FRAME_arg0_sysv]
|
40
|
+
push RDX
|
41
|
+
mov RSI,RSP
|
42
|
+
push 0
|
43
|
+
mov RDI,RAX
|
44
|
+
mov RCX,qword ptr [RDI+CTX_userdata]
|
45
|
+
mov RDX,RSP
|
46
|
+
push 0
|
47
|
+
call qword ptr [RAX+CTX_handler]
|
48
|
+
mov DL,AL
|
49
|
+
mov RAX,qword ptr [RBP+FRAME_DCValue_sysv]
|
50
|
+
cmp DL,102
|
51
|
+
je return_f64
|
52
|
+
cmp DL,100
|
53
|
+
jne return_i64
|
54
|
+
return_f64:
|
55
|
+
movd XMM0,RAX
|
56
|
+
return_i64:
|
57
|
+
mov RSP,RBP
|
58
|
+
pop RBP
|
59
|
+
ret
|
60
|
+
dcCallback_x64_sysv ENDP
|
61
|
+
dcCallback_x64_win64 PROC
|
62
|
+
OPTION PROLOGUE:NONE, EPILOGUE:NONE
|
63
|
+
push RBP
|
64
|
+
mov RBP,RSP
|
65
|
+
sub RSP,4*8
|
66
|
+
movsd qword ptr [RSP+8*3],XMM3
|
67
|
+
movsd qword ptr [RSP+8*2],XMM2
|
68
|
+
movsd qword ptr [RSP+8*1],XMM1
|
69
|
+
movsd qword ptr [RSP+8*0],XMM0
|
70
|
+
push R9
|
71
|
+
push R8
|
72
|
+
push RDX
|
73
|
+
push RCX
|
74
|
+
push 0
|
75
|
+
lea RDX,qword ptr [RBP+FRAME_arg0_win64]
|
76
|
+
push RDX
|
77
|
+
mov RDX,RSP
|
78
|
+
mov RCX,RAX
|
79
|
+
mov R9,qword ptr [RAX+CTX_userdata]
|
80
|
+
mov R8,RSP
|
81
|
+
sub RSP,4*8
|
82
|
+
call qword ptr [RAX+CTX_handler]
|
83
|
+
mov RAX,qword ptr [RBP+FRAME_DCValue_win64]
|
84
|
+
movd XMM0,RAX
|
85
|
+
mov RSP,RBP
|
86
|
+
pop RBP
|
87
|
+
ret
|
88
|
+
dcCallback_x64_win64 ENDP
|
89
|
+
END
|