diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-09-28 12:22:33 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-10-14 10:48:22 +0200 |
commit | 1ab93ba480cabae849c1c0a00e9650ad75d5f912 (patch) | |
tree | 20686fb90bc9cb462c2383f5cf6663aad4e0de43 /cpukit | |
parent | score: Simplify casts (diff) | |
download | rtems-1ab93ba480cabae849c1c0a00e9650ad75d5f912.tar.bz2 |
score: INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED
Add the INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED fatal error in case the
creation of an idle thread fails. This may happen due to a failing create
extension provided by the application.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/score/interr.h | 1 | ||||
-rw-r--r-- | cpukit/sapi/src/interrtext.c | 3 | ||||
-rw-r--r-- | cpukit/score/src/threadcreateidle.c | 12 |
3 files changed, 12 insertions, 4 deletions
diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h index ae4966d6d8..d0ecf0f5c8 100644 --- a/cpukit/include/rtems/score/interr.h +++ b/cpukit/include/rtems/score/interr.h @@ -229,6 +229,7 @@ typedef enum { INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA = 40, INTERNAL_ERROR_TOO_LARGE_TLS_SIZE = 41, INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED = 42, + INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED = 43 } Internal_errors_Core_list; typedef CPU_Uint32ptr Internal_errors_t; diff --git a/cpukit/sapi/src/interrtext.c b/cpukit/sapi/src/interrtext.c index 383cc5bc0a..6ed115f430 100644 --- a/cpukit/sapi/src/interrtext.c +++ b/cpukit/sapi/src/interrtext.c @@ -83,7 +83,8 @@ static const char *const internal_error_text[] = { "INTERNAL_ERROR_ARC4RANDOM_GETENTROPY_FAIL", "INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA", "INTERNAL_ERROR_TOO_LARGE_TLS_SIZE", - "INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED" + "INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED", + "INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED" }; const char *rtems_internal_error_text( rtems_fatal_code error ) diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c index 3e3c7cfc83..d2037b36f0 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -39,13 +39,16 @@ #include "config.h" #endif -#include <rtems/score/threadidledata.h> -#include <rtems/score/cpuimpl.h> #include <rtems/score/threadimpl.h> + #include <rtems/score/assert.h> +#include <rtems/score/cpuimpl.h> +#include <rtems/score/interr.h> #include <rtems/score/schedulerimpl.h> #include <rtems/score/stackimpl.h> #include <rtems/score/sysstate.h> +#include <rtems/score/threadidledata.h> +#include <rtems/score/tls.h> #include <rtems/score/userextimpl.h> #include <string.h> @@ -66,6 +69,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu ) config.name = _Objects_Build_name( 'I', 'D', 'L', 'E' ); config.is_fp = CPU_IDLE_TASK_IS_FP; config.is_preemptible = true; + config.stack_free = _Objects_Free_nothing; config.stack_size = _Thread_Idle_stack_size + CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE; @@ -87,7 +91,9 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu ) _Assert( idle != NULL ); status = _Thread_Initialize( &_Thread_Information, idle, &config ); - _Assert_Unused_variable_equals( status, STATUS_SUCCESSFUL ); + if ( status != STATUS_SUCCESSFUL ) { + _Internal_error( INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED ); + } /* * WARNING!!! This is necessary to "kick" start the system and |