Next: MSP430 Function Attributes, Previous: Microsoft Windows Function Attributes, Up: Function Attributes
These function attributes are supported by the MIPS back end:
interrupt
eic
. When interrupts are non-masked then the requested Interrupt
Priority Level (IPL) is copied to the current IPL which has the effect of only
enabling higher priority interrupts. To use vectored interrupt mode use
the argument vector=[sw0|sw1|hw0|hw1|hw2|hw3|hw4|hw5]
, this will change
the behavior of the non-masked interrupt support and GCC will arrange to mask
all interrupts from sw0 up to and including the specified interrupt vector.
You can use the following attributes to modify the behavior of an interrupt handler:
use_shadow_register_set
intstack
is
supported to indicate that the shadow register set contains a valid stack
pointer.
keep_interrupts_masked
use_debug_exception_return
deret
instruction. Interrupt handlers that don't
have this attribute return using eret
instead.
You can use any combination of these attributes, as shown below:
void __attribute__ ((interrupt)) v0 (); void __attribute__ ((interrupt, use_shadow_register_set)) v1 (); void __attribute__ ((interrupt, keep_interrupts_masked)) v2 (); void __attribute__ ((interrupt, use_debug_exception_return)) v3 (); void __attribute__ ((interrupt, use_shadow_register_set, keep_interrupts_masked)) v4 (); void __attribute__ ((interrupt, use_shadow_register_set, use_debug_exception_return)) v5 (); void __attribute__ ((interrupt, keep_interrupts_masked, use_debug_exception_return)) v6 (); void __attribute__ ((interrupt, use_shadow_register_set, keep_interrupts_masked, use_debug_exception_return)) v7 (); void __attribute__ ((interrupt("eic"))) v8 (); void __attribute__ ((interrupt("vector=hw3"))) v9 ();
long_call
near
far
long_call
and far
attributes are
synonyms, and cause the compiler to always call
the function by first loading its address into a register, and then using
the contents of that register. The near
attribute has the opposite
effect; it specifies that non-PIC calls should be made using the more
efficient jal
instruction.
mips16
nomips16
mips16
and nomips16
function attributes to locally select or turn off MIPS16 code generation.
A function with the mips16
attribute is emitted as MIPS16 code,
while MIPS16 code generation is disabled for functions with the
nomips16
attribute. These attributes override the
-mips16 and -mno-mips16 options on the command line
(see MIPS Options).
When compiling files containing mixed MIPS16 and non-MIPS16 code, the
preprocessor symbol __mips16
reflects the setting on the command line,
not that within individual functions. Mixed MIPS16 and non-MIPS16 code
may interact badly with some GCC extensions such as __builtin_apply
(see Constructing Calls).
micromips, MIPS
nomicromips, MIPS
micromips
and nomicromips
function attributes to locally select or turn off microMIPS code generation.
A function with the micromips
attribute is emitted as microMIPS code,
while microMIPS code generation is disabled for functions with the
nomicromips
attribute. These attributes override the
-mmicromips and -mno-micromips options on the command line
(see MIPS Options).
When compiling files containing mixed microMIPS and non-microMIPS code, the
preprocessor symbol __mips_micromips
reflects the setting on the
command line,
not that within individual functions. Mixed microMIPS and non-microMIPS code
may interact badly with some GCC extensions such as __builtin_apply
(see Constructing Calls).
nocompression
nocompression
function attribute
to locally turn off MIPS16 and microMIPS code generation. This attribute
overrides the -mips16 and -mmicromips options on the
command line (see MIPS Options).