Changeset 10643e9 in rtems


Ignore:
Timestamp:
May 13, 2013, 1:44:02 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
baf8f4d
Parents:
a29704eb
git-author:
Sebastian Huber <sebastian.huber@…> (05/13/13 13:44:02)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/29/13 09:06:06)
Message:

smp: Make CPU_ALLOCATE_INTERRUPT_STACK optional

Location:
cpukit/score
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/percpu.h

    ra29704eb r10643e9  
    5959#define __THREAD_CONTROL_DEFINED__
    6060typedef struct Thread_Control_struct Thread_Control;
    61 #endif
    62 
    63 #if (CPU_ALLOCATE_INTERRUPT_STACK == FALSE) && defined(RTEMS_SMP)
    64   #error "RTEMS must allocate per CPU interrupt stack for SMP"
    6561#endif
    6662
  • cpukit/score/src/percpu.c

    ra29704eb r10643e9  
    3232  void _SMP_Handler_initialize(void)
    3333  {
    34     int         cpu;
    35     size_t      size;
    36     uintptr_t   ptr;
    37 
     34    int cpu;
    3835
    3936    /*
    4037     *  Initialize per cpu pointer table
    4138     */
    42     size = rtems_configuration_get_interrupt_stack_size();
    4339    _Per_CPU_Information_p[0] = &_Per_CPU_Information[0];
    4440    for (cpu=1 ; cpu < rtems_configuration_get_maximum_processors(); cpu++ ) {
     
    4844      _Per_CPU_Information_p[cpu] = p;
    4945
    50       p->interrupt_stack_low = _Workspace_Allocate_or_fatal_error( size );
     46#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE
     47      {
     48        size_t size = rtems_configuration_get_interrupt_stack_size();
     49        uintptr_t ptr;
    5150
    52       ptr = (uintptr_t) _Addresses_Add_offset( p->interrupt_stack_low, size );
    53       ptr &= ~(CPU_STACK_ALIGNMENT - 1);
    54       p->interrupt_stack_high = (void *)ptr;
     51        p->interrupt_stack_low = _Workspace_Allocate_or_fatal_error( size );
     52
     53        ptr = (uintptr_t) _Addresses_Add_offset( p->interrupt_stack_low, size );
     54        ptr &= ~(CPU_STACK_ALIGNMENT - 1);
     55        p->interrupt_stack_high = (void *)ptr;
     56      }
     57#endif
     58
    5559      p->state = RTEMS_BSP_SMP_CPU_INITIAL_STATE;
    5660      RTEMS_COMPILER_MEMORY_BARRIER();
Note: See TracChangeset for help on using the changeset viewer.