From patchwork Mon Oct 24 14:08:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 121363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C7A14B6FF5 for ; Tue, 25 Oct 2011 01:12:37 +1100 (EST) Received: (qmail 26593 invoked by alias); 24 Oct 2011 14:12:36 -0000 Received: (qmail 26583 invoked by uid 22791); 24 Oct 2011 14:12:34 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Oct 2011 14:12:06 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by post.strato.de (mrclete mo40) (RZmta 26.10 AUTH) with ESMTPA id L01995n9ODPHPJ ; Mon, 24 Oct 2011 16:08:06 +0200 (MEST) Message-ID: <4EA57146.9060204@gjlay.de> Date: Mon, 24 Oct 2011 16:08:06 +0200 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Eric Weddington , Denis Chertykov , Anatoly Sokolov Subject: [Patch,AVR,Documentation]: PR49824: Document OS_task and OS_main X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This is the same documentation extension as proposed for 4.6. Ok for trunk? Johann 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. Index: doc/extend.texi =================================================================== --- doc/extend.texi (revision 180308) +++ doc/extend.texi (working copy) @@ -3029,6 +3029,33 @@ compiled with more aggressive optimizati 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 descri @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 @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