Files
rtems/bsps/nios2/nios2_iss/start/linkcmds
Sebastian Huber 511dc4b2be 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.
2018-06-27 08:58:16 +02:00

365 lines
11 KiB
Plaintext

/* generated.x
*
* Machine generated for a CPU named "cpu_0" as defined in:
* D:\eb2_nios2\kawkos.ptf
*
* Generated: 2005-07-10 11:52:46.899
*
*/
/*
DO NOT MODIFY THIS FILE
Changing this file will have subtle consequences
which will almost certainly lead to a nonfunctioning
system. If you do modify this file, be aware that your
changes will be overwritten and lost when this file
is generated again.
DO NOT MODIFY THIS FILE
*/
RamBase = DEFINED(RamBase) ? RamBase : 0x00000000;
RamSize = DEFINED(RamSize) ? RamSize : 0x00800000;
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
MEMORY
{
reset : ORIGIN = 0x00000000, LENGTH = 0x00000600
exceptions : ORIGIN = 0x00000600, LENGTH = 0x00000A00
onchip_memory_0 : ORIGIN = 0x00001000, LENGTH = 0x007FF000
}
/* Define symbols for each memory base-address */
__alt_mem_onchip_memory_0 = 0x00000000 ;
__nios2_icache_size = 4096 ;
__nios2_icache_line_size = 32 ;
__nios2_dcache_size = 0 ;
__nios2_dcache_line_size = 4 ;
OUTPUT_FORMAT( "elf32-littlenios2",
"elf32-littlenios2",
"elf32-littlenios2" )
OUTPUT_ARCH( nios2 )
ENTRY(start)
STARTUP(start.o)
/* Do we need any of these for elf?
__DYNAMIC = 0;
*/
SECTIONS
{
.entry :
{
KEEP (*(.entry))
} > reset
.exceptions :
{
PROVIDE (__ram_exceptions_start = ABSOLUTE(.));
. = ALIGN(0x20);
*(.irq)
KEEP (*(.exceptions.entry.label));
KEEP (*(.exceptions.entry.user));
KEEP (*(.exceptions.entry));
KEEP (*(.exceptions.irqtest.user));
KEEP (*(.exceptions.irqtest));
KEEP (*(.exceptions.irqhandler.user));
KEEP (*(.exceptions.irqhandler));
KEEP (*(.exceptions.irqreturn.user));
KEEP (*(.exceptions.irqreturn));
KEEP (*(.exceptions.notirq.label));
KEEP (*(.exceptions.notirq.user));
KEEP (*(.exceptions.notirq));
KEEP (*(.exceptions.soft.user));
KEEP (*(.exceptions.soft));
KEEP (*(.exceptions.unknown.user));
KEEP (*(.exceptions.unknown));
KEEP (*(.exceptions.exit.label));
KEEP (*(.exceptions.exit.user));
KEEP (*(.exceptions.exit));
KEEP (*(.exceptions));
PROVIDE (__ram_exceptions_end = ABSOLUTE(.));
} > exceptions
PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions));
.text :
{
/*
* All code sections are merged into the text output section, along with
* the read only data sections.
*
*/
PROVIDE (stext = ABSOLUTE(.));
*(.interp)
*(.hash)
*(.dynsym)
*(.dynstr)
*(.gnu.version)
*(.gnu.version_d)
*(.gnu.version_r)
*(.rel.init)
*(.rela.init)
*(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
*(.rel.fini)
*(.rela.fini)
*(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
*(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
*(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
*(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
*(.rel.ctors)
*(.rela.ctors)
*(.rel.dtors)
*(.rela.dtors)
*(.rel.got)
*(.rela.got)
*(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
*(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
*(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
*(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
*(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
*(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
*(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
*(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
*(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
*(.rel.plt)
*(.rela.plt)
KEEP (*(.init))
*(.plt)
*(.text .stub .text.* .gnu.linkonce.t.*)
/* Special FreeBSD sysctl sections. */
. = ALIGN (16);
__start_set_sysctl_set = .;
*(set_sysctl_*);
__stop_set_sysctl_set = ABSOLUTE(.);
*(set_domain_*);
*(set_pseudo_*);
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning.*)
KEEP (*(.fini))
PROVIDE (__etext = ABSOLUTE(.));
PROVIDE (_etext = ABSOLUTE(.));
PROVIDE (etext = ABSOLUTE(.));
*(.eh_frame_hdr)
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
. = ALIGN(32 / 8);
PROVIDE (__preinit_array_start = ABSOLUTE(.));
*(.preinit_array)
PROVIDE (__preinit_array_end = ABSOLUTE(.));
PROVIDE (__init_array_start = ABSOLUTE(.));
*(.init_array)
PROVIDE (__init_array_end = ABSOLUTE(.));
PROVIDE (__fini_array_start = ABSOLUTE(.));
*(.fini_array)
PROVIDE (__fini_array_end = ABSOLUTE(.));
SORT(CONSTRUCTORS)
KEEP (*(.eh_frame))
*(.gcc_except_table*)
*(.dynamic)
PROVIDE (__CTOR_LIST__ = ABSOLUTE(.));
KEEP (*(.ctors))
KEEP (*(SORT(.ctors.*)))
PROVIDE (__CTOR_END__ = ABSOLUTE(.));
PROVIDE (__DTOR_LIST__ = ABSOLUTE(.));
KEEP (*(.dtors))
KEEP (*(SORT(.dtors.*)))
PROVIDE (__DTOR_END__ = ABSOLUTE(.));
KEEP (*(.jcr))
. = ALIGN(32 / 8);
} > onchip_memory_0 = 0x3a880100 /* NOP on Nios2 (big endian) */
.rodata :
{
PROVIDE (__ram_rodata_start = ABSOLUTE(.));
. = ALIGN(32 / 8);
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.rodata1)
KEEP (*(SORT(.rtemsroset.*)))
} > onchip_memory_0
.tdata : {
_TLS_Data_begin = .;
*(.tdata .tdata.* .gnu.linkonce.td.*)
_TLS_Data_end = .;
} > onchip_memory_0
.tbss : {
_TLS_BSS_begin = .;
*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
_TLS_BSS_end = .;
. = ALIGN(32 / 8);
PROVIDE (__ram_rodata_end = ABSOLUTE(.));
} > onchip_memory_0
_TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
_TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
_TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
_TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
_TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
_TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
PROVIDE (__flash_rodata_start = LOADADDR(.rodata));
.rwdata :
{
PROVIDE (__ram_rwdata_start = ABSOLUTE(.));
. = ALIGN(32 / 8);
*(.got.plt) *(.got)
*(.data1)
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(SORT(.rtemsrwset.*)))
_gp = ABSOLUTE(. + 0x8000);
PROVIDE(gp = _gp);
*(.sdata .sdata.* .gnu.linkonce.s.*)
*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
. = ALIGN(32 / 8);
_edata = ABSOLUTE(.);
PROVIDE (edata = ABSOLUTE(.));
PROVIDE (__ram_rwdata_end = ABSOLUTE(.));
} > onchip_memory_0
PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata));
.bss :
{
__bss_start = ABSOLUTE(.);
PROVIDE (__sbss_start = ABSOLUTE(.));
PROVIDE (___sbss_start = ABSOLUTE(.));
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
*(.scommon)
PROVIDE (__sbss_end = ABSOLUTE(.));
PROVIDE (___sbss_end = ABSOLUTE(.));
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(32 / 8);
__bss_end = ABSOLUTE(.);
} > onchip_memory_0
.rtemsstack (NOLOAD) : {
_stack_low = ABSOLUTE(.);
*(SORT(.rtemsstack.*))
_stack_high = ABSOLUTE(.);
WorkAreaBase = .;
} > onchip_memory_0
/*
* One output section for each of the available partitions. These are not
* used by default, but can be used by users applications using the .section
* directive.
*
* The memory partition used for the heap is treated in special way, i.e. a
* symbol is added to point to the heap start.
*
* Note that when running from flash, these sections are not loaded by the
* HAL.
*
*/
.onchip_memory_0 :
{
PROVIDE (_alt_partition_onchip_memory_0_start = ABSOLUTE(.));
*(.onchip_memory_0 .onchip_memory_0.*)
. = ALIGN(32 / 8);
PROVIDE (_alt_partition_onchip_memory_0_end = ABSOLUTE(.));
_end = ABSOLUTE(.);
end = ABSOLUTE(.);
} > onchip_memory_0
PROVIDE (_alt_partition_onchip_memory_0_load_addr = LOADADDR(.onchip_memory_0));
/*
* Stabs debugging sections.
*
*/
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* Altera debug extensions */
.debug_alt_sim_info 0 : { *(.debug_alt_sim_info) }
}
/* provide a pointer for the stack */
/*
* Don't override this, override the __alt_stack_* symbols instead.
*/
__alt_data_end = 0x00800000;
/*
* The next two symbols define the location of the default stack. You can
* override them to move the stack to a different memory.
*/
PROVIDE( __alt_stack_pointer = _stack_high );
PROVIDE( __alt_stack_limit = _stack_low );
/*
* This symbol controls where the start of the heap is. If the stack is
* contiguous with the heap then the stack will contract as memory is
* allocated to the heap.
* Override this symbol to put the heap in a different memory.
*/
PROVIDE( __alt_heap_start = end );