summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/confdefs
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-19 16:07:04 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-26 11:10:22 +0100
commit657e30c135f22c4448cfd13f8113b23e72776dad (patch)
tree3673a8df391a0fb170d4cbffb8e1d05821771aa2 /cpukit/include/rtems/confdefs
parentAvoid INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL (diff)
downloadrtems-657e30c135f22c4448cfd13f8113b23e72776dad.tar.bz2
config: CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE
In order to better support applications which use the new rtems_task_construct() directive add the CONFIGURE_INIT_TASK_CONSTURCT_STORAGE_SIZE configuration option. If this option is specified, then the Classic API initialization task is constructed with rtems_task_construct(). Update #4181.
Diffstat (limited to 'cpukit/include/rtems/confdefs')
-rw-r--r--cpukit/include/rtems/confdefs/inittask.h58
1 files changed, 49 insertions, 9 deletions
diff --git a/cpukit/include/rtems/confdefs/inittask.h b/cpukit/include/rtems/confdefs/inittask.h
index 08eddc0334..a1bf5d3b54 100644
--- a/cpukit/include/rtems/confdefs/inittask.h
+++ b/cpukit/include/rtems/confdefs/inittask.h
@@ -48,6 +48,7 @@
#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs/percpu.h>
+#include <rtems/confdefs/threads.h>
#include <rtems/rtems/object.h>
#include <rtems/rtems/tasksdata.h>
#include <rtems/sysinit.h>
@@ -72,15 +73,6 @@
#define CONFIGURE_INIT_TASK_PRIORITY 1
#endif
-#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
- #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
-#endif
-
-#if CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE
- #define _CONFIGURE_INIT_TASK_STACK_EXTRA \
- ( CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE )
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -121,6 +113,52 @@ RTEMS_STATIC_ASSERT(
#pragma GCC diagnostic pop
+#ifdef CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE
+
+#ifdef CONFIGURE_INIT_TASK_STACK_SIZE
+ #error "CONFIGURE_INIT_TASK_STACK_SIZE and CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE are mutually exclusive"
+#endif
+
+RTEMS_STATIC_ASSERT(
+ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE >= CONFIGURE_MINIMUM_TASK_STACK_SIZE,
+ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE_IS_TOO_SMALL
+);
+
+RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT )
+static char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ];
+
+const RTEMS_tasks_User_task_config _RTEMS_tasks_User_task_config = {
+ {
+ CONFIGURE_INIT_TASK_NAME,
+ CONFIGURE_INIT_TASK_PRIORITY,
+ _RTEMS_tasks_User_task_storage,
+ sizeof( _RTEMS_tasks_User_task_storage ),
+ CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE,
+ NULL,
+ CONFIGURE_INIT_TASK_INITIAL_MODES,
+ CONFIGURE_INIT_TASK_ATTRIBUTES,
+ },
+ CONFIGURE_INIT_TASK_ENTRY_POINT,
+ CONFIGURE_INIT_TASK_ARGUMENTS
+};
+
+RTEMS_SYSINIT_ITEM(
+ _RTEMS_tasks_Construct_user_task,
+ RTEMS_SYSINIT_CLASSIC_USER_TASKS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
+#else /* CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE */
+
+#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
+ #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
+#endif
+
+#if CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE
+ #define _CONFIGURE_INIT_TASK_STACK_EXTRA \
+ ( CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE )
+#endif
+
const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table = {
CONFIGURE_INIT_TASK_NAME,
CONFIGURE_INIT_TASK_STACK_SIZE,
@@ -137,6 +175,8 @@ RTEMS_SYSINIT_ITEM(
RTEMS_SYSINIT_ORDER_MIDDLE
);
+#endif /* CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE */
+
#ifdef __cplusplus
}
#endif