Difference between revisions of "Template:Syscall"

From WikiPrizm
Jump to navigationJump to search
m (Remove reorganization notice; it's not really true anymore.)
 
(23 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
* 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:
 
The remaining arguments will be used to form the contents of sections of the same name, which will not be shown if not provided:
 +
* Synopsis
 
* Parameters
 
* Parameters
 
* Returns
 
* Returns
 
* Comments
 
* Comments
 
* Example
 
* Example
 +
By using this template, the page will automatically be added to [[:Category:Syscalls]]. If you don't want that for whatever reason, pass the parameter <tt>nocat</tt> with any text (eg <tt>nocat=true</tt>).  See the source code of this page for an example.
  
You'll probably want to do a straight-up inclusion of the template into pages for ease of editing. For example:
+
You'll usually just want to transclude this template. For example:
 
  <nowiki>{{syscall
 
  <nowiki>{{syscall
 
| name = FakeSyscall
 
| name = FakeSyscall
Line 28: Line 30:
 
| header = syscall_example.h
 
| header = syscall_example.h
 
| comments = This syscall does '''nothing'''.
 
| comments = This syscall does '''nothing'''.
 +
| nocat = true
 
}}
 
}}
 
</div>
 
</div>
Line 38: Line 41:
 
   
 
   
 
  SYSCALL(_Bdisp_PutDisp_DD, 0x025F)
 
  SYSCALL(_Bdisp_PutDisp_DD, 0x025F)
We can see that the index of this one is 0x25F, then.
+
We can see that the index of this one is 0x025F, then.
 +
 
 +
If you are trying to find the header that provides a function that's already documented, just search the libfxcg include directory, such as with grep:
 +
grep -R libfxcg/include function
 
</noinclude>
 
</noinclude>
<includeonly>{{DISPLAYTITLE:{{{name}}}}}{{mbox
+
<includeonly>
| text = Syscall headers and names are in flux while [[libfxcg]] is being overhauled.  This information may be out of date.  When in doubt, use ''grep''.
 
::[[User:Tari|Tari]] 20:04, 14 May 2012 (UTC)
 
| style = background-color: #fc9
 
}}
 
 
== Synopsis ==
 
== Synopsis ==
'''Header:''' {{{header|}}}
+
'''Header:''' {{{header|[[Template:Syscall#Finding_information|Not documented]]}}} <br />
'''Syscall index:''' {{{index|[[Template:Syscall#Finding_information|Unknown]]}}}
+
'''Syscall index:''' {{{index|[[Template:Syscall#Finding_information|Not documented]]}}} <br />
'''Function signature:''' {{{signature|[[Template:Syscall#Finding_information|Unknown]]}}}
+
'''Function signature:''' {{{signature}}}
 
+
{{ #if: {{{synopsis|}}}
{{ #if: {{{parameters|}}}
+
|<br /><br />{{{synopsis}}} | }}{{ #if: {{{parameters|}}}
|
+
|<br />
 
== Parameters ==
 
== Parameters ==
{{{parameters|}}}
+
{{{parameters}}} | }}{{ #if: {{{returns|}}}
| }}
+
|<br />
 
 
{{ #if: {{{returns|}}}
 
|
 
 
== Returns ==
 
== Returns ==
{{{returns}}}
+
{{{returns}}} | }}{{ #if: {{{comments|}}}
| }}
+
|<br />
 
 
{{ #if: {{{comments|}}}
 
|
 
 
== Comments ==
 
== Comments ==
{{{comments}}}
+
{{{comments}}} | }}{{ #if: {{{example|}}}
| }}
+
|<br />
 
 
{{ #if: {{{example|}}}
 
|
 
 
== Example ==
 
== Example ==
{{{example}}}
+
{{{example}}} | }}
| }}
+
{{ #if: {{{nocat|}}} | |
 
+
[[Category:Syscalls|{{{name}}}]]
[[Category:Syscalls|{{{1}}}]]</includeonly>
+
}}</includeonly>

Latest revision as of 12:07, 29 July 2014

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:

  • Synopsis
  • Parameters
  • Returns
  • Comments
  • Example

By using this template, the page will automatically be added to Category:Syscalls. If you don't want that for whatever reason, pass the parameter nocat with any text (eg nocat=true). See the source code of this page for an example.

You'll usually just want to transclude this template. For example:

{{syscall
| name = FakeSyscall
| index = 0x0000
| signature = void FakeSyscall(void)
| header = syscall_example.h
| comments = This syscall does '''nothing'''.
}}

Will render as follows:


Synopsis

Header: syscall_example.h
Syscall index: 0x0000
Function signature: void FakeSyscall(void)

Comments

This syscall does nothing.

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 0x025F, then.

If you are trying to find the header that provides a function that's already documented, just search the libfxcg include directory, such as with grep:

grep -R libfxcg/include function