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 .. _nds32-function-attributes:
8 NDS32 Function Attributes
9 ^^^^^^^^^^^^^^^^^^^^^^^^^
11 These function attributes are supported by the NDS32 back end:
13 .. index:: exception function attribute, exception handler functions, NDS32
15 .. nds32-fn-attr:: exception
17 Use this attribute on the NDS32 target to indicate that the specified function
18 is an exception handler. The compiler will generate corresponding sections
19 for use in an exception handler.
21 .. index:: interrupt function attribute, NDS32
23 .. nds32-fn-attr:: interrupt
25 On NDS32 target, this attribute indicates that the specified function
26 is an interrupt handler. The compiler generates corresponding sections
27 for use in an interrupt handler. You can use the following attributes
28 to modify the behavior:
32 .. index:: nested function attribute, NDS32
34 This interrupt service routine is interruptible.
38 .. index:: not_nested function attribute, NDS32
40 This interrupt service routine is not interruptible.
44 .. index:: nested_ready function attribute, NDS32
46 This interrupt service routine is interruptible after ``PSW.GIE``
47 (global interrupt enable) is set. This allows interrupt service routine to
48 finish some short critical code before enabling interrupts.
52 .. index:: save_all function attribute, NDS32
54 The system will help save all registers into stack before entering
59 .. index:: partial_save function attribute, NDS32
61 The system will help save caller registers into stack before entering
64 .. index:: naked function attribute, NDS32
66 .. nds32-fn-attr:: naked
68 This attribute allows the compiler to construct the
69 requisite function declaration, while allowing the body of the
70 function to be assembly code. The specified function will not have
71 prologue/epilogue sequences generated by the compiler. Only basic
72 ``asm`` statements can safely be included in naked functions
73 (see :ref:`basic-asm`). While using extended ``asm`` or a mixture of
74 basic ``asm`` and C code may appear to work, they cannot be
75 depended upon to work reliably and are not supported.
77 .. index:: reset function attribute, NDS32, reset handler functions
79 .. nds32-fn-attr:: reset
81 Use this attribute on the NDS32 target to indicate that the specified function
82 is a reset handler. The compiler will generate corresponding sections
83 for use in a reset handler. You can use the following attributes
84 to provide extra exception handling:
88 .. index:: nmi function attribute, NDS32
90 Provide a user-defined function to handle NMI exception.
94 .. index:: warm function attribute, NDS32
96 Provide a user-defined function to handle warm reset exception.