source: rtems/bsps/bfin/bf537Stamp/start/linkcmds @ a74ee417

5
Last change on this file since a74ee417 was 511dc4b, checked in by Sebastian Huber <sebastian.huber@…>, on 06/19/18 at 07:09:51

Rework initialization and interrupt stack support

Statically initialize the interrupt stack area
(_Configuration_Interrupt_stack_area_begin,
_Configuration_Interrupt_stack_area_end, and
_Configuration_Interrupt_stack_size) via <rtems/confdefs.h>. Place the
interrupt stack area in a special section ".rtemsstack.interrupt". Let
BSPs define the optimal placement of this section in their linker
command files (e.g. in a fast on-chip memory).

This change makes makes the CPU_HAS_SOFTWARE_INTERRUPT_STACK and
CPU_HAS_HARDWARE_INTERRUPT_STACK CPU port defines superfluous, since the
low level initialization code has all information available via global
symbols.

This change makes the CPU_ALLOCATE_INTERRUPT_STACK CPU port define
superfluous, since the interrupt stacks are allocated by confdefs.h for
all architectures. There is no need for BSP-specific linker command
file magic (except the section placement), see previous ARM linker
command file as a bad example.

Remove _CPU_Install_interrupt_stack(). Initialize the hardware
interrupt stack in _CPU_Initialize() if necessary (e.g.
m68k_install_interrupt_stack()).

The optional _CPU_Interrupt_stack_setup() is still useful to customize
the registration of the interrupt stack area in the per-CPU information.

The initialization stack can reuse the interrupt stack, since

  • interrupts are disabled during the sequential system initialization, and
  • the boot_card() function does not return.

This stack resuse saves memory.

Changes per architecture:

arm:

  • Mostly replace the linker symbol based configuration of stacks with the standard <rtems/confdefs.h> configuration via CONFIGURE_INTERRUPT_STACK_SIZE. The size of the FIQ, ABT and UND mode stack is still defined via linker symbols. These modes are rarely used in applications and the default values provided by the BSP should be sufficient in most cases.
  • Remove the bsp_processor_count linker symbol hack used for the SMP support. This is possible since the interrupt stack area is now allocated by the linker and not allocated from the heap. This makes some configure.ac stuff obsolete. Remove the now superfluous BSP variants altcycv_devkit_smp and realview_pbx_a9_qemu_smp.

bfin:

  • Remove unused magic linker command file allocation of initialization stack. Maybe a previous linker command file copy and paste problem? In the start.S the initialization stack is set to a hard coded value.

lm32, m32c, mips, nios2, riscv, sh, v850:

  • Remove magic linker command file allocation of initialization stack. Reuse interrupt stack for initialization stack.

m68k:

  • Remove magic linker command file allocation of initialization stack. Reuse interrupt stack for initialization stack.

powerpc:

  • Remove magic linker command file allocation of initialization stack. Reuse interrupt stack for initialization stack.
  • Used dedicated memory region (REGION_RTEMSSTACK) for the interrupt stack on BSPs using the shared linkcmds.base (replacement for REGION_RWEXTRA).

sparc:

  • Remove the hard coded initialization stack. Use the interrupt stack for the initialization stack on the boot processor. This saves 16KiB of RAM.

Update #3459.

  • Property mode set to 100644
