view release on metacpan or search on metacpan
dyncall/configure.bat view on Meta::CPAN
REM We have to transform some pathes for the nds/devkitPro build.
IF [%CONFIG_OS%]==[nds] (
REM Check if DEVKITPRO is set.
IF [%DEVKITPRO%]==[] (
ECHO ERROR: Environment variable DEVKITPRO must be set to absolute devkitPro path.
) ELSE (
buildsys\scripts\conf-nds.bat
)
)
REM Generate *nix style make files? @@@ maybe we should just always do that
IF [%CONFIG_MAKE%]==[make] (
FOR /F "USEBACKQ TOKENS=*" %%X IN (`CD`) DO (
FOR /R %%F IN (Makefile.generic) DO IF EXIST %%F (
ECHO VPATH = %%~dF%%~pF.>%%~pF%%~nF
ECHO include %%X\Makefile.config>>%%~pF%%~nF
ECHO include ${VPATH}\Makefile.generic>>%%~pF%%~nF
)
)
)
dyncall/doc/README.Generic view on Meta::CPAN
Embedded Mode
-------------
Makefile.generic makefiles are taken "as-is" without the need for extra configuration.
<VAR1>=<VALUE1> ... bsdmake -f Makefile.generic
<VAR1>=<VALUE1> ... gmake -f Makefile.generic
(Note that setting an env var as above (<VAR1>=<VALUE1>) before running a command is
shell specific. If your shell doesn't support this, set it according to the shell's
style.)
Example:
dyncall libraries should compile fine on most platforms:
BSDmake:
$ bsdmake -f Makefile.generic
GNUmake:
$ make -f Makefile.generic
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
118: 24020007 li v0,7 ; arg 7, and ...
11c: afa2001c sw v0,28(sp) ; ... "pushed" onto stack
120: 00002021 move a0,zero ; arg 0
124: 24050001 li a1,1 ; arg 1
128: 24060002 li a2,2 ; arg 2
12c: 24070003 li a3,3 ; arg 3
130: 8f990000 lw t9,0(gp) ; func to call -> t9
134: 0320f809 jalr t9 ; call and ret addr -> ra
138: 00000000 nop ; branch delay slot
13c: 8fdc0020 lw gp,32(s8) ; |
140: 00001021 move v0,zero ; : return value: not part of epilog, but unordered (branch delay slot style)
144: 03c0e821 move sp,s8 ; |
148: 8fbf002c lw ra,44(sp) ; | epilog
14c: 8fbe0028 lw s8,40(sp) ; |
150: 03e00008 jr ra ; |
154: 27bd0030 addiu sp,sp,48 ; |
; output from netbsd-5.0.2-pmax_mipsel_o32 w/ gcc 4.1.3 ----->
; nearly the same, equivalent to above except non-optimal use of branch delay slots and $gp preserving in leaf call
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
188: 24020009 li v0,9 ; push arg 7 ...
18c: afa2002c sw v0,44(sp) ; ... onto stack
190: 00002021 move a0,zero ; arg 0
194: 24050001 li a1,1 ; arg 1
198: 24060002 li a2,2 ; arg 2
19c: 24070003 li a3,3 ; arg 3
1a0: 8f990000 lw t9,0(gp) ; func to call -> t9
1a4: 0320f809 jalr t9 ; call and ret addr -> ra
1a8: 00000000 nop ; branch delay slot
1ac: 8fdc0030 lw gp,48(s8) ; |
1b0: 00001021 move v0,zero ; : return value: not part of epilog, but unordered (branch delay slot style)
1b4: 03c0e821 move sp,s8 ; |
1b8: 8fbf004c lw ra,76(sp) ; | epilog
1bc: 8fbe0048 lw s8,72(sp) ; |
1c0: 03e00008 jr ra ; |
1c4: 27bd0050 addiu sp,sp,80 ; |
...
; output from freebsd-12.0_r333647-malta_mipsebhf w/ gcc 4.2.1 *and* -mhard-float ----->
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
188: 24020009 li v0,9 ; push arg 7 ...
18c: afa2002c sw v0,44(sp) ; ... onto stack
190: 00002021 move a0,zero ; arg 0
194: 24050001 li a1,1 ; arg 1
198: 24060002 li a2,2 ; arg 2
19c: 24070003 li a3,3 ; arg 3
1a0: 8f990000 lw t9,0(gp) ; func to call -> t9
1a4: 0320f809 jalr t9 ; call and ret addr -> ra
1a8: 00000000 nop ; branch delay slot
1ac: 8fdc0030 lw gp,48(s8) ; |
1b0: 00001021 move v0,zero ; : return value: not part of epilog, but unordered (branch delay slot style)
1b4: 03c0e821 move sp,s8 ; |
1b8: 8fbf004c lw ra,76(sp) ; | epilog
1bc: 8fbe0048 lw s8,72(sp) ; |
1c0: 03e00008 jr ra ; |
1c4: 27bd0050 addiu sp,sp,80 ; |
...
; ---------- structs by value, complex example (multiple structs) ---------->
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
2b8: 8fc20098 lw v0,152(s8) ; | | f (via stack, first slot after save area)
2bc: afa20010 sw v0,16(sp) ; | | note that 20(sp) isn't used, so sizeof(struct A) is probably a padded 16
2c0: 8fc60090 lw a2,144(s8) ; | arg 2 (first struct A) i (via reg)
2c4: 8fc70094 lw a3,148(s8) ; | j (via reg)
2c8: 00002021 move a0,zero ; arg 0
2cc: 24050001 li a1,1 ; arg 1
2d0: 8f990000 lw t9,0(gp) ; func to call -> t9
2d4: 0320f809 jalr t9 ; call and ret addr -> ra
2d8: 00000000 nop ; branch delay slot
2dc: 8fdc0058 lw gp,88(s8) ; |
2e0: 00001021 move v0,zero ; : return value: not part of epilog, but unordered (branch delay slot style)
2e4: 03c0e821 move sp,s8 ; |
2e8: 8fbf00a4 lw ra,164(sp) ; | epilog
2ec: 8fbe00a0 lw s8,160(sp) ; |
2f0: 03e00008 jr ra ; |
2f4: 27bd00a8 addiu sp,sp,168 ; |
...
; output from freebsd-12.0_r333647-malta_mipsebhf w/ gcc 4.2.1 *and* -mhard-float ----->
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
2b8: 8fc20098 lw v0,152(s8) ; | | f (via stack, first slot after save area)
2bc: afa20010 sw v0,16(sp) ; | | note that 20(sp) isn't used, so sizeof(struct A) is probably a padded 16
2c0: 8fc60090 lw a2,144(s8) ; | arg 2 (first struct A) i (via reg)
2c4: 8fc70094 lw a3,148(s8) ; | j (via reg)
2c8: 00002021 move a0,zero ; arg 0
2cc: 24050001 li a1,1 ; arg 1
2d0: 8f990000 lw t9,0(gp) ; func to call -> t9
2d4: 0320f809 jalr t9 ; call and ret addr -> ra
2d8: 00000000 nop ; branch delay slot
2dc: 8fdc0058 lw gp,88(s8) ; |
2e0: 00001021 move v0,zero ; : return value: not part of epilog, but unordered (branch delay slot style)
2e4: 03c0e821 move sp,s8 ; |
2e8: 8fbf00a4 lw ra,164(sp) ; | epilog
2ec: 8fbe00a0 lw s8,160(sp) ; |
2f0: 03e00008 jr ra ; |
2f4: 27bd00a8 addiu sp,sp,168 ; |
...
; ---------- returning structs by value ---------->
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
88: 8fdc0010 lw gp,16(s8) ;
8c: 02001021 move v0,s0 ;
90: 27c30018 addiu v1,s8,24 ;
94: 24060028 li a2,40 ;
98: 00402021 move a0,v0 ;
9c: 00602821 move a1,v1 ;
a0: 8f990000 lw t9,0(gp) ;
a4: 0320f809 jalr t9 ;
a8: 00000000 nop ;
ac: 8fdc0010 lw gp,16(s8) ; |
b0: 02001021 move v0,s0 ; : return value (hidden ptr): not part of epilog, but unordered (branch delay slot style)
b4: 03c0e821 move sp,s8 ; |
b8: 8fbf0048 lw ra,72(sp) ; |
bc: 8fbe0044 lw s8,68(sp) ; | epilog
c0: 8fb00040 lw s0,64(sp) ; |
c4: 03e00008 jr ra ; |
c8: 27bd0050 addiu sp,sp,80 ; |
000000cc <main>:
cc: 3c1c0000 lui gp,0x0 ; |
d0: 279c0000 addiu gp,gp,0 ; |
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
1e0: afa20010 sw v0,16(sp) ; | arg 2 (struct C) b (via stack)
1e4: afa30014 sw v1,20(sp) ; | c (via stack)
1e8: 8fc70080 lw a3,128(s8) ; | a (via reg)
1ec: 8fc40094 lw a0,148(s8) ; arg 0 (struct A, via reg)
1f0: 8fc5008c lw a1,140(s8) ; | arg 1 (struct B, via regs) a
1f4: 8fc60090 lw a2,144(s8) ; | b
1f8: 8f990000 lw t9,0(gp) ; func to call -> t9
1fc: 0320f809 jalr t9 ; call and ret addr -> ra
200: 00000000 nop ; branch delay slot
204: 8fdc0048 lw gp,72(s8) ; |
208: 00001021 move v0,zero ; : return value: not part of epilog, but unordered (branch delay slot style)
20c: 03c0e821 move sp,s8 ; |
210: 8fbf009c lw ra,156(sp) ; | epilog
214: 8fbe0098 lw s8,152(sp) ; |
218: 03e00008 jr ra ; |
21c: 27bd00a0 addiu sp,sp,160 ; |
; output from freebsd-12.0_r333647-malta_mipsebhf w/ gcc 4.2.1 *and* -mhard-float ----->
dyncall/doc/disas_examples/mips.o32.disas view on Meta::CPAN
1c8: afa20010 sw v0,16(sp) ; | arg 2 (struct C) b (via stack)
1cc: afa30014 sw v1,20(sp) ; | c (via stack)
1d0: 8fc70080 lw a3,128(s8) ; | a (via reg)
1d4: 8fc40094 lw a0,148(s8) ; arg 0 (struct A, via reg)
1d8: 8fc5008c lw a1,140(s8) ; | arg 1 (struct B, via regs) a
1dc: 8fc60090 lw a2,144(s8) ; | b
1e0: 8f990000 lw t9,0(gp) ; func to call -> t9
1e4: 0320f809 jalr t9 ; call and ret addr -> ra
1e8: 00000000 nop ; branch delay slot
1ec: 8fdc0048 lw gp,72(s8) ; |
1f0: 00001021 move v0,zero ; : return value: not part of epilog, but unordered (branch delay slot style)
1f4: 03c0e821 move sp,s8 ; |
1f8: 8fbf009c lw ra,156(sp) ; | epilog
1fc: 8fbe0098 lw s8,152(sp) ; |
200: 03e00008 jr ra ; |
204: 27bd00a0 addiu sp,sp,160 ; |
...
; ---------- single-field structs by values (and small array fields) ---------->
dyncall/doc/disas_examples/mips64.n64.disas view on Meta::CPAN
14c: 0040202d move a0,v0 ; arg 0
150: 0060282d move a1,v1 ; arg 1
154: df990000 ld t9,0(gp) ; addr of callee -> t9
158: 0320f809 jalr t9 ; return address -> ra, and call
15c: 00000000 nop ; branch delay slot
160: 03c0e82d move sp,s8 ; |
164: dfbf0060 ld ra,96(sp) ; |
168: dfbe0058 ld s8,88(sp) ; |
16c: dfbc0050 ld gp,80(sp) ; | epilog
170: 03e00008 jr ra ; |
174: 67bd0070 daddiu sp,sp,112 ; | branch delay slot style
0000000000000178 <main>:
178: 67bdffe0 daddiu sp,sp,-32 ; |
17c: ffbf0010 sd ra,16(sp) ; |
180: ffbe0008 sd s8,8(sp) ; | prolog
184: ffbc0000 sd gp,0(sp) ; |
188: 03a0f02d move s8,sp ; |
18c: 3c1c0000 lui gp,0x0 ; @@@ unsure
190: 0399e02d daddu gp,gp,t9 ; @@@ unsure
194: 679c0000 daddiu gp,gp,0 ; @@@ unsure
dyncall/doc/disas_examples/mips64.n64.disas view on Meta::CPAN
1b4: 240b0007 li a7,7 ; arg 7
1b8: df990000 ld t9,0(gp) ; address of callee -> t9
1bc: 0320f809 jalr t9 ; return address -> ra, and call
1c0: 00000000 nop ; branch delay slot
1c4: 0000102d move v0,zero ; return value
1c8: 03c0e82d move sp,s8 ; |
1cc: dfbf0010 ld ra,16(sp) ; |
1d0: dfbe0008 ld s8,8(sp) ; |
1d4: dfbc0000 ld gp,0(sp) ; | epilog
1d8: 03e00008 jr ra ; |
1dc: 67bd0020 daddiu sp,sp,32 ; | branch delay slot style
; output from debian-sid_20150616-malta_mips64el_n64 w/ gcc 4.9.2
0000000000000000 <leaf_call>:
0: 67bdffd0 daddiu sp,sp,-48
4: ffbe0028 sd s8,40(sp)
8: 03a0f02d move s8,sp
c: 0080602d move t0,a0
dyncall/doc/manual/dyncall_logo.svg view on Meta::CPAN
inkscape:cy="397.87537"
inkscape:window-x="186"
inkscape:window-y="80"
inkscape:current-layer="g6" />
<title
id="title4">generated by pstoedit version:3.45 from dyncall_logo.eps</title>
<g
xml:space="preserve"
id="g6"
transform="matrix(2.2965446,0,0,2.2965446,-189.23706,135.3048)"
style="fill:#000000">
<g
stroke-miterlimit="10"
id="g8"
style="fill:#000000;fill-rule:evenodd;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 247.59,265.078 C 235.699,273.664 257.766,281.555 244.684,288.172 C 231.598,294.793 238.313,272.344 224.352,276.836 C 210.395,281.328 228.941,295.648 214.453,297.902 C 199.961,300.152 213.285,280.879 198.621,280.836 C 183.957,280.793 197.172,3...
id="path10"
style="fill:#000000" />
</g>
<g
stroke-miterlimit="10"
id="g12"
style="fill:#000000;stroke:#000000;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1">
<path
d="M 247.59,265.078 C 235.699,273.664 257.766,281.555 244.684,288.172 C 231.598,294.793 238.313,272.344 224.352,276.836 C 210.395,281.328 228.941,295.648 214.453,297.902 C 199.961,300.152 213.285,280.879 198.621,280.836 C 183.957,280.793 197.172,3...
id="path14"
style="fill:#000000;stroke:#000000;stroke-opacity:1" />
</g>
<g
stroke-miterlimit="10"
id="g16"
style="fill:#000000;fill-rule:nonzero;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 354.973,349.148 C 345.719,361.668 345.527,339.457 333.348,349.156 C 321.172,358.855 342.773,364.012 328.5,370.227 C 314.227,376.441 325.164,357.113 309.77,359.422 C 294.375,361.734 310.504,377 295.035,375.246 C 279.566,373.492 298.703,362.223...
id="path18"
style="fill:#000000" />
</g>
<g
stroke-miterlimit="10"
id="g20"
style="fill:#000000;stroke:#7f7f7f;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 354.973,349.148 C 345.719,361.668 345.527,339.457 333.348,349.156 C 321.172,358.855 342.773,364.012 328.5,370.227 C 314.227,376.441 325.164,357.113 309.77,359.422 C 294.375,361.734 310.504,377 295.035,375.246 C 279.566,373.492 298.703,362.223...
id="path22"
style="fill:#000000;stroke:none" />
</g>
<g
stroke-miterlimit="10"
id="g24"
style="fill:#000000;fill-rule:nonzero;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 307.188,310.25 C 307.188,312.992 304.969,315.223 302.238,315.223 C 299.504,315.223 297.289,312.992 297.289,310.25 C 297.289,307.504 299.504,305.277 302.238,305.277 C 304.969,305.277 307.188,307.504 307.188,310.25 z "
id="path26"
style="fill:#000000" />
</g>
<g
stroke-miterlimit="10"
id="g28"
style="fill:#000000;stroke:none;stroke-width:0.80376798;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 307.188,310.25 C 307.188,312.992 304.969,315.223 302.238,315.223 C 299.504,315.223 297.289,312.992 297.289,310.25 C 297.289,307.504 299.504,305.277 302.238,305.277 C 304.969,305.277 307.188,307.504 307.188,310.25 z "
id="path30"
style="fill:#ffffff;stroke:none" />
</g>
<g
stroke-miterlimit="10"
id="g32"
style="fill:#000000;fill-rule:nonzero;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 273.918,198.176 C 273.918,239.805 240.289,273.59 198.855,273.59 C 157.426,273.59 123.797,239.805 123.797,198.176 C 123.797,156.547 157.426,122.758 198.855,122.758 C 240.289,122.758 273.918,156.547 273.918,198.176 z "
id="path34"
style="fill:#000000" />
</g>
<g
stroke-miterlimit="10"
id="g36"
style="fill:#000000;stroke:#7f7f7f;stroke-width:0.80376798;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 273.918,198.176 C 273.918,239.805 240.289,273.59 198.855,273.59 C 157.426,273.59 123.797,239.805 123.797,198.176 C 123.797,156.547 157.426,122.758 198.855,122.758 C 240.289,122.758 273.918,156.547 273.918,198.176 z "
id="path38"
style="fill:#ffffff;stroke:none" />
</g>
<g
stroke-miterlimit="10"
id="g40"
style="fill:#000000;fill-rule:nonzero;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 203.785,198.195 C 203.785,200.941 201.566,203.168 198.836,203.168 C 196.105,203.168 193.887,200.941 193.887,198.195 C 193.887,195.449 196.105,193.223 198.836,193.223 C 201.566,193.223 203.785,195.449 203.785,198.195 z "
id="path42"
style="fill:#000000" />
</g>
<g
stroke-miterlimit="10"
id="g44"
style="fill:#000000;stroke:none;stroke-width:0.80376798;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 203.785,198.195 C 203.785,200.941 201.566,203.168 198.836,203.168 C 196.105,203.168 193.887,200.941 193.887,198.195 C 193.887,195.449 196.105,193.223 198.836,193.223 C 201.566,193.223 203.785,195.449 203.785,198.195 z "
id="path46"
style="fill:#000000;stroke:none" />
</g>
<g
stroke-miterlimit="10"
id="g48"
style="fill:#000000;fill-rule:nonzero;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
style="fill:#000000"
d="M 372.4375,226.8125 C 350.03614,226.99774 326.37254,235.86686 301.53125,253.375 L 368.53125,345.625 C 371.39273,344.04727 374.33807,342.1941 377.40625,339.96875 L 419.75,309.1875 C 431.09721,316.83039 443.82523,328.92944 457.9375,345.375 L 557....
transform="matrix(0.4354368,0,0,0.4354368,82.400777,-58.916687)"
id="path50"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccc" />
</g>
<g
stroke-miterlimit="10"
id="g52"
style="fill:#000000;fill-rule:nonzero;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
style="fill:#000000"
d="M 658.03125 626.5625 C 655.25013 626.68881 652.89528 628.64662 650.5 630.34375 C 645.86328 633.50839 641.64235 636.86247 638 641.6875 C 636.50265 643.53622 636.13403 645.73808 635.8125 648.3125 C 635.79309 648.61363 635.79586 648.91743 635.7812...
transform="matrix(0.4354368,0,0,0.4354368,82.400777,-58.916687)"
id="path54" />
</g>
</g></svg>
dyncall/doc/manual/dyncall_watermark.svg view on Meta::CPAN
height="1052.3622"
id="svg2">
<defs
id="defs57" />
<title
id="title4">generated by pstoedit version:3.45 from dyncall_logo.eps</title>
<g
transform="matrix(2.2965446,0,0,2.2965446,-189.23706,135.3048)"
id="g6"
xml:space="preserve"
style="fill:#000000">
<g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g20"
style="fill:#e6e6e6;stroke:#e6e6e6;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 354.973,349.148 C 345.719,361.668 345.527,339.457 333.348,349.156 C 321.172,358.855 342.773,364.012 328.5,370.227 C 314.227,376.441 325.164,357.113 309.77,359.422 C 294.375,361.734 310.504,377 295.035,375.246 C 279.566,373.492 298.703,362.223...
id="path22"
style="fill:#e6e6e6;stroke:#e6e6e6" />
</g><g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g28"
style="fill:#000000;stroke:#e6e6e6;stroke-width:0.80376798;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 307.188,310.25 C 307.188,312.992 304.969,315.223 302.238,315.223 C 299.504,315.223 297.289,312.992 297.289,310.25 C 297.289,307.504 299.504,305.277 302.238,305.277 C 304.969,305.277 307.188,307.504 307.188,310.25 z"
id="path30"
style="fill:#ffffff;stroke:#e6e6e6" />
</g><g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g12"
style="fill:#e6e6e6;stroke:#e6e6e6;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1">
<path
d="M 78.875,389 C 55.84276,389.43987 79.380834,426.65068 49.3125,426.5625 C 21.06764,426.48738 40.280391,393.75196 23.625,389.3125 L 23.625,827.3125 C 38.095155,821.66378 20.746118,790.57562 48.25,790.65625 C 80.322887,790.7503 51.209558,832.88991...
transform="matrix(0.4572086,0,0,0.4572086,176.55441,-80.651816)"
id="path14"
style="fill:#e6e6e6;stroke:#e6e6e6;stroke-width:1.74974835;stroke-opacity:1" />
</g><g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g36"
style="fill:#000000;stroke:#ffffff;stroke-width:0.80376798;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 48.78125,444.90625 C 40.23156,444.90625 31.823476,445.54431 23.625,446.8125 L 23.625,772.875 C 31.823476,774.14305 40.23156,774.78125 48.78125,774.78125 C 139.40509,774.78125 212.9375,700.89409 212.9375,609.84375 C 212.9375,518.79341 139.4050...
transform="matrix(0.4572086,0,0,0.4572086,176.55441,-80.651816)"
id="path38"
style="fill:#ffffff;stroke:#ffffff;stroke-width:1.75798965" />
</g><g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g44"
style="fill:#e6e6e6;stroke:#e6e6e6;stroke-width:0.80376798;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 203.785,198.195 C 203.785,200.941 201.566,203.168 198.836,203.168 C 196.105,203.168 193.887,200.941 193.887,198.195 C 193.887,195.449 196.105,193.223 198.836,193.223 C 201.566,193.223 203.785,195.449 203.785,198.195 z"
id="path46"
style="fill:#e6e6e6;stroke:#e6e6e6" />
</g><g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g48"
style="fill:#e6e6e6;fill-rule:nonzero;stroke:#e6e6e6;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 372.4375,226.8125 C 350.03614,226.99774 326.37254,235.86686 301.53125,253.375 L 368.53125,345.625 C 371.39273,344.04727 374.33807,342.1941 377.40625,339.96875 L 419.75,309.1875 C 431.09721,316.83039 443.82523,328.92944 457.9375,345.375 L 557....
transform="matrix(0.4354368,0,0,0.4354368,82.400777,-58.916687)"
id="path50"
style="fill:#e6e6e6;stroke:#e6e6e6" />
</g><g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g52"
style="fill:#e6e6e6;fill-rule:nonzero;stroke:#e6e6e6;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
<path
d="M 658.03125,626.5625 C 655.25013,626.68881 652.89528,628.64662 650.5,630.34375 C 645.86328,633.50839 641.64235,636.86247 638,641.6875 C 636.50265,643.53622 636.13403,645.73808 635.8125,648.3125 C 635.79309,648.61363 635.79586,648.91743 635.7812...
transform="matrix(0.4354368,0,0,0.4354368,82.400777,-58.916687)"
id="path54"
style="fill:#e6e6e6;stroke:#e6e6e6" />
</g>
<g
transform="matrix(0.7802343,0,0,0.7802343,-63.142369,43.042016)"
id="g32"
style="fill:#000000;fill-rule:nonzero;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10">
</g>
</g></svg>
dyncall/doc/manual/manual.tex view on Meta::CPAN
\usepackage{colortbl}
\usepackage{bigdelim}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{moreverb}
\usepackage{listings}
\usepackage{hyperref}
\ifnhtml{\usepackage{watermark}}
% Define own commands and style.
\newcommand{\dc}{\emph{dyncall}}
\newcommand{\capi}[1]{%
\noindent%
{\tt #1}%
}
\newcommand{\tab}{\indent}
\newcommand{\shell}[1]{\noindent{\tt #1}}
% Multiline table row with left or right curly brace.
dyncall/doc/manual/manual.tex view on Meta::CPAN
\newcolumntype{A}{p{\tablewidth}}
\newcolumntype{B}{p{\tablewidth}}
\newcolumntype{C}{p{\tablewidth}}
\newcolumntype{D}{p{\tablewidth}}
% listings package related settings
\lstset{captionpos=b}
\lstset{frame=tblr}
\lstset{frameround=tttt}
\lstset{basicstyle=\ttfamily}
% text building blocks
\newcommand{\group}[1]{\textit{$<$#1$>$}}
\newcommand{\sigchar}[1]{'{\tt #1}'}
\newcommand{\sigstr}[1]{"{\tt #1}"}
\newcommand{\cenum}[1]{#1}
\newcommand{\product}[1]{\emph{#1}}
% table of contents config
dyncall/doc/manual/manual_devel.tex view on Meta::CPAN
\item [suite]
All combinations of parameter types and counts are tested on void function
calls. A Python script ({\tt mkcase.py}) generates the tests up to
an upper MAXARG limit.
\item [suite\_floats]
Based on suite. Test double/float variants with up to 10 arguments.
\item [call\_suite\_aggrs]
Tests passing and returning aggregates by value (struct/union and array members).
Test cases can be designed in a signature-style format (and random ones generated
via a Lua script).
\item [suite\_x86win32std]
All combinations of parameter types and counts are tested on {\tt \_\_stdcall}
void function calls. A Python script ({\tt mkcase.py}) generates
the tests up to an upper MAXARG limit. This is a x86/Windows only test.
\item [suite\_x86win32fast]
All combinations of parameter types and counts are tested on {\tt \_\_fastcall}
(MS or GNU, depending on the build tool) void function calls.
dyncall/doc/manual/manual_devel.tex view on Meta::CPAN
\item [suite3]
All combinations of parameter types integer, long long, float and double and
counts are tested on void function calls.
A script written in Python ({\tt mkcase.py}) generates the tests up to
an upper MAXARG limit.
This is a modified version of suite.
\item [call\_suite]
General purpose test suite combining aspects from all others suites (usually enough for
testing non-callback calls).
Test cases can be designed in a signature-style format (and random ones generated
via a Lua script).
\item [callf]
Tests the \emph{formatted call/arg} \product{dyncall} C API. Tries to cover all uses of
that API (e.g. calling convention mode switches, aggregates, ...) but is not extensive.
\item [malloc\_wx]
Tests \emph{writable and executable memory allocation} used by the
\product{dyncallback} C API.
dyncall/doc/manual/manual_dyncall_api.tex view on Meta::CPAN
\section{\emph{Dyncall} C library API}
See the dyncall(3) manpage for more information.
%@@@ removed, as manpages are more precise and up to date ------------------->
%The library provides low-level functionality to make foreign function calls
%from different run-time environments. The flexibility is constrained by the
%set of supported types.
%
%\paragraph{C interface style conventions}
%
%This manual and the \product{dyncall} library's C interface {\tt "dyncall.h"}
%use the following C source code style.
%
%
%\begin{table}[h]
%\begin{center}
%\begin{tabular*}{0.8\textwidth}{llll}
%Subject & C symbol & Details & Example \\
%\hline
%Types & {\tt DC\group{type name}} & lower-case & \capi{DCint}, \capi{DCfloat}, \capi{DClong}, \ldots\\
%Structures & {\tt DC\group{structure name}} & camel-case & \capi{DCCallVM}\\
%Functions & {\tt dc\group{function name}} & camel-case & \capi{dcNewCallVM}, \capi{dcArgInt}, \ldots\\
dyncall/doc/manual/manual_dyncall_api.tex view on Meta::CPAN
%
%\begin{lstlisting}[language=c]
%void dcArgF (DCCallVM*, const DCsigchar*, ...);
%void dcVArgF (DCCallVM*, const DCsigchar*, va_list);
%void dcCallF (DCCallVM*, DCValue*, DCpointer, const DCsigchar*, ...);
%void dcVCallF(DCCallVM*, DCValue*, DCpointer, const DCsigchar*, va_list);
%\end{lstlisting}
%
%\paragraph{Details}
%
%These functions can be used to operate \product{dyncall} via a printf-style
%functional interface, using a signature string encoding the argument types and
%return type (and optionally also the calling convention used).
%\capi{dcArgF()} and \capi{dcVArgF()} just bind arguments to the \capi{DCCallVM}
%object, so any return value specified in the signature is ignored. \capi{dcCallF()}
%and \capi{dcVCallF()} also take a function pointer to call after binding the arguments.
%The return value will be stored in what \lstinline{result} points to.
%For more information about the signature format, refer to \ref{sigchar}.
%
dyncall/doc/manual/manual_dyncallback_api.tex view on Meta::CPAN
%This library extends \product{dyncall} with function callback support, allowing
%the user to dynamically create a callback object that can be called directly,
%or passed to functions expecting a function-pointer as argument.\\
%\\
%Invoking a \product{dyncallback} calls into a user-defined unified handler that
%permits iteration and thus dynamic handling over the called-back-function's
%parameters.\\
%\\
%The flexibility is constrained by the set of supported types, though.\\
%\\
%For style conventions and supported types, see \product{dyncall} API section.
%In order to use \product{dyncallback}, include {\tt "dyncall\_callback.h"}.
%
%\subsection{Callback Object}
%
%The \emph{Callback Object} is the core component to this library.
%
%\paragraph{Types}
%
%\begin{lstlisting}[language=c]
%typedef struct DCCallback DCCallback;
dyncall/doc/manual/manual_tex4ht.cfg view on Meta::CPAN
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{BODY}{\HCode{\Hnewline<body>\Hnewline<div class="mainDiv">\Hnewline}}{\HCode{\Hnewline</div></body>}} % KEEP the body on it's own line, as it's used as a marker for postprocessing.
% TITLE+ is only on main page, other use section title. Prefix everything, though.
\Configure{TITLE}{\HCode{<title>}dyncall Manual - }{\HCode{</title>}}
\Configure{TITLE+}{Index}
% Clear default header, define our custom one. Using @HEAD will make this be used on all pages generated.
% @@@Ideally, this wouldn't be a copy&paste of the website's header, here. Such
% thing should be done in the website build, and this here a generic header
% (however, style is kinda needed).
\Configure{@HEAD}{}
\Configure{@HEAD}{\HCode{<meta http-equiv="content-type" content="text/html; charset=utf-8"/>\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="resource-type" content="document"/>\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="keywords" content="C, function, dynamic, call, calling, convention, VM, abstraction, closure"/>\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="distribution" content="global"/>\Hnewline}}
% should this really rely on online content (dyncall's .css) even for an offline build? @@@ also, we need a relative path here, so this complicates things further
\Configure{@HEAD}{\HCode{<link rel="stylesheet" href="/data/main.css" type="text/css" media="all"/>\Hnewline}}
% Image path prefix can be set here...
%\Configure{IMG}
%{\ht:special{t4ht=<img src="}}
%{\ht:special{t4ht=" alt="}}
%{" }
%{\ht:special{t4ht=" }}
%{\ht:special{t4ht=/>}}
% Make TOC display as nested "ul"s.
dyncall/doc/manual/manual_tex4ht.cfg view on Meta::CPAN
%\ConfigureEnv{lstlisting}{\listingLineReset\Tg<div class="ttDiv">}{\Tg</div>}{}{}
%\Configure{listings}{}{}{}{\ifnum \lstlineno>0 \Tg<br> \fi \listingLine}
% Make listing/table captions nicer.
\Configure{caption}
{\HCode{<div class="blockCaption"><small>}}
{\HCode{<span class="id">}}
{\HCode{</span>: <span class="content">}}
{\HCode{</span></small></div>}}
% All kinds of style setting for fonts, as we don't use the autogenerated
% css file, but dyncall's website one.
\Configure{texttt}{\Tg<span style="background-color:red">}{\Tg</span>}
\Configure{textrm}{\Tg<span style="background-color:red">}{\Tg</span>}
\Configure{textup}{\Tg<span style="background-color:red">}{\Tg</span>}
\Configure{textsl}{\Tg<span style="background-color:red">}{\Tg</span>}
\Configure{textsf}{\Tg<span style="background-color:red">}{\Tg</span>}
\Configure{textsc}{\Tg<span style="background-color:red">}{\Tg</span>}
\Configure{textit}{\Tg<i>}{\Tg</i>}
\Configure{textbf}{\Tg<b>}{\Tg</b>}
\Configure{emph}{\Tg<em>}{\Tg</em>}
% @@@ list of things that are still open:
% paragraph{xxx} - should probably be forced to always be on newline to reflect pdf
%\lstset{ language=C, basicstyle=\ttfamily, numbers=left,
%numberstyle=\tiny, numbersep=10pt, showstringspaces=false}
%http://www.itisnotoverengineering.com/2013/06/syntax-highlighting-with-tex4ht.html
% Simplest possible paragraphs.
% Note, we don't use the optional </p> end tags, as we would end up wrapping block level
% elements like <table> in <p>...</p> pairs.
\Configure{HtmlPar}{\EndP\Tg<p>}{\EndP\Tg<p>}{\HCode{\Hnewline}}{\HCode{\Hnewline}}
% On site navigation texts
dyncall/doc/manual/manual_tex4ht.cfg view on Meta::CPAN
% Which nav links to show
\Configure{crosslinks*}%
{prev}%
{up}%
{next}%
{}%
% What's around top and bottom links section
\Configure{crosslinks+}%
{\HCode{<div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}%
{\HCode{</div></div><hr>}}%
{\HCode{<hr><div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}%
{\HCode{</div></div>}}%
% Hacky - output div stuff before specific crosslinks, has to play together with crosslinks+, above
\Configure{crosslinks:next}{\HCode{</div><div style="width:30\%;display:inline-block;text-align:right">}}
\Configure{crosslinks:up} {\HCode{</div><div style="width:40\%;display:inline-block;text-align:center">}}
%\ConfigureEnv{titlepage}
%{\ifvmode \IgnorePar\fi
% \EndP
% \HCode{<h1>}\IgnorePar }
%{\ifvmode \IgnorePar\fi
% \EndP \HCode{</h1>}}
%{}
%{}
dyncall/dyncall/README.txt view on Meta::CPAN
Library Design
Overview:
1. Call Kernel
2. Utilities (memory and static sized vectors)
3. Call State Machine
4. Application Programming Interface
5. extension: high-level formatted C API (ellipsis style)
1. Call Kernel
Assembly Implementation:
gcc front-end: dyncall_call.S
uses the C preprocessor
will include the apropriate assembly source
dyncall/dyncall/README.txt view on Meta::CPAN
C Header:
Top-level: dyncall.h
Sub-level headers:
dyncall_macros.h
dyncall_config.h
dyncall_types.h
C Implementation: dyncall_api.c
5. Extension: High-level C API (ellipsis style)
C Header:
Top-level: dyncall_callf.h
Sub-level headers:
dyncall_value.h
dyncall_signature.h
C Implementation: dyncall_callf.c
dyncall/dyncall/dyncall.3 view on Meta::CPAN
provide such copies, manually, where needed (e.g. when passing such an
aggregate as an argument by-value, using
.Fn dcArgAggr ,
in order to preserver the call's by-value semantics).
.Pp
.Fn dcArgF ,
.Fn dcVArgF ,
.Fn dcCallF
and
.Fn dcVCallF
can be used to bind arguments in a printf-style call, using a signature
string encoding the argument and return types. The former 2 only bind
the arguments to the
.Ar vm
object (and ignore return types specified in the
signature), whereas the latter two issue a call to the given function pointer,
afterwards. The return value will be stored in
.Ar result .
The signature string also features calling convention mode selection.
For information about the signature format, refer to dyncall_signature.h or the
.Nm
dyncall/dynload/dynload.h view on Meta::CPAN
extern "C" {
#endif
#ifndef DL_API
#define DL_API
#endif
/* shared library loading and explicit symbol resolving */
/* dlLoadLibrary will search for specified lib (e.g. as leaf name, only), */
/* following platforms' dynamic linking style, returns NULL on error */
typedef struct DLLib_ DLLib;
DL_API DLLib* dlLoadLibrary (const char* libPath);
DL_API void dlFreeLibrary (DLLib* pLib);
DL_API void* dlFindSymbol (DLLib* pLib, const char* pSymbolName);
DL_API int dlGetLibraryPath(DLLib* pLib, char* sOut, int bufSize);
/* symbol table enumeration - only for symbol lookup, not resolve */
dyncall/test/common/platformInit.c view on Meta::CPAN
/* Set the colour of the font. */
/* BG_PALETTE_SUB[255] = RGB15(25, 11, 9); */
/* consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); */
consoleDemoInit();
}
void dcTest_deInitPlatform()
{
/* Main loop - console style. */
while(1) {
swiWaitForVBlank();
}
}
#elif defined(DC__OS_PSP)
PSP_MODULE_INFO("dyncall_test",0,1,1);