summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-10-06 08:47:14 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-10-14 10:48:23 +0200
commit64fbeaa0d1b4321cb439923c86993d134fbd3acb (patch)
tree8172b38a5e3075575ff5359fe0bbbb663878d0ac /cpukit
parentconfig: Add CONFIGURE_IDLE_TASK_STORAGE_SIZE (diff)
downloadrtems-64fbeaa0d1b4321cb439923c86993d134fbd3acb.tar.bz2
score: INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL
Ensure that the IDLE storage allocator did allocate a suffiently large area. Update #3835. Update #4524.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/include/rtems/score/interr.h3
-rw-r--r--cpukit/sapi/src/interrtext.c3
-rw-r--r--cpukit/score/src/threadcreateidle.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/cpukit/include/rtems/score/interr.h b/cpukit/include/rtems/score/interr.h
index f21e8d58a1..003e80e0bd 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -230,7 +230,8 @@ typedef enum {
INTERNAL_ERROR_TOO_LARGE_TLS_SIZE = 41,
INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED = 42,
INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED = 43,
- INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STORAGE = 44
+ INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STORAGE = 44,
+ INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL = 45
} 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 e828a82051..34b51419cf 100644
--- a/cpukit/sapi/src/interrtext.c
+++ b/cpukit/sapi/src/interrtext.c
@@ -85,7 +85,8 @@ static const char *const internal_error_text[] = {
"INTERNAL_ERROR_TOO_LARGE_TLS_SIZE",
"INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED",
"INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED",
- "INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STORAGE"
+ "INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STORAGE",
+ "INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL"
};
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 04565f910b..cb15d5cc3c 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -84,6 +84,10 @@ static void _Thread_Create_idle_for_CPU(
&config.stack_size
);
+ if ( config.stack_size < storage_size ) {
+ _Internal_error( INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALL );
+ }
+
/*
* The entire workspace is zeroed during its initialization. Thus, all
* fields not explicitly assigned were explicitly zeroed by