diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-12 16:05:35 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-19 09:59:39 +0100 |
commit | 514705d2f106375ff54d8a744dabeab97c71144d (patch) | |
tree | 9e361d26e18c6fe863e04051978d64241a0ac1a6 /cpukit/score/src | |
parent | score: Add SYSTEM_STATE_TERMINATED (diff) | |
download | rtems-514705d2f106375ff54d8a744dabeab97c71144d.tar.bz2 |
score: Delete _Thread_BSP_context
Do not return to BSP context in the exit() shutdown path. This makes it
possible to re-use the initialization stack. It can be used for the
interrupt stack for example. On targets with a small RAM this is a
considerable benefit.
This change eliminates also some special cases and simplifies the code.
Delete _Thread_Set_global_exit_status(),
_Thread_Get_global_exit_status() and _Thread_Stop_multitasking().
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/smp.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/threadstartmultitasking.c | 29 |
2 files changed, 10 insertions, 21 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 2f8a488474..df1c6d312a 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -40,7 +40,7 @@ void rtems_smp_secondary_cpu_initialize( void ) _Per_CPU_Wait_for_state( self_cpu, PER_CPU_STATE_BEGIN_MULTITASKING ); - _Thread_Start_multitasking( NULL ); + _Thread_Start_multitasking(); } void rtems_smp_process_interrupt( void ) diff --git a/cpukit/score/src/threadstartmultitasking.c b/cpukit/score/src/threadstartmultitasking.c index 52337ab558..b05ccb48c3 100644 --- a/cpukit/score/src/threadstartmultitasking.c +++ b/cpukit/score/src/threadstartmultitasking.c @@ -20,7 +20,7 @@ #include <rtems/score/threadimpl.h> -void _Thread_Start_multitasking( Context_Control *context ) +void _Thread_Start_multitasking( void ) { Per_CPU_Control *self_cpu = _Per_CPU_Get(); Thread_Control *heir = self_cpu->heir; @@ -28,7 +28,13 @@ void _Thread_Start_multitasking( Context_Control *context ) #if defined(RTEMS_SMP) _Per_CPU_Change_state( self_cpu, PER_CPU_STATE_UP ); + /* + * Threads begin execution in the _Thread_Handler() function. This + * function will set the thread dispatch disable level to zero and calls + * _Per_CPU_Release(). + */ _Per_CPU_Acquire( self_cpu ); + self_cpu->thread_dispatch_disable_level = 1; self_cpu->executing->is_executing = false; heir->is_executing = true; @@ -59,26 +65,9 @@ void _Thread_Start_multitasking( Context_Control *context ) _Context_Restore_fp( &heir->fp_context ); #endif -#if defined(RTEMS_SMP) - if ( context != NULL ) { -#endif - #if defined(_CPU_Start_multitasking) - _CPU_Start_multitasking( context, &heir->Registers ); + _CPU_Start_multitasking( &heir->Registers ); #else - _Context_Switch( context, &heir->Registers ); -#endif - -#if defined(RTEMS_SMP) - } else { - /* - * Threads begin execution in the _Thread_Handler() function. This - * function will set the thread dispatch disable level to zero and calls - * _Per_CPU_Release(). - */ - self_cpu->thread_dispatch_disable_level = 1; - - _CPU_Context_restore( &heir->Registers ); - } + _CPU_Context_Restart_self( &heir->Registers ); #endif } |