source: rtems/bsps/m68k/mcf5329/start/linkcmdsflash @ ff081aee

Last change on this file since ff081aee was 511dc4b, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 19, 2018 at 7:09:51 AM

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: 5.2 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Freescale ColdFire mcf52235
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.e
11 */
12
13/*
14 * Declare some sizes.
15 */
16_CoreSRamBase = DEFINED(RamBase) ? RamBase : 0x80000000;
17_CoreSRamSize = DEFINED(RamSize) ? RamSize : 32K;
18
19RamBase = DEFINED(RamBase) ? RamBase : 0x40000000;
20RamSize = DEFINED(RamSize) ? RamSize : 32M;
21
22_BootFlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000;
23_BootFlashSize = DEFINED(_FlashBase) ? _FlashBase : 2M;
24
25HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
26
27_VBR = 0x40000000;
28
29ENTRY(start)
30STARTUP(start.o)
31
32MEMORY
33{
34    core_sram : ORIGIN = 0x80000000, LENGTH = 32K
35    boot_flash : ORIGIN = 0x00000000, LENGTH = 2M
36    dram : ORIGIN = 0x40000000, LENGTH = 32M
37}
38
39SECTIONS
40{
41    /*
42    * Text, data and bss segments
43    */
44    .text : {
45
46        *(.text*)
47        *(.ram_code)
48
49        /*
50        * C++ constructors/destructors
51        */
52        *(.gnu.linkonce.t.*)
53
54        /*
55        * Initialization and finalization code.
56        *
57        * Various files can provide initialization and finalization
58        * functions.  crtbegin.o and crtend.o are two instances. The
59        * body of these functions are in .init and .fini sections. We
60        * accumulate the bodies here, and prepend function prologues
61        * from crti.o and function epilogues from crtn.o. crti.o must
62        * be linked first; crtn.o must be linked last.  Because these
63        * are wildcards, it doesn't matter if the user does not
64        * actually link against crti.o and crtn.o; the linker won't
65        * look for a file to match a wildcard.  The wildcard also
66        * means that it doesn't matter which directory crti.o and
67        * crtn.o are in.
68        */
69        PROVIDE (_init = .);
70        *crti.o(.init)
71        *(.init)
72        *crtn.o(.init)
73        PROVIDE (_fini = .);
74        *crti.o(.fini)
75        *(.fini)
76        *crtn.o(.fini)
77
78        /*
79            * Special FreeBSD sysctl sections.
80            */
81        . = ALIGN (16);
82        __start_set_sysctl_set = .;
83        *(set_sysctl_*);
84        __stop_set_sysctl_set = ABSOLUTE(.);
85        *(set_domain_*);
86        *(set_pseudo_*);
87
88        /*
89        * C++ constructors/destructors
90        *
91        * gcc uses crtbegin.o to find the start of the constructors
92        * and destructors so we make sure it is first.  Because this
93        * is a wildcard, it doesn't matter if the user does not
94        * actually link against crtbegin.o; the linker won't look for
95        * a file to match a wildcard.  The wildcard also means that
96        * it doesn't matter which directory crtbegin.o is in. The
97        * constructor and destructor list are terminated in
98        * crtend.o.  The same comments apply to it.
99        */
100        . = ALIGN (16);
101        *crtbegin.o(.ctors)
102        *(.ctors)
103        *crtend.o(.ctors)
104        *crtbegin.o(.dtors)
105        *(.dtors)
106        *crtend.o(.dtors)
107
108        /*
109        * Exception frame info
110        */
111        . = ALIGN (16);
112        *(.eh_frame)
113
114        /*
115        * Read-only data
116        */
117        . = ALIGN (16);
118        _rodata_start = . ;
119        *(.rodata*)
120        KEEP (*(SORT(.rtemsroset.*)))
121        *(.gnu.linkonce.r*)
122
123        . = ALIGN (16);
124
125        *(.console_gdb_xfer)
126        *(.bootstrap_data)
127    } > boot_flash
128
129    .tdata : {
130        _TLS_Data_begin = .;
131        *(.tdata .tdata.* .gnu.linkonce.td.*)
132        _TLS_Data_end = .;
133        . = ALIGN(16);
134        _estuff = .;
135        PROVIDE (_etext = .);
136    } > boot_flash
137
138    .tbss : {
139        _TLS_BSS_begin = .;
140        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
141        _TLS_BSS_end = .;
142    } > boot_flash
143
144    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
145    _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
146    _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
147    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
148    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
149    _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
150
151    .data 0x40000500 : AT (_estuff)
152    {
153        PROVIDE( _data_dest_start = . );
154        PROVIDE( _copy_start = .);
155        *(.data*)
156        KEEP (*(SORT(.rtemsrwset.*)))
157        *(.gnu.linkonce.d*)
158        *(.gcc_except_table*)
159        *(.jcr)
160        . = ALIGN (16);
161        PROVIDE (_edata = .);
162        PROVIDE (_copy_end = .);
163        PROVIDE (_data_dest_end = . );
164    } > dram
165
166    _data_src_start = _estuff;
167    _data_src_end = _data_dest_start + SIZEOF(.data);
168
169    .bss :
170    {
171        _clear_start = .;
172        *(.bss*)
173        *(COMMON)
174        . = ALIGN (16);
175        PROVIDE (_end = .);
176        _clear_end = .;
177        WorkAreaBase = .;
178    } > dram
179
180    .rtemsstack (NOLOAD) : {
181        *(SORT(.rtemsstack.*))
182    } > core_sram
183
184    /* Stabs debugging sections.  */
185    .stab 0 : { *(.stab) }
186    .stabstr 0 : { *(.stabstr) }
187    .stab.excl 0 : { *(.stab.excl) }
188    .stab.exclstr 0 : { *(.stab.exclstr) }
189    .stab.index 0 : { *(.stab.index) }
190    .stab.indexstr 0 : { *(.stab.indexstr) }
191    .comment 0 : { *(.comment) }
192
193    PROVIDE (end_of_all = .);
194}
Note: See TracBrowser for help on using the repository browser.