.. Copyright 1988-2022 Free Software Foundation, Inc. This is part of the GCC manual. For copying conditions, see the copyright.rst file. .. _nds32-function-attributes: NDS32 Function Attributes ^^^^^^^^^^^^^^^^^^^^^^^^^ These function attributes are supported by the NDS32 back end: .. index:: exception function attribute, exception handler functions, NDS32 .. nds32-fn-attr:: exception Use this attribute on the NDS32 target to indicate that the specified function is an exception handler. The compiler will generate corresponding sections for use in an exception handler. .. index:: interrupt function attribute, NDS32 .. nds32-fn-attr:: interrupt On NDS32 target, this attribute indicates that the specified function is an interrupt handler. The compiler generates corresponding sections for use in an interrupt handler. You can use the following attributes to modify the behavior: ``nested`` .. index:: nested function attribute, NDS32 This interrupt service routine is interruptible. ``not_nested`` .. index:: not_nested function attribute, NDS32 This interrupt service routine is not interruptible. ``nested_ready`` .. index:: nested_ready function attribute, NDS32 This interrupt service routine is interruptible after ``PSW.GIE`` (global interrupt enable) is set. This allows interrupt service routine to finish some short critical code before enabling interrupts. ``save_all`` .. index:: save_all function attribute, NDS32 The system will help save all registers into stack before entering interrupt handler. ``partial_save`` .. index:: partial_save function attribute, NDS32 The system will help save caller registers into stack before entering interrupt handler. .. index:: naked function attribute, NDS32 .. nds32-fn-attr:: naked 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 ``asm`` statements can safely be included in naked functions (see :ref:`basic-asm`). While using extended ``asm`` or a mixture of basic ``asm`` and C code may appear to work, they cannot be depended upon to work reliably and are not supported. .. index:: reset function attribute, NDS32, reset handler functions .. nds32-fn-attr:: reset Use this attribute on the NDS32 target to indicate that the specified function is a reset handler. The compiler will generate corresponding sections for use in a reset handler. You can use the following attributes to provide extra exception handling: ``nmi`` .. index:: nmi function attribute, NDS32 Provide a user-defined function to handle NMI exception. ``warm`` .. index:: warm function attribute, NDS32 Provide a user-defined function to handle warm reset exception.