Visible to Intel only — GUID: mwh1416946807456
Ixiasoft
Visible to Intel only — GUID: mwh1416946807456
Ixiasoft
6.15.2.2. Advanced Placement Options
/* data should be initialized when using the section attribute */
int foo __attribute__ ((section (".ext_ram.rwdata"))) = 0;
void bar (void) __attribute__ ((section (".sdram.text")));
void bar (void)
{
foo++;
}
In assembly you do this using the .section directive. For example, all code after the following line is placed in the memory device named ext_ram:
.section .ext_ram.text
The section names ext_ram and sdram are examples. You need to use section names corresponding to your hardware.
- .text for code: for example, .sdram.text
- .rodata for read-only data: for example, .cfi_flash.rodata
- .rwdata for read-write data: for example, .ext_ram.rwdata
For more information about the use of these features, refer to the GNU compiler and assembler documentation. This documentation is installed with the Nios II EDS. To find it, open the Nios II EDS documentation launchpad, scroll down to Software Development, and click Using the GNU Compiler Collection (GCC).