2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. _blackfin-function-attributes:
8 Blackfin Function Attributes
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 These function attributes are supported by the Blackfin back end:
13 .. index:: exception_handler function attribute, exception handler functions, Blackfin
15 .. blackfin-fn-attr:: exception_handler
17 Use this attribute on the Blackfin to indicate that the specified function
18 is an exception handler. The compiler generates function entry and
19 exit sequences suitable for use in an exception handler when this
22 .. index:: interrupt_handler function attribute, Blackfin
24 .. blackfin-fn-attr:: interrupt_handler
27 indicate that the specified function is an interrupt handler. The compiler
28 generates function entry and exit sequences suitable for use in an
29 interrupt handler when this attribute is present.
31 .. index:: kspisusp function attribute, Blackfin, User stack pointer in interrupts on the Blackfin
33 .. blackfin-fn-attr:: kspisusp
35 When used together with :blackfin-fn-attr:`interrupt_handler`, :blackfin-fn-attr:`exception_handler`
36 or :blackfin-fn-attr:`nmi_handler`, code is generated to load the stack pointer
37 from the USP register in the function prologue.
39 .. index:: l1_text function attribute, Blackfin
41 .. blackfin-fn-attr:: l1_text
43 This attribute specifies a function to be placed into L1 Instruction
44 SRAM. The function is put into a specific section named ``.l1.text``.
45 With :option:`-mfdpic`, function calls with a such function as the callee
46 or caller uses inlined PLT.
48 .. index:: l2 function attribute, Blackfin
50 .. blackfin-fn-attr:: l2
52 This attribute specifies a function to be placed into L2
53 SRAM. The function is put into a specific section named
54 ``.l2.text``. With :option:`-mfdpic`, callers of such functions use
57 .. index:: indirect calls, Blackfin, longcall function attribute, Blackfin, shortcall function attribute, Blackfin
59 .. blackfin-fn-attr:: longcall, shortcall
61 The :blackfin-fn-attr:`longcall` attribute
62 indicates that the function might be far away from the call site and
63 require a different (more expensive) calling sequence. The
64 ``shortcall`` attribute indicates that the function is always close
65 enough for the shorter calling sequence to be used. These attributes
66 override the :option:`-mlongcall` switch.
68 .. index:: nesting function attribute, Blackfin, Allow nesting in an interrupt handler on the Blackfin processor
70 .. blackfin-fn-attr:: nesting
72 Use this attribute together with :blackfin-fn-attr:`interrupt_handler`,
73 :blackfin-fn-attr:`exception_handler` or :blackfin-fn-attr:`nmi_handler` to indicate that the function
74 entry code should enable nested interrupts or exceptions.
76 .. index:: nmi_handler function attribute, Blackfin, NMI handler functions on the Blackfin processor
78 .. blackfin-fn-attr:: nmi_handler
80 Use this attribute on the Blackfin to indicate that the specified function
81 is an NMI handler. The compiler generates function entry and
82 exit sequences suitable for use in an NMI handler when this
85 .. index:: saveall function attribute, Blackfin, save all registers on the Blackfin
87 .. blackfin-fn-attr:: saveall
89 Use this attribute to indicate that
90 all registers except the stack pointer should be saved in the prologue
91 regardless of whether they are used or not.