| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 | <div class="subsection-level-extent" id="RX-Function-Attributes"> <div class="nav-panel"> <p> Next: <a href="s_002f390-function-attributes" accesskey="n" rel="next">S/390 Function Attributes</a>, Previous: <a href="rl78-function-attributes" accesskey="p" rel="prev">RL78 Function Attributes</a>, Up: <a href="function-attributes" accesskey="u" rel="up">Declaring Attributes of Functions</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div>  <h1 class="subsection" id="RX-Function-Attributes-1"><span>6.33.27 RX Function Attributes<a class="copiable-link" href="#RX-Function-Attributes-1"> ¶</a></span></h1> <p>These function attributes are supported by the RX back end: </p> <dl class="table"> <dt>
<span><code class="code">fast_interrupt</code><a class="copiable-link" href="#index-fast_005finterrupt-function-attribute_002c-RX"> ¶</a></span>
</dt> <dd>
<p>Use this attribute on the RX port to indicate that the specified function is a fast interrupt handler. This is just like the <code class="code">interrupt</code> attribute, except that <code class="code">freit</code> is used to return instead of <code class="code">reit</code>. </p> </dd> <dt>
<span><code class="code">interrupt</code><a class="copiable-link" href="#index-interrupt-function-attribute_002c-RX"> ¶</a></span>
</dt> <dd>
<p>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. </p> <p>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 <code class="code">"$default"</code> which causes the function to be used for any unfilled slots in the current table. </p> <p>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): </p>
<div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">void __attribute__ ((interrupt (5))) txd1_handler ();</pre>
</div> <p>This example assigns a function to two slots in the default table (using preprocessor macros defined elsewhere) and makes it the default for the <code class="code">dct</code> table: </p>
<div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">void __attribute__ ((interrupt (RXD1_VECT,RXD2_VECT,"dct","$default")))
	txd1_handler ();</pre>
</div> </dd> <dt>
<span><code class="code">naked</code><a class="copiable-link" href="#index-naked-function-attribute_002c-RX"> ¶</a></span>
</dt> <dd>
<p>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 <code class="code">asm</code> statements can safely be included in naked functions (see <a class="pxref" href="basic-asm">Basic Asm — Assembler Instructions Without Operands</a>). While using extended <code class="code">asm</code> or a mixture of basic <code class="code">asm</code> and C code may appear to work, they cannot be depended upon to work reliably and are not supported. </p> </dd> <dt>
<span><code class="code">vector</code><a class="copiable-link" href="#index-vector-function-attribute_002c-RX"> ¶</a></span>
</dt> <dd><p>This RX attribute is similar to the <code class="code">interrupt</code> 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 <code class="code">interrupt</code> attribute for a description of its arguments. </p></dd> </dl> </div>  <div class="nav-panel"> <p> Next: <a href="s_002f390-function-attributes">S/390 Function Attributes</a>, Previous: <a href="rl78-function-attributes">RL78 Function Attributes</a>, Up: <a href="function-attributes">Declaring Attributes of Functions</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
  <p class="_attribution-p">
    © Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
    <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/RX-Function-Attributes.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/RX-Function-Attributes.html</a>
  </p>
</div>
 |