]> git.ipfire.org Git - thirdparty/gcc.git/blob
846f1dacbed77ad85e211c348420d06975ae1b77
[thirdparty/gcc.git] /
1 ..
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.
5
6 .. _nds32-function-attributes:
7
8 NDS32 Function Attributes
9 ^^^^^^^^^^^^^^^^^^^^^^^^^
10
11 These function attributes are supported by the NDS32 back end:
12
13 .. index:: exception function attribute, exception handler functions, NDS32
14
15 .. nds32-fn-attr:: exception
16
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.
20
21 .. index:: interrupt function attribute, NDS32
22
23 .. nds32-fn-attr:: interrupt
24
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:
29
30 ``nested``
31
32 .. index:: nested function attribute, NDS32
33
34 This interrupt service routine is interruptible.
35
36 ``not_nested``
37
38 .. index:: not_nested function attribute, NDS32
39
40 This interrupt service routine is not interruptible.
41
42 ``nested_ready``
43
44 .. index:: nested_ready function attribute, NDS32
45
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.
49
50 ``save_all``
51
52 .. index:: save_all function attribute, NDS32
53
54 The system will help save all registers into stack before entering
55 interrupt handler.
56
57 ``partial_save``
58
59 .. index:: partial_save function attribute, NDS32
60
61 The system will help save caller registers into stack before entering
62 interrupt handler.
63
64 .. index:: naked function attribute, NDS32
65
66 .. nds32-fn-attr:: naked
67
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.
76
77 .. index:: reset function attribute, NDS32, reset handler functions
78
79 .. nds32-fn-attr:: reset
80
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:
85
86 ``nmi``
87
88 .. index:: nmi function attribute, NDS32
89
90 Provide a user-defined function to handle NMI exception.
91
92 ``warm``
93
94 .. index:: warm function attribute, NDS32
95
96 Provide a user-defined function to handle warm reset exception.