diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-22 09:13:08 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-01-08 09:00:53 +0100 |
commit | fe100e16117c36c40e99a853d09cd8dcf98dbff0 (patch) | |
tree | 81eb8dd6469908a103e3ade1d378c3a24ff9781b /cpukit/rtems/src/taskinitusers.c | |
parent | bsp/qoriq: Use array for FMan modules (diff) | |
download | rtems-fe100e16117c36c40e99a853d09cd8dcf98dbff0.tar.bz2 |
score: Add fatal errors for NULL entry init tasks
This simplifies the global construction.
Update #2514.
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/src/taskinitusers.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cpukit/rtems/src/taskinitusers.c b/cpukit/rtems/src/taskinitusers.c index 490ddc73eb..46d0af3f70 100644 --- a/cpukit/rtems/src/taskinitusers.c +++ b/cpukit/rtems/src/taskinitusers.c @@ -24,6 +24,7 @@ #include <rtems/rtems/support.h> #include <rtems/rtems/modes.h> #include <rtems/rtems/rtemsapi.h> +#include <rtems/score/assert.h> #include <rtems/score/stack.h> #include <rtems/rtems/tasksimpl.h> #include <rtems/score/thread.h> @@ -81,8 +82,15 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void ) _Terminate( INTERNAL_ERROR_RTEMS_API, true, return_value ); entry_point = user_tasks[ index ].entry_point; + if ( entry_point == NULL ) { + _Terminate( + INTERNAL_ERROR_CORE, + false, + INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL + ); + } - if ( register_global_construction && entry_point != NULL ) { + if ( register_global_construction ) { register_global_construction = false; entry_point = (rtems_task_entry) _Thread_Global_construction; } @@ -92,7 +100,7 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void ) entry_point, user_tasks[ index ].argument ); - if ( !rtems_is_status_successful( return_value ) ) - _Terminate( INTERNAL_ERROR_RTEMS_API, true, return_value ); + _Assert( rtems_is_status_successful( return_value ) ); + (void) return_value; } } |