diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-13 15:44:02 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-29 11:06:06 +0200 |
commit | 10643e958ca51bb464ca74e7706c89863d9ec87e (patch) | |
tree | c58f6b99883a365513d3b71af5c5bc7a55fb574f /cpukit/score | |
parent | smp: Rely on BSS initialization (diff) | |
download | rtems-10643e958ca51bb464ca74e7706c89863d9ec87e.tar.bz2 |
smp: Make CPU_ALLOCATE_INTERRUPT_STACK optional
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/percpu.h | 4 | ||||
-rw-r--r-- | cpukit/score/src/percpu.c | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 3e4712d43d..5469d25c5d 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -60,10 +60,6 @@ extern "C" { typedef struct Thread_Control_struct Thread_Control; #endif -#if (CPU_ALLOCATE_INTERRUPT_STACK == FALSE) && defined(RTEMS_SMP) - #error "RTEMS must allocate per CPU interrupt stack for SMP" -#endif - typedef enum { /** diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c index 0fcabbe0d9..d40b2a6154 100644 --- a/cpukit/score/src/percpu.c +++ b/cpukit/score/src/percpu.c @@ -31,15 +31,11 @@ void _SMP_Handler_initialize(void) { - int cpu; - size_t size; - uintptr_t ptr; - + int cpu; /* * Initialize per cpu pointer table */ - size = rtems_configuration_get_interrupt_stack_size(); _Per_CPU_Information_p[0] = &_Per_CPU_Information[0]; for (cpu=1 ; cpu < rtems_configuration_get_maximum_processors(); cpu++ ) { @@ -47,11 +43,19 @@ _Per_CPU_Information_p[cpu] = p; - p->interrupt_stack_low = _Workspace_Allocate_or_fatal_error( size ); +#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE + { + size_t size = rtems_configuration_get_interrupt_stack_size(); + uintptr_t ptr; + + p->interrupt_stack_low = _Workspace_Allocate_or_fatal_error( size ); + + ptr = (uintptr_t) _Addresses_Add_offset( p->interrupt_stack_low, size ); + ptr &= ~(CPU_STACK_ALIGNMENT - 1); + p->interrupt_stack_high = (void *)ptr; + } +#endif - ptr = (uintptr_t) _Addresses_Add_offset( p->interrupt_stack_low, size ); - ptr &= ~(CPU_STACK_ALIGNMENT - 1); - p->interrupt_stack_high = (void *)ptr; p->state = RTEMS_BSP_SMP_CPU_INITIAL_STATE; RTEMS_COMPILER_MEMORY_BARRIER(); } |