File size: 4.6 KB
Line 
1OUTPUT_FORMAT("elf32-bfin", "elf32-bfin",
2            "elf32-bfin")
3
4OUTPUT_ARCH(bfin)
5ENTRY(__start)
6STARTUP(start.o)
7
8/*
9 * Declare some sizes.
10 */
11_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
12/* bf537stamp has 64MB ram, but dynamic mmu tables have not yet been
13   implemented.  there are not enough static entries to support 64MB
14   along with banks for io and flash, so waste some RAM at the end
15   to free up mmu entries. */
16_RamSize = DEFINED(_RamSize) ? _RamSize : 0x03400000;
17_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
18
19MEMORY
20{
21      sdram(rwx)    : ORIGIN = 0x00001000, LENGTH = 0x03fff000
22/*
23      l1code(rwx)   : ORIGIN = 0xffa08000, LENGTH = 0x00008000
24      l1data(rwx)   : ORIGIN = 0xff804000, LENGTH = 0x00004000
25*/
26}
27
28SECTIONS
29{
30
31/*
32    .l1code        :
33    {
34*/
35        /*jump.o (.text)*/
36/*
37    } > l1code
38*/
39
40    .init          :
41    {
42        *(.start)
43        KEEP (*(.init))
44    } > sdram   /*=0*/
45
46    .text :
47    {
48         CREATE_OBJECT_SYMBOLS
49        *(.text)
50        *(.rodata*)
51        *(.gnu.linkonce.r*)
52       
53        /*
54         * Special FreeBSD sysctl sections.
55         */
56        . = ALIGN (16);
57        ___start_set_sysctl_set = .;
58        *(set_sysctl_*);
59        ___stop_set_sysctl_set = ABSOLUTE(.);
60        *(set_domain_*);
61        *(set_pseudo_*);
62
63         _etext = .;
64
65        ___CTOR_LIST__ = .;
66        LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)
67        *(.ctors)
68        LONG(0)
69        ___CTOR_END__ = .;
70        ___DTOR_LIST__ = .;
71        LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)
72        *(.dtors)
73        LONG(0)
74        ___DTOR_END__ = .;         
75    } > sdram
76
77    .tdata : {
78        __TLS_Data_begin = .;
79        *(.tdata .tdata.* .gnu.linkonce.td.*)
80        __TLS_Data_end = .;
81    } > sdram
82
83    .tbss : {
84        __TLS_BSS_begin = .;
85        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
86        __TLS_BSS_end = .;
87    } > sdram
88
89    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
90    __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
91    __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
92    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
93    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
94    __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
95   
96    .fini :
97    {
98        KEEP (*(.fini))
99    } > sdram  /*=0*/
100   
101    .data :
102    {
103        *(.data)
104        KEEP (*(SORT(.rtemsrwset.*)))
105        *(.jcr)
106        *(.gnu.linkonce.d*)
107        CONSTRUCTORS
108         _edata = .;
109    } > sdram
110
111    .eh_frame : { *(.eh_frame) } > sdram
112    .data1   : { *(.data1) } > sdram
113    .eh_frame : { *(.eh_frame) } > sdram
114    .gcc_except_table : { *(.gcc_except_table*) } > sdram
115
116    .rodata :
117    {
118        *(.rodata)
119        *(.rodata.*)
120        KEEP (*(SORT(.rtemsroset.*)))
121        *(.gnu.linkonce.r*)
122    } > sdram
123
124   
125    .bss :
126    {
127         _bss_start = .;
128        _clear_start = .;
129        *(.bss)
130        *(.gnu.linkonce.b.*)
131        *(COMMON)
132        . = ALIGN (64);
133        _clear_end = .;
134         _end = .;
135         __end = .;
136    } > sdram
137
138    .rtemsstack (NOLOAD) : {
139        *(SORT(.rtemsstack.*))
140        _WorkAreaBase = .;
141    } > sdram
142
143/* Debugging stuff follows */
144
145  /* Stabs debugging sections.  */
146  .stab 0 : { *(.stab) }
147  .stabstr 0 : { *(.stabstr) }
148  .stab.excl 0 : { *(.stab.excl) }
149  .stab.exclstr 0 : { *(.stab.exclstr) }
150  .stab.index 0 : { *(.stab.index) }
151  .stab.indexstr 0 : { *(.stab.indexstr) }
152  .comment 0 : { *(.comment) }
153  /* DWARF debug sections.
154     Symbols in the DWARF debugging sections are relative to the beginning
155     of the section so we begin them at 0.  */
156  /* DWARF 1 */
157  .debug          0 : { *(.debug) }
158  .line           0 : { *(.line) }
159  /* GNU DWARF 1 extensions */
160  .debug_srcinfo  0 : { *(.debug_srcinfo) }
161  .debug_sfnames  0 : { *(.debug_sfnames) }
162  /* DWARF 1.1 and DWARF 2 */
163  .debug_aranges  0 : { *(.debug_aranges) }
164  .debug_pubnames 0 : { *(.debug_pubnames) }
165  /* DWARF 2 */
166  .debug_info     0 : { *(.debug_info) }
167  .debug_abbrev   0 : { *(.debug_abbrev) }
168  .debug_line     0 : { *(.debug_line) }
169  .debug_frame    0 : { *(.debug_frame) }
170  .debug_str      0 : { *(.debug_str) }
171  .debug_loc      0 : { *(.debug_loc) }
172  .debug_macinfo  0 : { *(.debug_macinfo) }
173  /* SGI/MIPS DWARF 2 extensions */
174  .debug_weaknames 0 : { *(.debug_weaknames) }
175  .debug_funcnames 0 : { *(.debug_funcnames) }
176  .debug_typenames 0 : { *(.debug_typenames) }
177  .debug_varnames  0 : { *(.debug_varnames) }
178  /* These must appear regardless of  .  */   
179}
180
181__RamBase = _RamBase;
182__RamSize = _RamSize;
183__edata = _edata;
184__etext = _etext;
Note: See TracBrowser for help on using the repository browser.