[PATCH 07/10] Add system initialization step for target hash

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Feb 24 13:57:27 UTC 2021


Update #4267.
---
 cpukit/include/rtems/sysinit.h        |  1 +
 cpukit/sapi/src/sysinitverbose.c      | 10 +++++++++-
 testsuites/sptests/spsysinit01/init.c | 16 ++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h
index cb17a0fd77..3e85aa9a2b 100644
--- a/cpukit/include/rtems/sysinit.h
+++ b/cpukit/include/rtems/sysinit.h
@@ -39,6 +39,7 @@ extern "C" {
 #define RTEMS_SYSINIT_MALLOC                     000280
 #define RTEMS_SYSINIT_BSP_START                  000300
 #define RTEMS_SYSINIT_CPU_COUNTER                000400
+#define RTEMS_SYSINIT_TARGET_HASH                000480
 #define RTEMS_SYSINIT_INITIAL_EXTENSIONS         000500
 #define RTEMS_SYSINIT_MP_EARLY                   000600
 #define RTEMS_SYSINIT_DATA_STRUCTURES            000700
diff --git a/cpukit/sapi/src/sysinitverbose.c b/cpukit/sapi/src/sysinitverbose.c
index d05f1de9b3..31567198be 100644
--- a/cpukit/sapi/src/sysinitverbose.c
+++ b/cpukit/sapi/src/sysinitverbose.c
@@ -66,6 +66,7 @@ SYSINIT_VERBOSE( WORKSPACE );
 SYSINIT_VERBOSE( MALLOC );
 SYSINIT_VERBOSE( BSP_START );
 SYSINIT_VERBOSE( CPU_COUNTER );
+SYSINIT_VERBOSE( TARGET_HASH );
 SYSINIT_VERBOSE( INITIAL_EXTENSIONS );
 SYSINIT_VERBOSE( MP_EARLY );
 SYSINIT_VERBOSE( DATA_STRUCTURES );
@@ -272,9 +273,16 @@ static void _Sysinit_Verbose_CPU_COUNTER( void )
   }
 }
 
+static void _Sysinit_Verbose_TARGET_HASH( void )
+{
+  if ( !SYSINIT_IS_ADJACENT( CPU_COUNTER, TARGET_HASH ) ) {
+    printk( "sysinit: TARGET_HASH: done\n" );
+  }
+}
+
 static void _Sysinit_Verbose_INITIAL_EXTENSIONS( void )
 {
-  if ( !SYSINIT_IS_ADJACENT( CPU_COUNTER, INITIAL_EXTENSIONS ) ) {
+  if ( !SYSINIT_IS_ADJACENT( TARGET_HASH, INITIAL_EXTENSIONS ) ) {
     printk( "sysinit: INITIAL_EXTENSIONS: done\n" );
   }
 }
diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c
index 20b5922dae..13b4a1a802 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -77,6 +77,8 @@ typedef enum {
   BSP_START_POST,
   CPU_COUNTER_PRE,
   CPU_COUNTER_POST,
+  TARGET_HASH_PRE,
+  TARGET_HASH_POST,
   INITIAL_EXTENSIONS_PRE,
   INITIAL_EXTENSIONS_POST,
   DATA_STRUCTURES_PRE,
@@ -257,6 +259,20 @@ LAST(RTEMS_SYSINIT_CPU_COUNTER)
   next_step(CPU_COUNTER_POST);
 }
 
+FIRST(RTEMS_SYSINIT_TARGET_HASH)
+{
+  /*
+   * Since the work performed here is BSP-specific, there is no way to test pre
+   * and post conditions.
+   */
+  next_step(TARGET_HASH_PRE);
+}
+
+LAST(RTEMS_SYSINIT_TARGET_HASH)
+{
+  next_step(TARGET_HASH_POST);
+}
+
 FIRST(RTEMS_SYSINIT_INITIAL_EXTENSIONS)
 {
   assert(_Chain_Is_empty(&_User_extensions_Switches_list));
-- 
2.26.2



More information about the devel mailing list