gcc: M32C Function Attributes
1
1 6.31.11 M32C Function Attributes
1 --------------------------------
1
1 These function attributes are supported by the M32C back end:
1
1 'bank_switch'
1 When added to an interrupt handler with the M32C port, causes the
1 prologue and epilogue to use bank switching to preserve the
1 registers rather than saving them on the stack.
1
1 'fast_interrupt'
1 Use this attribute on the M32C port to indicate that the specified
1 function is a fast interrupt handler. This is just like the
1 'interrupt' attribute, except that 'freit' is used to return
1 instead of 'reit'.
1
1 'function_vector'
1 On M16C/M32C targets, the 'function_vector' attribute declares a
1 special page subroutine call function. Use of this attribute
1 reduces the code size by 2 bytes for each call generated to the
1 subroutine. The argument to the attribute is the vector number
1 entry from the special page vector table which contains the 16
1 low-order bits of the subroutine's entry address. Each vector
1 table has special page number (18 to 255) that is used in 'jsrs'
1 instructions. Jump addresses of the routines are generated by
1 adding 0x0F0000 (in case of M16C targets) or 0xFF0000 (in case of
1 M32C targets), to the 2-byte addresses set in the vector table.
1 Therefore you need to ensure that all the special page vector
1 routines should get mapped within the address range 0x0F0000 to
1 0x0FFFFF (for M16C) and 0xFF0000 to 0xFFFFFF (for M32C).
1
1 In the following example 2 bytes are saved for each call to
1 function 'foo'.
1
1 void foo (void) __attribute__((function_vector(0x18)));
1 void foo (void)
1 {
1 }
1
1 void bar (void)
1 {
1 foo();
1 }
1
1 If functions are defined in one file and are called in another
1 file, then be sure to write this declaration in both files.
1
1 This attribute is ignored for R8C target.
1
1 'interrupt'
1 Use this attribute to indicate that the specified function is an
1 interrupt handler. The compiler generates function entry and exit
1 sequences suitable for use in an interrupt handler when this
1 attribute is present.
1