Next: , Previous: , Up: Function Attributes   [Contents][Index]


6.31.19 MSP430 Function Attributes

These function attributes are supported by the MSP430 back end:

critical

Critical functions disable interrupts upon entry and restore the previous interrupt state upon exit. Critical functions cannot also have the naked or reentrant attributes. They can have the interrupt attribute.

interrupt

Use this attribute to indicate that the specified function is an interrupt handler. The compiler generates function entry and exit sequences suitable for use in an interrupt handler when this attribute is present.

You can provide an argument to the interrupt attribute which specifies a name or number. If the argument is a number it indicates the slot in the interrupt vector table (0 - 31) to which this handler should be assigned. If the argument is a name it is treated as a symbolic name for the vector slot. These names should match up with appropriate entries in the linker script. By default the names watchdog for vector 26, nmi for vector 30 and reset for vector 31 are recognized.

naked

This attribute allows the compiler to construct the requisite function declaration, while allowing the body of the function to be assembly code. The specified function will not have prologue/epilogue sequences generated by the compiler. Only basic asm statements can safely be included in naked functions (see Basic Asm). While using extended asm or a mixture of basic asm and C code may appear to work, they cannot be depended upon to work reliably and are not supported.

reentrant

Reentrant functions disable interrupts upon entry and enable them upon exit. Reentrant functions cannot also have the naked or critical attributes. They can have the interrupt attribute.

wakeup

This attribute only applies to interrupt functions. It is silently ignored if applied to a non-interrupt function. A wakeup interrupt function will rouse the processor from any low-power state that it might be in when the function exits.


Next: , Previous: , Up: Function Attributes   [Contents][Index]