diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/gcc~13/epiphany-function-attributes.html | |
new repository
Diffstat (limited to 'devdocs/gcc~13/epiphany-function-attributes.html')
| -rw-r--r-- | devdocs/gcc~13/epiphany-function-attributes.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/devdocs/gcc~13/epiphany-function-attributes.html b/devdocs/gcc~13/epiphany-function-attributes.html new file mode 100644 index 00000000..4aa02633 --- /dev/null +++ b/devdocs/gcc~13/epiphany-function-attributes.html @@ -0,0 +1,28 @@ +<div class="subsection-level-extent" id="Epiphany-Function-Attributes"> <div class="nav-panel"> <p> Next: <a href="h8_002f300-function-attributes" accesskey="n" rel="next">H8/300 Function Attributes</a>, Previous: <a href="c-sky-function-attributes" accesskey="p" rel="prev">C-SKY 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="Epiphany-Function-Attributes-1"><span>6.33.10 Epiphany Function Attributes<a class="copiable-link" href="#Epiphany-Function-Attributes-1"> ¶</a></span></h1> <p>These function attributes are supported by the Epiphany back end: </p> <dl class="table"> <dt> +<span><code class="code">disinterrupt</code><a class="copiable-link" href="#index-disinterrupt-function-attribute_002c-Epiphany"> ¶</a></span> +</dt> <dd> +<p>This attribute causes the compiler to emit instructions to disable interrupts for the duration of the given function. </p> </dd> <dt> +<span><code class="code">forwarder_section</code><a class="copiable-link" href="#index-forwarder_005fsection-function-attribute_002c-Epiphany"> ¶</a></span> +</dt> <dd> +<p>This attribute modifies the behavior of an interrupt handler. The interrupt handler may be in external memory which cannot be reached by a branch instruction, so generate a local memory trampoline to transfer control. The single parameter identifies the section where the trampoline is placed. </p> </dd> <dt> +<span><code class="code">interrupt</code><a class="copiable-link" href="#index-interrupt-function-attribute_002c-Epiphany"> ¶</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. It may also generate a special section with code to initialize the interrupt vector table. </p> <p>On Epiphany targets one or more optional parameters can be added like this: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">void __attribute__ ((interrupt ("dma0, dma1"))) universal_dma_handler ();</pre> +</div> <p>Permissible values for these parameters are: <code class="code">reset</code>, <code class="code">software_exception</code>, <code class="code">page_miss</code>, <code class="code">timer0</code>, <code class="code">timer1</code>, <code class="code">message</code>, <code class="code">dma0</code>, <code class="code">dma1</code>, <code class="code">wand</code> and <code class="code">swi</code>. Multiple parameters indicate that multiple entries in the interrupt vector table should be initialized for this function, i.e. for each parameter <var class="var">name</var>, a jump to the function is emitted in the section ivt_entry_<var class="var">name</var>. The parameter(s) may be omitted entirely, in which case no interrupt vector table entry is provided. </p> <p>Note that interrupts are enabled inside the function unless the <code class="code">disinterrupt</code> attribute is also specified. </p> <p>The following examples are all valid uses of these attributes on Epiphany targets: </p> +<div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">void __attribute__ ((interrupt)) universal_handler (); +void __attribute__ ((interrupt ("dma1"))) dma1_handler (); +void __attribute__ ((interrupt ("dma0, dma1"))) + universal_dma_handler (); +void __attribute__ ((interrupt ("timer0"), disinterrupt)) + fast_timer_handler (); +void __attribute__ ((interrupt ("dma0, dma1"), + forwarder_section ("tramp"))) + external_dma_handler ();</pre> +</div> </dd> <dt> + <span><code class="code">long_call</code><a class="copiable-link" href="#index-long_005fcall-function-attribute_002c-Epiphany"> ¶</a></span> +</dt> <dt><code class="code">short_call</code></dt> <dd><p>These attributes specify how a particular function is called. These attributes override the <samp class="option">-mlong-calls</samp> (see <a class="pxref" href="adapteva-epiphany-options">Adapteva Epiphany Options</a>) command-line switch and <code class="code">#pragma long_calls</code> settings. </p></dd> </dl> </div> <div class="nav-panel"> <p> Next: <a href="h8_002f300-function-attributes">H8/300 Function Attributes</a>, Previous: <a href="c-sky-function-attributes">C-SKY 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/Epiphany-Function-Attributes.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Epiphany-Function-Attributes.html</a> + </p> +</div> |
