diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-17 06:36:54 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-22 09:40:22 +0100 |
commit | a7dcef97e93240b1947a0094b1af91e9b9324a30 (patch) | |
tree | 41a02234f131870bcb0c7bcc025682bce45fa582 /cpukit/rtems | |
parent | bsps: Add default getentropy() implementation (diff) | |
download | rtems-a7dcef97e93240b1947a0094b1af91e9b9324a30.tar.bz2 |
score: Simplify global construction
Update #3243.
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/src/taskinitusers.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/cpukit/rtems/src/taskinitusers.c b/cpukit/rtems/src/taskinitusers.c index 41b7edc1c4..c14d95d756 100644 --- a/cpukit/rtems/src/taskinitusers.c +++ b/cpukit/rtems/src/taskinitusers.c @@ -29,18 +29,6 @@ #include <rtems/score/thread.h> #include <rtems/score/wkspace.h> -static void _RTEMS_Global_construction( rtems_task_argument arg ) -{ - Thread_Control *executing = _Thread_Get_executing(); - Thread_Entry_information entry = executing->Start.Entry; - - entry.Kinds.Numeric.entry = - Configuration_RTEMS_API.User_initialization_tasks_table[ 0 ].entry_point; - - (void) arg; - _Thread_Global_construction( executing, &entry ); -} - /* * _RTEMS_tasks_Initialize_user_tasks_body * @@ -59,7 +47,6 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void ) rtems_id id; rtems_status_code return_value; rtems_initialization_tasks_table *user_tasks; - bool register_global_construction; rtems_task_entry entry_point; /* @@ -74,8 +61,6 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void ) if ( !user_tasks ) return; - register_global_construction = true; - /* * Now iterate over the initialization tasks and create/start them. */ @@ -97,11 +82,6 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void ) _Internal_error( INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL ); } - if ( register_global_construction ) { - register_global_construction = false; - entry_point = _RTEMS_Global_construction; - } - return_value = rtems_task_start( id, entry_point, @@ -109,5 +89,9 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void ) ); _Assert( rtems_is_status_successful( return_value ) ); (void) return_value; + + if ( _Thread_Global_constructor == 0 ) { + _Thread_Global_constructor = id; + } } } |