[PATCH] config: Place init task storage area in .rtemsstack

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Nov 7 09:09:46 UTC 2022


This avoids a superfluous zero initialization of the task storage area.  This
reduces the system initialization time.
---
 bsps/sh/gensh1/start/linkcmds            | 12 ++++++------
 bsps/sh/gensh2/start/linkcmds            | 12 ++++++------
 cpukit/include/rtems/confdefs/inittask.h |  3 ++-
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/bsps/sh/gensh1/start/linkcmds b/bsps/sh/gensh1/start/linkcmds
index d76f52ed61..b47eedaadf 100644
--- a/bsps/sh/gensh1/start/linkcmds
+++ b/bsps/sh/gensh1/start/linkcmds
@@ -191,15 +191,15 @@ SECTIONS
     *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
   } > ram
 
-  .rtemsstackidle (NOLOAD) : {
-    *(SORT(.rtemsstack.idle*))
-  } > ram
-
-  _WorkAreaBase = . ;
+  .rtemsstackinterrupt (NOLOAD) : {
+    *(.rtemsstack.interrupt)
+  } > onchip_ram
 
   .rtemsstack (NOLOAD) : {
     *(SORT(.rtemsstack.*))
-  } > onchip_ram
+  } > ram
+
+  _WorkAreaBase = . ;
 
   /* Stabs debugging sections.  */
   .stab 0 : { *(.stab) }
diff --git a/bsps/sh/gensh2/start/linkcmds b/bsps/sh/gensh2/start/linkcmds
index e06932a053..98178b6101 100644
--- a/bsps/sh/gensh2/start/linkcmds
+++ b/bsps/sh/gensh2/start/linkcmds
@@ -202,15 +202,15 @@ SECTIONS
     *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
   } > ram
 
-  .rtemsstackidle (NOLOAD) : {
-    *(SORT(.rtemsstack.idle*))
-  } > ram
-
-  _WorkAreaBase = . ;
+  .rtemsstackinterrupt (NOLOAD) : {
+    *(.rtemsstack.interrupt)
+  } > onchip_ram
 
   .rtemsstack (NOLOAD) : {
     *(SORT(.rtemsstack.*))
-  } > onchip_ram
+  } > ram
+
+  _WorkAreaBase = . ;
 
   /* Stabs debugging sections.  */
   .stab 0 : { *(.stab) }
diff --git a/cpukit/include/rtems/confdefs/inittask.h b/cpukit/include/rtems/confdefs/inittask.h
index 9dbf0b967b..006cbb781f 100644
--- a/cpukit/include/rtems/confdefs/inittask.h
+++ b/cpukit/include/rtems/confdefs/inittask.h
@@ -122,8 +122,9 @@ RTEMS_STATIC_ASSERT(
   CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE_IS_TOO_SMALL
 );
 
+static RTEMS_SECTION( ".rtemsstack.userinit" )
 RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT )
-static char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ];
+char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ];
 
 const RTEMS_tasks_User_task_config _RTEMS_tasks_User_task_config = {
   {
-- 
2.35.3



More information about the devel mailing list