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,42 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_sparc64.h
|
6
|
+
Description:
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>
|
10
|
+
|
11
|
+
Permission to use, copy, modify, and distribute this software for any
|
12
|
+
purpose with or without fee is hereby granted, provided that the above
|
13
|
+
copyright notice and this permission notice appear in all copies.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
16
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
17
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
18
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
19
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
20
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
21
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
22
|
+
|
23
|
+
*/
|
24
|
+
|
25
|
+
|
26
|
+
#ifndef DYNCALL_CALL_SPARC64_H
|
27
|
+
#define DYNCALL_CALL_SPARC64_H
|
28
|
+
|
29
|
+
#include "dyncall_types.h"
|
30
|
+
|
31
|
+
#ifdef __cplusplus
|
32
|
+
extern "C" {
|
33
|
+
#endif
|
34
|
+
|
35
|
+
void dcCall_sparc64 (DCpointer target, DCsize size, DCpointer data);
|
36
|
+
|
37
|
+
#ifdef __cplusplus
|
38
|
+
}
|
39
|
+
#endif
|
40
|
+
|
41
|
+
#endif /* DYNCALL_CALL_SPARC64_H */
|
42
|
+
|
@@ -0,0 +1,220 @@
|
|
1
|
+
#define BIAS 2047
|
2
|
+
.global dcCall_v9
|
3
|
+
/* dcCall_sparc64( DCCallVM* , void * target ) */
|
4
|
+
/* o0 o1 */
|
5
|
+
dcCall_v9:
|
6
|
+
or %o0, %g0, %o3 /* o3: callvm */
|
7
|
+
or %o1, %g0, %o0 /* o0: target */
|
8
|
+
ldx [%o3+24], %o1 /* o1: mVecSize */
|
9
|
+
add %o3, 32, %o2 /* o2: stack */
|
10
|
+
/* Compute a matching stack size (approximate): o3 = align(o1+136,16) */
|
11
|
+
|
12
|
+
add %o1, (16+1+6)*8+15, %o3
|
13
|
+
and %o3, -16, %o3
|
14
|
+
neg %o3 /* o3: -stacksize */
|
15
|
+
save %sp, %o3, %sp
|
16
|
+
|
17
|
+
ldd [%i2+8*0 ],%f0 /* Load double-precision float registers. */
|
18
|
+
ldd [%i2+8*1 ],%f2
|
19
|
+
ldd [%i2+8*2 ],%f4
|
20
|
+
ldd [%i2+8*3 ],%f6
|
21
|
+
ldd [%i2+8*4 ],%f8
|
22
|
+
ldd [%i2+8*5 ],%f10
|
23
|
+
ldd [%i2+8*6 ],%f12
|
24
|
+
ldd [%i2+8*7 ],%f14
|
25
|
+
ldd [%i2+8*8 ],%f16
|
26
|
+
ldd [%i2+8*9 ],%f18
|
27
|
+
ldd [%i2+8*10],%f20
|
28
|
+
ldd [%i2+8*11],%f22
|
29
|
+
ldd [%i2+8*12],%f24
|
30
|
+
ldd [%i2+8*13],%f26
|
31
|
+
ldd [%i2+8*14],%f28
|
32
|
+
ldd [%i2+8*15],%f30
|
33
|
+
ldx [%i2+8*0],%o0 /* Load output registers. */
|
34
|
+
ldx [%i2+8*1],%o1
|
35
|
+
ldx [%i2+8*2],%o2
|
36
|
+
ldx [%i2+8*3],%o3
|
37
|
+
ldx [%i2+8*4],%o4
|
38
|
+
ldx [%i2+8*5],%o5
|
39
|
+
sub %i1, 48, %i1
|
40
|
+
cmp %i1, 0
|
41
|
+
ble .do_call
|
42
|
+
nop
|
43
|
+
/* Copy loop: */
|
44
|
+
add %i2, 48, %i2 /* skip homing area */
|
45
|
+
or %g0, %g0, %l0 /* l0 = offset initialized to 0. */
|
46
|
+
add %sp, BIAS+((16+6)*8), %l2 /* l2 = argument area on stack space (7th word). (64+4+6*4 = byte offset 92). */
|
47
|
+
.next:
|
48
|
+
ldx [%i2+%l0],%l1 /* Read from arg buffer(%i2) to %l1. */
|
49
|
+
stx %l1, [%l2+%l0] /* Write %l1 to stack space(%l2). */
|
50
|
+
add %l0, 8, %l0 /* Increment offset. */
|
51
|
+
sub %i1, 8, %i1 /* Decrement copy size. */
|
52
|
+
cmp %i1, 0
|
53
|
+
bgt .next
|
54
|
+
nop
|
55
|
+
.do_call:
|
56
|
+
call %i0 /* Call target. */
|
57
|
+
nop
|
58
|
+
or %o0, %g0, %i0
|
59
|
+
jmpl %i7 + 8, %g0
|
60
|
+
restore
|
61
|
+
|
62
|
+
/*
|
63
|
+
or %o0, %g0, %i0
|
64
|
+
or %o1, %g0, %i1
|
65
|
+
or %o2, %g0, %i2
|
66
|
+
or %o3, %g0, %i3
|
67
|
+
return %i7 + 8
|
68
|
+
nop
|
69
|
+
|
70
|
+
Changes from v8:
|
71
|
+
- fundamental data types
|
72
|
+
- (un)signed int: 8,16,32,64
|
73
|
+
- float: 32,64,128
|
74
|
+
- float: IEEE 754 compilant
|
75
|
+
32 32-bit float registers f0,f1,..,f31
|
76
|
+
32 64-bit float registers f0,f2,..,f62
|
77
|
+
16 128-bit float registers f0,f4,..,f60
|
78
|
+
|
79
|
+
Description:
|
80
|
+
We need to raise up a dynamic stack frame.
|
81
|
+
Therefore we need to compute the stack size. We do this first,
|
82
|
+
in the context of the caller as a leaf function (using o3 as scratch for addition).
|
83
|
+
Then we raise the frame, ending up in o0-o3 is then i0-i3.
|
84
|
+
|
85
|
+
|
86
|
+
Stack Layout:
|
87
|
+
BIAS = 2047
|
88
|
+
|
89
|
+
BIAS+XX: should be 16 byte aligned.
|
90
|
+
...
|
91
|
+
136: argument overflow area
|
92
|
+
128: 1 extended word for struct/union poiner return value
|
93
|
+
BIAS+ 0: 16 extended words for registers (in/local) save area [register window]
|
94
|
+
|
95
|
+
|
96
|
+
Function Argument Passing:
|
97
|
+
- integer %o0..%o5 (caller view).
|
98
|
+
- floating-point %f0 .. %f15
|
99
|
+
- continuous memory starting at %sp+BIAS+136 (caller view).
|
100
|
+
|
101
|
+
Register Usage:
|
102
|
+
%fp0..%fp31 : floating-point arguments.
|
103
|
+
%sp or %o6 : stack pointer, always 8 (or 16?)-byte aligned.
|
104
|
+
%fp or %i6 : frame pointer.
|
105
|
+
%i0 and %o0 : integer and pointer return values.
|
106
|
+
%i7 and %o7 : return address. (caller puts return address to %o7, callee uses %i7)
|
107
|
+
%fp0 and %fp1: return value (float).
|
108
|
+
%i0..%i5 : input argument registers
|
109
|
+
%o0..%o5 : output argument registers
|
110
|
+
%g0 : always zero, writes to it have no effect.
|
111
|
+
|
112
|
+
Register Mappings:
|
113
|
+
r0-7 -> globals
|
114
|
+
r8-15 -> outs
|
115
|
+
r16-r23 -> locals
|
116
|
+
r24-r31 -> ins
|
117
|
+
|
118
|
+
Integer Register Overview Table:
|
119
|
+
ID Class Name Description
|
120
|
+
------------------------------------------------------------------------------
|
121
|
+
0 globals g0 always zero, writes to it have no effect
|
122
|
+
1 g1
|
123
|
+
2 g2
|
124
|
+
3 g3
|
125
|
+
4 g4
|
126
|
+
5 g5
|
127
|
+
6 g6
|
128
|
+
7 g7
|
129
|
+
8 out o0 [int/ptr] arg 0 and return
|
130
|
+
9 o1 arg 1
|
131
|
+
10 o2 arg 2
|
132
|
+
11 o3 arg 3
|
133
|
+
12 o4 arg 4
|
134
|
+
13 o5 arg 5
|
135
|
+
14 o6 stack pointer
|
136
|
+
15 o7
|
137
|
+
16 local l0 scratch
|
138
|
+
17 l1
|
139
|
+
18 l2
|
140
|
+
19 l3
|
141
|
+
20 l4
|
142
|
+
21 l5
|
143
|
+
22 l6
|
144
|
+
23 l7
|
145
|
+
24 in i0 [int/pt] arg 0 and return
|
146
|
+
25 i1
|
147
|
+
26 i2
|
148
|
+
27 i3
|
149
|
+
28 i4
|
150
|
+
29 i5
|
151
|
+
30 i6 frame pointer
|
152
|
+
31 i7
|
153
|
+
*/
|
154
|
+
|
155
|
+
/* ---------------------------------------------------------------------------
|
156
|
+
|
157
|
+
call kernel for sparc64 v9 abi
|
158
|
+
tested on sparc64/linux/debian [gcc54.fsffrance.org - thanx to the farm!]
|
159
|
+
|
160
|
+
new C Interface:
|
161
|
+
void dcCall_sparc (DCCallVM* callvm, DCpointer target);
|
162
|
+
%i0 %1
|
163
|
+
|
164
|
+
see dyncall_call_sparc.S for details.
|
165
|
+
|
166
|
+
old C Interface:
|
167
|
+
void dcCall_sparc (DCpointer target, DCsize size, DCpointer data);
|
168
|
+
%i0 , %i1 , %i2
|
169
|
+
Input:
|
170
|
+
i0 target
|
171
|
+
i1 size
|
172
|
+
i2 data
|
173
|
+
|
174
|
+
*/
|
175
|
+
/*
|
176
|
+
|
177
|
+
Package: dyncall
|
178
|
+
Library: dyncall
|
179
|
+
File: dyncall/dyncall_call_sparc64.S
|
180
|
+
Description: Call kernel for sparc64 v9 ABI.
|
181
|
+
License:
|
182
|
+
|
183
|
+
Copyright (c) 2011-2013 Daniel Adler <dadler@uni-goettingen.de>
|
184
|
+
|
185
|
+
Permission to use, copy, modify, and distribute this software for any
|
186
|
+
purpose with or without fee is hereby granted, provided that the above
|
187
|
+
copyright notice and this permission notice appear in all copies.
|
188
|
+
|
189
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
190
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
191
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
192
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
193
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
194
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
195
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
196
|
+
|
197
|
+
*/
|
198
|
+
|
199
|
+
#if 0
|
200
|
+
|
201
|
+
|
202
|
+
#define REGSIZE 8
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
#define SHEAD ((16+6)*8)
|
207
|
+
#define ALIGN 16
|
208
|
+
#define IREGS 6
|
209
|
+
#define FREGS 16
|
210
|
+
#define SREGS 16
|
211
|
+
#define IBASE 0
|
212
|
+
#define FBASE (IREGS*8)
|
213
|
+
|
214
|
+
// #define DHEAD ((IREGS+FREGS)*8)+SREGS*4
|
215
|
+
|
216
|
+
CALLVM_regdata = 72
|
217
|
+
CALLVM_size = 208
|
218
|
+
CALLVM_buffer = 216
|
219
|
+
|
220
|
+
#endif
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_sparc_v9.h
|
6
|
+
Description:
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2011-2013 Daniel Adler <dadler@uni-goettingen.de>
|
10
|
+
|
11
|
+
Permission to use, copy, modify, and distribute this software for any
|
12
|
+
purpose with or without fee is hereby granted, provided that the above
|
13
|
+
copyright notice and this permission notice appear in all copies.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
16
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
17
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
18
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
19
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
20
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
21
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
22
|
+
|
23
|
+
*/
|
24
|
+
|
25
|
+
|
26
|
+
#ifndef DYNCALL_CALL_SPARC_V9_H
|
27
|
+
#define DYNCALL_CALL_SPARC_V9_H
|
28
|
+
|
29
|
+
#include "dyncall_types.h"
|
30
|
+
|
31
|
+
#ifdef __cplusplus
|
32
|
+
extern "C" {
|
33
|
+
#endif
|
34
|
+
|
35
|
+
void dcCall_v9 (DCCallVM* vm, DCpointer target);
|
36
|
+
|
37
|
+
#ifdef __cplusplus
|
38
|
+
}
|
39
|
+
#endif
|
40
|
+
|
41
|
+
#endif /* DYNCALL_CALL_SPARC_v9_H */
|
42
|
+
|
@@ -0,0 +1,146 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_x64-att.S
|
6
|
+
Description: All x64 abi call kernel 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
|
+
#include "../portasm/portasm-x64-att.S"
|
28
|
+
|
29
|
+
BEGIN_ASM
|
30
|
+
|
31
|
+
/*---------------------------------------------------------------------------
|
32
|
+
|
33
|
+
Call Kernel for x64 System V
|
34
|
+
|
35
|
+
Input:
|
36
|
+
RDI : size of arguments to be passed via stack
|
37
|
+
RSI : pointer to arguments to be passed via the stack
|
38
|
+
RDX : pointer to arguments of integral/pointer type to be passed via registers
|
39
|
+
RCX : pointer to arguments of floating point type to be passed via registers
|
40
|
+
R8 : target function pointer
|
41
|
+
Notes:
|
42
|
+
RSP+8: is always 16-byte aligned (32-byte align if __m256 is used)
|
43
|
+
*/
|
44
|
+
|
45
|
+
GLOBAL(dcCall_x64_sysv)
|
46
|
+
BEGIN_PROC(dcCall_x64_sysv)
|
47
|
+
PUSH(RBP) /* Pseudo-prolog - preserve RBP. */
|
48
|
+
PUSH(RBX) /* Preserve RBX and store pointer to function in it. */
|
49
|
+
MOV(RSP,RBP) /* Store stack pointer in RBP. */
|
50
|
+
MOV(R8 ,RBX)
|
51
|
+
MOVSD(QWORD(RCX,0) ,XMM0) /* Copy first 8 floats to XMM0-XMM7. */
|
52
|
+
MOVSD(QWORD(RCX,8) ,XMM1)
|
53
|
+
MOVSD(QWORD(RCX,16),XMM2)
|
54
|
+
MOVSD(QWORD(RCX,24),XMM3)
|
55
|
+
MOVSD(QWORD(RCX,32),XMM4)
|
56
|
+
MOVSD(QWORD(RCX,40),XMM5)
|
57
|
+
MOVSD(QWORD(RCX,48),XMM6)
|
58
|
+
MOVSD(QWORD(RCX,56),XMM7)
|
59
|
+
|
60
|
+
ADD(LIT(31),RDI) /* Align stack to 32-byte. */
|
61
|
+
AND(LIT(-32),RDI)
|
62
|
+
ADD(LIT(8),RDI) /* Adjust by 8-byte for the return-address. */
|
63
|
+
SUB(RDI,RSP) /* Setup stack frame by subtracting the size of arguments. */
|
64
|
+
|
65
|
+
MOV(RDI,RCX) /* Store number of bytes to copy to stack in RCX (for rep movsb). */
|
66
|
+
MOV(RSP,RDI) /* Store pointer to beginning of stack arguments in RDI (for rep movsb). */
|
67
|
+
|
68
|
+
REP(MOVSB) /* copy bytes (@@@ should be optimized). */
|
69
|
+
|
70
|
+
MOV(QWORD(RDX,0),RDI) /* copy first six int/pointer arguments to RDI, RSI, RDX, RCX, R8, R9. */
|
71
|
+
MOV(QWORD(RDX,8),RSI)
|
72
|
+
MOV(QWORD(RDX,24),RCX)
|
73
|
+
MOV(QWORD(RDX,32),R8)
|
74
|
+
MOV(QWORD(RDX,40),R9)
|
75
|
+
MOV(QWORD(RDX,16),RDX) /* Set RDX last to not overwrite it to soon. */
|
76
|
+
|
77
|
+
MOVB(LIT(8),AL) /* Put upper bound of number of used xmm registers in AL. */
|
78
|
+
CALL_REG(RBX) /* Call function. */
|
79
|
+
|
80
|
+
MOV(RBP,RSP) /* Restore stack pointer. */
|
81
|
+
POP(RBX) /* Restore RBX. */
|
82
|
+
POP(RBP) /* Pseudo-epilog. */
|
83
|
+
RET()
|
84
|
+
END_PROC(dcCALl_x64_sysv)
|
85
|
+
|
86
|
+
/*---------------------------------------------------------------------------
|
87
|
+
|
88
|
+
Call Kernel for x64 Win64
|
89
|
+
|
90
|
+
Input:
|
91
|
+
RCX : size of arguments to be passed via stack
|
92
|
+
RDX : pointer to arguments to be passed via the stack
|
93
|
+
R8 : pointer to arguments of integral/pointer type to be passed via registers
|
94
|
+
R9 : target function pointer
|
95
|
+
|
96
|
+
*/
|
97
|
+
|
98
|
+
GLOBAL(dcCall_x64_win64)
|
99
|
+
BEGIN_PROC(dcCall_x64_win64)
|
100
|
+
|
101
|
+
PUSH(RBP) /* Pseudo-prolog - preserve RBP. */
|
102
|
+
PUSH(RSI) /* Preserve RSI and RDI. */
|
103
|
+
PUSH(RDI)
|
104
|
+
|
105
|
+
MOV(RSP,RBP) /* Store stack pointer in RBP. */
|
106
|
+
|
107
|
+
ADD(LIT(15),RCX) /* Align stack size to 16 bytes. */
|
108
|
+
AND(LIT(-16),RCX)
|
109
|
+
SUB(RCX,RSP) /* Setup stack frame by subtracting the size of the arguments. */
|
110
|
+
|
111
|
+
|
112
|
+
MOV(RDX, RSI) /* Let RSI point to the arguments. */
|
113
|
+
MOV(RSP, RDI) /* Store pointer to beginning of stack arguments in RDI (for rep movsb). */
|
114
|
+
MOV(R9, RAX) /* Put function address in RAX. */
|
115
|
+
|
116
|
+
REP(MOVSB) /* @@@ should be optimized (e.g. movq) */
|
117
|
+
|
118
|
+
MOV(QWORD(R8,0),RCX) /* Copy first four arguments to RCX, RDX, R9, R8 ( and XMM0-XMM3. ) */
|
119
|
+
MOV(QWORD(R8,8),RDX)
|
120
|
+
MOV(QWORD(R8,24),R9)
|
121
|
+
MOV(QWORD(R8,16),R8)
|
122
|
+
|
123
|
+
MOVD(RCX, XMM0)
|
124
|
+
MOVD(RDX, XMM1)
|
125
|
+
MOVD(R8, XMM2)
|
126
|
+
MOVD(R9, XMM3)
|
127
|
+
|
128
|
+
PUSH(R9) /* Push first four arguments onto the stack preserve area. */
|
129
|
+
PUSH(R8)
|
130
|
+
PUSH(RDX)
|
131
|
+
PUSH(RCX)
|
132
|
+
|
133
|
+
CALL_REG(RAX) /* Invoke function. */
|
134
|
+
|
135
|
+
MOV(RBP, RSP) /* Restore stack pointer (such that we can pop the preserved vALues). */
|
136
|
+
|
137
|
+
POP(RDI) /* Restore RSI and RDI. */
|
138
|
+
POP(RSI)
|
139
|
+
POP(RBP) /* Pseudo-epilog. */
|
140
|
+
|
141
|
+
RET()
|
142
|
+
|
143
|
+
END_PROC(dcCall_x64_win64)
|
144
|
+
|
145
|
+
END_ASM
|
146
|
+
|