Difference between revisions of "Template:Syscall"
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
== Usage notes == | == Usage notes == | ||
− | This template takes | + | This template takes a number of arguments. The following should be included for all routines: |
* Name | * Name | ||
* Index (the number of the call) | * Index (the number of the call) | ||
* Function signature | * Function signature | ||
* Header containing the prototype (in libfxcg) | * Header containing the prototype (in libfxcg) | ||
+ | The remaining arguments will be used to form the contents of sections of the same name, which will not be shown if not provided: | ||
+ | * Parameters | ||
+ | * Returns | ||
+ | * Comments | ||
+ | * Example | ||
You'll probably want to do a straight-up inclusion of the template into pages for ease of editing. For example: | You'll probably want to do a straight-up inclusion of the template into pages for ease of editing. For example: | ||
− | <nowiki>{{ | + | <nowiki>{{syscall |
+ | | name = FakeSyscall | ||
+ | | index = 0x0000 | ||
+ | | signature = void FakeSyscall(void) | ||
+ | | header = syscall_example.h | ||
+ | | parameters = None! | ||
+ | | | ||
+ | }}</nowiki> | ||
This will fill in the template contents when you save the page. | This will fill in the template contents when you save the page. | ||
Line 20: | Line 32: | ||
We can see that the index of this one is 0x25F, then. | We can see that the index of this one is 0x25F, then. | ||
</noinclude> | </noinclude> | ||
− | {{DISPLAYTITLE:{{{ | + | {{DISPLAYTITLE:{{{name}}}}} |
== Synopsis == | == Synopsis == | ||
− | '''Header:''' {{{ | + | '''Header:''' {{{header|}}} |
− | '''Syscall index:''' {{{ | + | '''Syscall index:''' {{{index|[[Template:Syscall#Finding_information|Unknown]]}}} |
− | '''Function signature:''' {{{ | + | '''Function signature:''' {{{signature|[[Template:Syscall#Finding_information|Unknown]]}}} |
− | == | + | {{ #if: {{{parameters|}}} |
+ | | | ||
+ | == Parameters == | ||
+ | {{{parameters|}}} | ||
+ | | }} | ||
+ | {{ #if: {{{returns|}}} | ||
+ | | | ||
== Returns == | == Returns == | ||
+ | {{{returns}}} | ||
+ | | }} | ||
+ | {{ #if: {{{comments|}}} | ||
+ | | | ||
== Comments == | == Comments == | ||
+ | {{{comments}}} | ||
+ | | }} | ||
+ | {{ #if: {{{example|}}} | ||
+ | | | ||
== Example == | == Example == | ||
+ | {{{example}}} | ||
+ | | }} | ||
<includeonly>[[Category:Syscalls|{{{1}}}]]</includeonly> | <includeonly>[[Category:Syscalls|{{{1}}}]]</includeonly> |
Revision as of 16:26, 14 May 2012
Usage notes
This template takes a number of arguments. The following should be included for all routines:
- Name
- Index (the number of the call)
- Function signature
- Header containing the prototype (in libfxcg)
The remaining arguments will be used to form the contents of sections of the same name, which will not be shown if not provided:
- Parameters
- Returns
- Comments
- Example
You'll probably want to do a straight-up inclusion of the template into pages for ease of editing. For example:
{{syscall | name = FakeSyscall | index = 0x0000 | signature = void FakeSyscall(void) | header = syscall_example.h | parameters = None! | }}
This will fill in the template contents when you save the page.
Further information on template usage can be found in the MediaWiki User Guide.
Finding information
If you're documenting syscalls that are already in libfxcg but don't know the index, you can find it by looking at the source. Each call is in its own file. For example, the definition for Bdisp_PutDisp_DD is in libfxcg/syscalls/Bdisp_PutDisp_DD.S, which looks like this:
#include <asm.h> SYSCALL(_Bdisp_PutDisp_DD, 0x025F)
We can see that the index of this one is 0x25F, then.
Synopsis
Header:
Syscall index: Unknown
Function signature: Unknown