.. Copyright 1988-2022 Free Software Foundation, Inc. This is part of the GCC manual. For copying conditions, see the copyright.rst file. .. _rx-function-attributes: RX Function Attributes ^^^^^^^^^^^^^^^^^^^^^^ These function attributes are supported by the RX back end: .. index:: fast_interrupt function attribute, RX .. rx-fn-attr:: fast_interrupt Use this attribute on the RX port to indicate that the specified function is a fast interrupt handler. This is just like the :rx-fn-attr:`interrupt` attribute, except that ``freit`` is used to return instead of ``reit``. .. index:: interrupt function attribute, RX .. rx-fn-attr:: 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. On RX and RL78 targets, you may specify one or more vector numbers as arguments to the attribute, as well as naming an alternate table name. Parameters are handled sequentially, so one handler can be assigned to multiple entries in multiple tables. One may also pass the magic string ``"$default"`` which causes the function to be used for any unfilled slots in the current table. This example shows a simple assignment of a function to one vector in the default table (note that preprocessor macros may be used for chip-specific symbolic vector names): .. code-block:: c++ void __attribute__ ((interrupt (5))) txd1_handler (); This example assigns a function to two slots in the default table (using preprocessor macros defined elsewhere) and makes it the default for the ``dct`` table: .. code-block:: c++ void __attribute__ ((interrupt (RXD1_VECT,RXD2_VECT,"dct","$default"))) txd1_handler (); .. index:: naked function attribute, RX .. rx-fn-attr:: 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 :ref:`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. .. index:: vector function attribute, RX .. rx-fn-attr:: vector This RX attribute is similar to the :rx-fn-attr:`interrupt` attribute, including its parameters, but does not make the function an interrupt-handler type function (i.e. it retains the normal C function calling ABI). See the :rx-fn-attr:`interrupt` attribute for a description of its arguments.