@@ -164,11 +164,32 @@ For example:
164
164
165
165
## Function Attributes
166
166
167
- * ` __attribute__((naked)) `
168
- * ` __attribute__((interrupt)) `
169
- * ` __attribute__((interrupt("user"))) `
170
- * ` __attribute__((interrupt("supervisor"))) `
171
- * ` __attribute__((interrupt("machine"))) `
167
+ ### ` __attribute__((naked)) `
168
+
169
+ The compiler won't generate the prologue/epilogue for those functions with
170
+ ` naked ` attributes. This attribute is usually used when you want to write a
171
+ function with an inline assembly body.
172
+
173
+ This attribute is incompatible with the ` interrupt ` attribute.
174
+
175
+ NOTE: Be aware that compilers might have further restrictions on naked
176
+ functions. Please consult your compiler's manual for more information.
177
+
178
+ ### ` __attribute__((interrupt)) ` , ` __attribute__((interrupt("user"))) ` , ` __attribute__((interrupt("supervisor"))) ` ` __attribute__((interrupt("machine"))) `
179
+
180
+ The interrupt attribute specifies that a function is an interrupt handler.
181
+ The compiler will save/restore all used registers in the prologue/epilogue
182
+ regardless of the ABI, all used registers including floating point
183
+ register/vector register if ` F ` extension/vector extension is enabled.
184
+
185
+ The interrupt attribute can have an optional parameter to specify the mode.
186
+ The possible values are ` user ` , ` supervisor ` , or ` machine ` .
187
+ The default value ` machine ` is used, if the mode is not specified.
188
+
189
+ The function can specify only one mode; the compiler should raise an error if a
190
+ function declares more than one mode or an undefined mode.
191
+
192
+ This attribute is incompatible with the ` naked ` attribute.
172
193
173
194
## Intrinsic Functions
174
195
0 commit comments