2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. _rl78-function-attributes:
8 RL78 Function Attributes
9 ^^^^^^^^^^^^^^^^^^^^^^^^
11 These function attributes are supported by the RL78 back end:
13 .. index:: interrupt function attribute, RL78, brk_interrupt function attribute, RL78
15 .. rl78-fn-attr:: interrupt, brk_interrupt
17 These attributes indicate
18 that the specified function is an interrupt handler. The compiler generates
19 function entry and exit sequences suitable for use in an interrupt handler
20 when this attribute is present.
22 Use ``brk_interrupt`` instead of :rl78-fn-attr:`interrupt` for
23 handlers intended to be used with the ``BRK`` opcode (i.e. those
24 that must end with ``RETB`` instead of ``RETI``).
26 .. index:: naked function attribute, RL78
28 .. rl78-fn-attr:: naked
30 This attribute allows the compiler to construct the
31 requisite function declaration, while allowing the body of the
32 function to be assembly code. The specified function will not have
33 prologue/epilogue sequences generated by the compiler. Only basic
34 ``asm`` statements can safely be included in naked functions
35 (see :ref:`basic-asm`). While using extended ``asm`` or a mixture of
36 basic ``asm`` and C code may appear to work, they cannot be
37 depended upon to work reliably and are not supported.