summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadcreateidle.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-09-28 12:22:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-10-14 10:48:22 +0200
commit1ab93ba480cabae849c1c0a00e9650ad75d5f912 (patch)
tree20686fb90bc9cb462c2383f5cf6663aad4e0de43 /cpukit/score/src/threadcreateidle.c
parentscore: Simplify casts (diff)
downloadrtems-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 '')
-rw-r--r--cpukit/score/src/threadcreateidle.c12
1 files changed, 9 insertions, 3 deletions
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