summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadstartmultitasking.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-12 16:05:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-19 09:59:39 +0100
commit514705d2f106375ff54d8a744dabeab97c71144d (patch)
tree9e361d26e18c6fe863e04051978d64241a0ac1a6 /cpukit/score/src/threadstartmultitasking.c
parentscore: Add SYSTEM_STATE_TERMINATED (diff)
downloadrtems-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/threadstartmultitasking.c')
-rw-r--r--cpukit/score/src/threadstartmultitasking.c29
1 files changed, 9 insertions, 20 deletions
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
}