These function attributes are supported on the SH family of processors:
function_vector
In an application, for a function being called once, this attribute saves at least 8 bytes of code; and if other successive calls are being made to the same function, it saves 2 bytes of code per each of these calls.
interrupt_handler
nosave_low_regs
interrupt_handler
function should not save and restore registers R0..R7. This can be used on SH3* and SH4* targets that have a second R0..R7 register bank for non-reentrant interrupt handlers. renesas
resbank
interrupt_handler
routines. Saving to the bank is performed automatically after the CPU accepts an interrupt that uses a register bank. The nineteen 32-bit registers comprising general register R0 to R14, control register GBR, and system registers MACH, MACL, and PR and the vector table address offset are saved into a register bank. Register banks are stacked in first-in last-out (FILO) sequence. Restoration from the bank is executed by issuing a RESBANK instruction.
sp_switch
interrupt_handler
function should switch to an alternate stack. It expects a string argument that names a global variable holding the address of the alternate stack. void *alt_stack; void f () __attribute__ ((interrupt_handler, sp_switch ("alt_stack")));
trap_exit
interrupt_handler
to return using trapa
instead of rte
. This attribute expects an integer argument specifying the trap number to be used. trapa_handler
interrupt_handler
but it does not save and restore all registers.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/SH-Function-Attributes.html