[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You specify a function attribute in the declaration of the function. In addition to the standard ones (see section `Declaring Attributes of Functions' in Using and Porting GCC), Palm OS defines the following function attributes:
callseq (insns)
callseq
attribute is called using the assembly
language instructions in insns, which may implement a Palm OS systrap
or something more esoteric. The argument insns must be a string
literal.
Generally you won't use the callseq
attribute directly; instead, there
are macros defined in `PalmTypes.h'.
systrap (vector)
systrap
attribute specifies that the function should be called
using the Palm OS systrap mechanism. The integer vector may be either
a literal such as `0xa000' or a constant value such as an enumeration
constant. More complicated expressions are not permitted.
This attribute is deprecated and will be removed from a future version of prc-tools. New code should use callseq instead.
You shouldn't use the systrap
attribute directly; instead, you should
use the SYS_TRAP
macro defined in `CoreTraps.h'.
owngp
owngp
attribute causes the function
to save the A4 register on entry, and restore it on exit.
You shouldn't use owngp
directly; instead, you should use the macros
defined in `EntryPoints.h'.
extralogue (prologue, epilogue,...)
extralogue
attribute causes
the function to add code to its prologue and epilogue according to the
arguments given. See section 2.3 The extralogue
attribute and entry points, for details.
You shouldn't use extralogue
directly; instead, you should use the
macros defined in `EntryPoints.h'.
section (section-name)
In theory, the commonly used attributes differ in their "required visibilities":
systrap
or callseq
attribute is only important to anyone
calling the function. (You don't usually define such functions yourself
anyway.)
extralogue
or saves its
owngp
; these really only have effects when the code for that function
is generated.
section
is important both to itself (it
determines what section the code is put in) and to other functions calling
it (it can cause a special cross-section calling sequence to be emitted).
In practice, probably the best policy is to have exactly one declaration for each function that needs one, in a header file somewhere, and to use `-Wimplicit' (which is implied by `-Wall'), and possibly also `-Wmissing-declarations', to ensure that the declaration is visible when it needs to be (see section `Options to Request or Suppress Warnings' in Using and Porting GCC).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |