source: rtems/bsps/m68k/gen68360/start/linkcmds.bootp @ 511dc4b

5
Last change on this file since 511dc4b 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: 3.7 KB
Line 
1/*
2 * This file contains GNU linker directives for a generic MC68360 board.
3 * Variations in memory size and allocation can be made by
4 * overriding some values with linker command-line arguments.
5 *
6 * These linker directives are for producing a bootstrap PROM version.
7 * The data segment is placed at the end of the text segment in the PROM.
8 * The start-up code takes care of copying this region to RAM.
9 *
10 * Saskatchewan Accelerator Laboratory
11 * University of Saskatchewan
12 * Saskatoon, Saskatchewan, CANADA
13 * eric@skatter.usask.ca
14 */
15
16/*
17 * Declare some sizes.
18 * A heap size of 0 means `use all available memory for the heap'.
19 */
20RamBase = DEFINED(RamBase) ? RamBase : 0x0;
21RamSize = DEFINED(RamSize) ? RamSize : 64M;
22HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
23
24/*
25 * Declare on-board memory.
26 */
27MEMORY {
28          ram : ORIGIN = 0x00000000, LENGTH = 64M
29        myram : ORIGIN = 16M-400k,   LENGTH = 400k
30          rom : ORIGIN = 0x0F000000, LENGTH = 1M
31        dpram : ORIGIN = 0x0E000000, LENGTH = 8k
32}
33
34/*
35 * Load objects
36 */
37SECTIONS {
38        /*
39         * Boot PROM
40         */
41        rom : {
42                _RomBase = .;
43        } >rom
44
45        /*
46         * Dynamic RAM
47         */
48        ram : {
49                RamBase = .;
50        } >ram
51
52        /*
53         * Text, data and bss segments
54         */
55        .text : AT(0x0) {
56                *(.text*)
57
58                /*
59                 * C++ constructors/destructors
60                 */
61                *(.gnu.linkonce.t.*)
62
63                /*
64                 * Initialization and finalization code.
65                 */
66                PROVIDE (_init = .);
67                *crti.o(.init)
68                *(.init)
69                *crtn.o(.init)
70                PROVIDE (_fini = .);
71                *crti.o(.fini)
72                *(.fini)
73                *crtn.o(.fini)
74
75                /*
76                 * Special FreeBSD sysctl sections.
77                 */
78                . = ALIGN (16);
79                __start_set_sysctl_set = .;
80                *(set_sysctl_*);
81                __stop_set_sysctl_set = ABSOLUTE(.);
82                *(set_domain_*);
83                *(set_pseudo_*);
84
85                /*
86                 * C++ constructors/destructors
87                 */
88                . = ALIGN (16);
89                *crtbegin.o(.ctors)
90                *(.ctors)
91                *crtend.o(.ctors)
92                *crtbegin.o(.dtors)
93                *(.dtors)
94                *crtend.o(.dtors)
95
96                /*
97                 * Exception frame info
98                 */
99                . = ALIGN (16);
100                *(.eh_frame)
101
102                /*
103                 * Read-only data
104                 */
105                . = ALIGN (16);
106                _rodata_start = . ;
107                *(.rodata*)
108                KEEP (*(SORT(.rtemsroset.*)))
109                *(.gnu.linkonce.r*)
110
111                 . = ALIGN (16);
112                PROVIDE (etext = .);
113        } >rom
114
115        .tdata : {
116                _TLS_Data_begin = .;
117                *(.tdata .tdata.* .gnu.linkonce.td.*)
118                _TLS_Data_end = .;
119        } >rom
120
121        .tbss : {
122                _TLS_BSS_begin = .;
123                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
124                _TLS_BSS_end = .;
125        } >rom
126
127        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
128        _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
129        _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
130        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
131        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
132        _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
133
134        .data : AT(SIZEOF(.text)) {
135                _copy_start = .;
136                *(.data)
137                KEEP (*(SORT(.rtemsrwset.*)))
138                *(.gnu.linkonce.d*)
139                *(.jcr)
140                *(.gcc_except_table*)
141                . = ALIGN (16);
142                PROVIDE (edata = .);
143                _copy_end = .;
144        } >myram
145        .bss : {
146                M68Kvec = .;
147                . += (256 * 4);
148                _clear_start = .;
149                *(.dynbss)
150                *(.bss* .gnu.linkonce.b.*)
151                *(COMMON)
152                . = ALIGN (16);
153                PROVIDE (end = .);
154                _clear_end = .;
155        } >myram
156
157        .rtemsstack (NOLOAD) : {
158                *(SORT(.rtemsstack.*))
159                WorkAreaBase = .;
160        } >myram
161
162        /*
163         * On-chip memory/peripherals
164         */
165        dpram : {
166                m360 = .;
167                . += (8 * 1024);
168        } >dpram
169}
Note: See TracBrowser for help on using the repository browser.