aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2011-10-24 18:45:51 +0400
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2011-10-24 14:45:51 +0000
commit3d33d151c1d174f6d8e51894f6193e13bbe6984e (patch)
tree47b48b1eff41897ee24185bfceae10577dc0cd69 /gcc
parent7b7b1813daa8b65c1528025e3fd9e459690b72c4 (diff)
downloadgcc-3d33d151c1d174f6d8e51894f6193e13bbe6984e.zip
gcc-3d33d151c1d174f6d8e51894f6193e13bbe6984e.tar.gz
gcc-3d33d151c1d174f6d8e51894f6193e13bbe6984e.tar.bz2
re PR target/49824 ([avr] Missing documentation for OS_task and OS_main attributes)
PR target/49824 * doc/extend.texi (Declaring Attributes of Functions): Document OS_main and OS_task attributes. (Specifying Attributes of Variables): Move up subsection "AVR Variable Attributes" as of alphabetical order. Co-Authored-By: Georg-Johann Lay <avr@gjlay.de> From-SVN: r180385
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/doc/extend.texi50
2 files changed, 49 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a488788..ea07d8f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2011-10-24 Anatoly Sokolov <aesok@post.ru>
+ Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/49824
+ * doc/extend.texi (Declaring Attributes of Functions):
+ Document OS_main and OS_task attributes.
+ (Specifying Attributes of Variables): Move up
+ subsection "AVR Variable Attributes" as of alphabetical order.
+
2011-10-24 Richard Guenther <rguenther@suse.de>
* tree-vect-stmts.c (vect_get_vec_def_for_operand): Convert constants
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 11118ed..7c77388 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3029,6 +3029,33 @@ compiled with more aggressive optimization options that produce faster
and larger code, while other functions can be called with less
aggressive options.
+@item OS_main/OS_task
+@cindex @code{OS_main} AVR function attribute
+@cindex @code{OS_task} AVR function attribute
+On AVR, functions with the @code{OS_main} or @code{OS_task} attribute
+do not save/restore any call-saved register in their prologue/epilogue.
+
+The @code{OS_main} attribute can be used when there @emph{is
+guarantee} that interrupts are disabled at the time when the function
+is entered. This will save resources when the stack pointer has to be
+changed to set up a frame for local variables.
+
+The @code{OS_task} attribute can be used when there is @emph{no
+guarantee} that interrupts are disabled at that time when the function
+is entered like for, e@.g@. task functions in a multi-threading operating
+system. In that case, changing the stack pointer register will be
+guarded by save/clear/restore of the global interrupt enable flag.
+
+The differences to the @code{naked} function attrubute are:
+@itemize @bullet
+@item @code{naked} functions do not have a return instruction whereas
+@code{OS_main} and @code{OS_task} functions will have a @code{RET} or
+@code{RETI} return instruction.
+@item @code{naked} functions do not set up a frame for local variables
+or a frame pointer whereas @code{OS_main} and @code{OS_task} do this
+as needed.
+@end itemize
+
@item pcs
@cindex @code{pcs} function attribute
@@ -4525,6 +4552,19 @@ The @code{dllexport} attribute is described in @ref{Function Attributes}.
@end table
+@subsection AVR Variable Attributes
+
+@table @code
+@item progmem
+@cindex @code{progmem} AVR variable attribute
+The @code{progmem} attribute is used on the AVR to place data in the program
+memory address space (flash). This is accomplished by putting
+respective variables into a section whose name starts with @code{.progmem}.
+
+AVR is a Harvard architecture processor and data and reas only data
+normally resides in the data memory address space (RAM).
+@end table
+
@subsection Blackfin Variable Attributes
Three attributes are currently defined for the Blackfin.
@@ -4794,16 +4834,6 @@ placed in either the @code{.bss_below100} section or the
@end table
-@subsection AVR Variable Attributes
-
-@table @code
-@item progmem
-@cindex @code{progmem} variable attribute
-The @code{progmem} attribute is used on the AVR to place data in the Program
-Memory address space. The AVR is a Harvard Architecture processor and data
-normally resides in the Data Memory address space.
-@end table
-
@node Type Attributes
@section Specifying Attributes of Types
@cindex attribute of types