diff options
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r-- | gcc/doc/extend.texi | 93 |
1 files changed, 90 insertions, 3 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 1d52e425e33..799ede1ec95 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2505,6 +2505,12 @@ on data in the eight-bit data area. Note the eight-bit data area is limited to You must use GAS and GLD from GNU binutils version 2.7 or later for this attribute to work correctly. +@item exception +@cindex exception handler functions +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. + @item exception_handler @cindex exception handler functions on the Blackfin processor Use this attribute on the Blackfin to indicate that the specified function @@ -2965,6 +2971,32 @@ void __attribute__ ((interrupt, use_shadow_register_set, use_debug_exception_return)) v7 (); @end smallexample +On NDS32 target, this attribute is to indicate that the specified function +is an interrupt handler. The compiler will generate corresponding sections +for use in an interrupt handler. You can use the following attributes +to modify the behavior: +@table @code +@item nested +@cindex @code{nested} attribute +This interrupt service routine is interruptible. +@item not_nested +@cindex @code{not_nested} attribute +This interrupt service routine is not interruptible. +@item nested_ready +@cindex @code{nested_ready} attribute +This interrupt service routine is interruptible after @code{PSW.GIE} +(global interrupt enable) is set. This allows interrupt service routine to +finish some short critical code before enabling interrupts. +@item save_all +@cindex @code{save_all} attribute +The system will help save all registers into stack before entering +interrupt handler. +@item partial_save +@cindex @code{partial_save} attribute +The system will help save caller registers into stack before entering +interrupt handler. +@end table + On RL78, use @code{brk_interrupt} instead of @code{interrupt} for handlers intended to be used with the @code{BRK} opcode (i.e.@: those that must end with @code{RETB} instead of @code{RETI}). @@ -3201,9 +3233,10 @@ and newer. @item naked @cindex function without a prologue/epilogue code -Use this attribute on the ARM, AVR, MCORE, MSP430, RL78, RX and SPU ports to indicate that -the specified function does not need prologue/epilogue sequences generated by -the compiler. It is up to the programmer to provide these sequences. The +Use this attribute on the ARM, AVR, MCORE, MSP430, NDS32, RL78, RX and SPU +ports to indicate that the specified function does not need prologue/epilogue +sequences generated by the compiler. +It is up to the programmer to provide these sequences. The only statements that can be safely included in naked functions are @code{asm} statements that do not have operands. All other statements, including declarations of local variables, @code{if} statements, and so @@ -3575,6 +3608,21 @@ safe since the loaders there save EAX, EDX and ECX. (Lazy binding can be disabled with the linker or the loader if desired, to avoid the problem.) +@item reset +@cindex reset handler functions +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: +@table @code +@item nmi +@cindex @code{nmi} attribute +Provide a user-defined function to handle NMI exception. +@item warm +@cindex @code{warm} attribute +Provide a user-defined function to handle warm reset exception. +@end table + @item sseregparm @cindex @code{sseregparm} attribute On the Intel 386 with SSE support, the @code{sseregparm} attribute @@ -9131,6 +9179,7 @@ instructions, but allow the compiler to schedule those calls. * MIPS Loongson Built-in Functions:: * Other MIPS Built-in Functions:: * MSP430 Built-in Functions:: +* NDS32 Built-in Functions:: * picoChip Built-in Functions:: * PowerPC Built-in Functions:: * PowerPC AltiVec/VSX Built-in Functions:: @@ -12584,6 +12633,44 @@ handlers and the changes to the status register will only take affect once the handler returns. @end table +@node NDS32 Built-in Functions +@subsection NDS32 Built-in Functions + +These built-in functions are available for the NDS32 target: + +@deftypefn {Built-in Function} void __builtin_nds32_isync (int *@var{addr}) +Insert an ISYNC instruction into the instruction stream where +@var{addr} is an instruction address for serialization. +@end deftypefn + +@deftypefn {Built-in Function} void __builtin_nds32_isb (void) +Insert an ISB instruction into the instruction stream. +@end deftypefn + +@deftypefn {Built-in Function} int __builtin_nds32_mfsr (int @var{sr}) +Return the content of a system register which is mapped by @var{sr}. +@end deftypefn + +@deftypefn {Built-in Function} int __builtin_nds32_mfusr (int @var{usr}) +Return the content of a user space register which is mapped by @var{usr}. +@end deftypefn + +@deftypefn {Built-in Function} void __builtin_nds32_mtsr (int @var{value}, int @var{sr}) +Move the @var{value} to a system register which is mapped by @var{sr}. +@end deftypefn + +@deftypefn {Built-in Function} void __builtin_nds32_mtusr (int @var{value}, int @var{usr}) +Move the @var{value} to a user space register which is mapped by @var{usr}. +@end deftypefn + +@deftypefn {Built-in Function} void __builtin_nds32_setgie_en (void) +Enable global interrupt. +@end deftypefn + +@deftypefn {Built-in Function} void __builtin_nds32_setgie_dis (void) +Disable global interrupt. +@end deftypefn + @node picoChip Built-in Functions @subsection picoChip Built-in Functions |