Next: , Previous: saveds, Up: Attributes


3.3 interrupt

This attribute should be used for any kind of callback functions that can be called from outside your task. This includes interrupt handlers, shared library functions, etc.

Most often, the ‘interrupt’ attribute is only necessary if a program is compiled with stack checking or extension (see -mstackcheck, see -mstackextend). It will prevent the compiler from generating stack checking or extension code for the function it was specified for.

Additionally, it will set ‘CC’ (condition codes register) in the function epilogue to return value, by performing tstl d0.

Note: For compatibility with other AmigaOS ‘C’ compilers, a preprocessor symbol ‘__interrupt’ is available, which expands to __attribute__((interrupt)) (see Keyword macros).

The ‘interrupt’ attribute is mutually exclusive with the ‘stackext’ attribute (see stackext).

This attribute is not necessary in function declarations (prototypes).

This attribute was first made available in the ‘GCC’ 2.7.2.1, ‘Geek Gadgets’ snapshot ‘961012’.