2002-08-27 Theodore A. Roth * doc/api/Makefile.am: Add sections.dox. * doc/api/sections.dox: New file. Index: doc/api/Makefile.am =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/doc/api/Makefile.am,v retrieving revision 1.15 diff -u -r1.15 Makefile.am --- doc/api/Makefile.am 21 Aug 2002 19:16:56 -0000 1.15 +++ doc/api/Makefile.am 27 Aug 2002 17:19:10 -0000 @@ -39,6 +39,7 @@ inline_asm.dox \ interrupts.dox \ acknowledge.dox \ + sections.dox \ sfr.dox \ tools-install.dox \ faq.dox Index: doc/api/sections.dox =================================================================== RCS file: doc/api/sections.dox diff -N doc/api/sections.dox --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ doc/api/sections.dox 27 Aug 2002 17:19:10 -0000 @@ -0,0 +1,120 @@ +/* Copyright (c) 2002, Theodore Roth + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. */ + +/* $Id$ */ + +/** \page mem_sections Memory Sections + +See \ref faq_startup for a simple intro to this for now. + +\remarks Need to list all the sections which are available to the avr. + +\par +This table is incomplete. [TRoth/2002-08-27: I got this info from cgrt1.S] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Section NameUsage
.init0Weakly bound to __init(). If user defines __init(), it will be jumped + into immediately after a reset.
.init1Unused. User definable.
.init2In C programs, weakly bound to initialize the stack.
.init3Unused. User definable.
.init4Copies data from flash to SRAM. [Is this BSS init?]
.init5Unused. User definable.
.init6Unused. User definable.
.init7Unused. User definable.
.init8Unused. User definable.
.init9Jumps into main()
+ +\subsection asm_sections Using Sections in Assembler Code + +Example: + +\code +#include + + .section .init1,"ax",@progbits + ldi r0, 0xff + out _SFR_IO_ADDR(PORTB), r0 + out _SFR_IO_ADDR(DDRB), r0 +\endcode + +\remarks What is ,"ax",@progbits part doing??? + + +\subsection c_sections Using Sections in C Code + +Example: + +\code +#include + +void my_init_portb (void) __attribute__ ((naked)) \ + __attribute__ ((section (".init1"))); + +void +my_init_portb (void) +{ + outb (PORTB, 0xff); + outb (DDRB, 0xff); +} +\endcode + +*/ +