Changeset 511dc4b in rtems for bsps/mips


Ignore:
Timestamp:
06/19/18 07:09:51 (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
9e3bb45
Parents:
715d616
git-author:
Sebastian Huber <sebastian.huber@…> (06/19/18 07:09:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/27/18 06:58:16)
Message:

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.

Location:
bsps/mips
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • bsps/mips/csb350/start/linkcmds

    r715d616 r511dc4b  
    1616RamSize = _sdram_size;
    1717HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    18 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x4000;
    1918
    2019ENTRY(_start)
     
    188187    *(COMMON)
    189188    . = ALIGN (64);
    190     _stack_limit = .;
    191     . += _StackSize;
    192     __stack = .;
    193     _stack_init = .;
    194189    _clear_end = .;
    195190    end = .;
  • bsps/mips/csb350/start/start.S

    r715d616 r511dc4b  
    6868        addiu   v0,v0,4                 /* executed in delay slot */
    6969
    70         la      t0, _stack_init         /* initialize stack so we */
     70        la      t0, _Configuration_Interrupt_stack_area_end /* initialize stack so we */
    7171        /* We must subtract 24 bytes for the 3 8 byte arguments to main, in
    7272           case main wants to write them back to the stack.  The caller is
  • bsps/mips/hurricane/start/linkcmds

    r715d616 r511dc4b  
    99RamSize = DEFINED(RamSize) ? RamSize : 4M;
    1010HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    11 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    1211
    1312ENTRY(start)
     
    167166    *(COMMON)
    168167    . = ALIGN (64);
    169     _stack_limit = .;
    170     . += _StackSize;
    171     __stack = .;
    172     _stack_init = .;
    173168     end = .;
    174169    _end = .;
  • bsps/mips/jmr3904/start/linkcmds

    r715d616 r511dc4b  
    99RamSize = DEFINED(RamSize) ? RamSize : 4M;
    1010HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    11 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    1211
    1312ENTRY(_start)
     
    165164    *(COMMON)
    166165    . = ALIGN (64);
    167     _stack_limit = .;
    168     . += _StackSize;
    169     __stack = .;
    170     _stack_init = .;
    171166    _clear_end = .;
    172167  }
     
    182177
    183178
    184 /* Put starting stack in SRAM (8 Kb); this size is the same as the stack from
    185       the original script (when everything was in SRAM). */
    186    /* __stack = 0x8000A000; */
    187179  /* DWARF debug sections.
    188180     Symbols in the DWARF debugging sections are relative to
  • bsps/mips/jmr3904/start/start.S

    r715d616 r511dc4b  
    140140        addiu   v0,v0,4                         # executed in delay slot
    141141
    142         la      t0, _stack_init                 # initialize stack so we
     142        la      t0, _Configuration_Interrupt_stack_area_end # initialize stack so we
    143143        /* We must subtract 24 bytes for the 3 8 byte arguments to main, in
    144144           case main wants to write them back to the stack.  The caller is
  • bsps/mips/malta/start/linkcmds

    r715d616 r511dc4b  
    99RamSize = DEFINED(RamSize) ? RamSize : 128M;
    1010HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    11 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
    1211
    1312ENTRY(_start)
     
    166165    *(COMMON)
    167166    . = ALIGN (64);
    168     _stack_limit = .;
    169     . += _StackSize;
    170     __stack = .;
    171     _stack_init = .;
    172167    _clear_end = .;
    173168  }
     
    183178
    184179
    185 /* Put starting stack in SRAM (8 Kb); this size is the same as the stack from
    186       the original script (when everything was in SRAM). */
    187    /* __stack = 0x8000A000; */
    188180  /* DWARF debug sections.
    189181     Symbols in the DWARF debugging sections are relative to
  • bsps/mips/malta/start/start.S

    r715d616 r511dc4b  
    167167        addiu   v0,v0,4                         # executed in delay slot
    168168
    169         la      t0, _stack_init                 # initialize stack so we
     169        la      t0, _Configuration_Interrupt_stack_area_end # initialize stack so we
    170170        /* We must subtract 24 bytes for the 3 8 byte arguments to main, in
    171171           case main wants to write them back to the stack.  The caller is
  • bsps/mips/rbtx4925/start/linkcmds

    r715d616 r511dc4b  
    99RamSize = DEFINED(RamSize) ? RamSize : 4M;
    1010HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    11 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    1211
    1312ENTRY(start)
     
    167166    *(COMMON)
    168167    . = ALIGN (64);
    169     _stack_limit = .;
    170     . += _StackSize;
    171     __stack = .;
    172     _stack_init = .;
    173168     end = .;
    174169    _end = .;
  • bsps/mips/rbtx4938/start/linkcmds

    r715d616 r511dc4b  
    99RamSize = DEFINED(RamSize) ? RamSize : 4M;
    1010HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    11 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    1211
    1312ENTRY(start)
     
    167166    *(COMMON)
    168167    . = ALIGN (64);
    169     _stack_limit = .;
    170     . += _StackSize;
    171     __stack = .;
    172     _stack_init = .;
    173168     end = .;
    174169    _end = .;
  • bsps/mips/shared/irq/exception.S

    r715d616 r511dc4b  
    215215  /*
    216216   *
    217    *  #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
    218    *    if ( _ISR_Nest_level == 0 )
    219    *      switch to software interrupt stack
    220    *  #endif
     217   *  if ( _ISR_Nest_level == 0 )
     218   *    switch to software interrupt stack
    221219   */
    222220
     
    308306
    309307  /*
    310    *  #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE )
    311    *    restore stack
    312    *  #endif
     308   *  restore stack
    313309   *
    314310   *  if ( !_Thread_Dispatch_necessary )
Note: See TracChangeset for help on using the changeset viewer.