[rtems commit] smptests/smpfatal03: Fix end of test output

Sebastian Huber sebh at rtems.org
Mon Mar 31 08:09:15 UTC 2014


Module:    rtems
Branch:    master
Commit:    2c83ac36582c28e23d415bc10b3fc7db636f2df3
Changeset: http://git.rtems.org/rtems/commit/?id=2c83ac36582c28e23d415bc10b3fc7db636f2df3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Mar 28 11:47:42 2014 +0100

smptests/smpfatal03: Fix end of test output

---

 testsuites/smptests/smpfatal03/init.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/testsuites/smptests/smpfatal03/init.c b/testsuites/smptests/smpfatal03/init.c
index 8dc3ee9..714e7b9 100644
--- a/testsuites/smptests/smpfatal03/init.c
+++ b/testsuites/smptests/smpfatal03/init.c
@@ -32,7 +32,9 @@ const char rtems_test_name[] = "SMPFATAL 3";
 
 static uint32_t main_cpu;
 
-static SMP_barrier_Control barrier = SMP_BARRIER_CONTROL_INITIALIZER;
+static SMP_barrier_Control giant_barrier = SMP_BARRIER_CONTROL_INITIALIZER;
+
+static SMP_barrier_Control fatal_barrier = SMP_BARRIER_CONTROL_INITIALIZER;
 
 static void acquire_giant_and_fatal_task(rtems_task_argument arg)
 {
@@ -43,7 +45,7 @@ static void acquire_giant_and_fatal_task(rtems_task_argument arg)
     _Giant_Acquire();
   }
 
-  _SMP_barrier_Wait(&barrier, &state, CPU_COUNT);
+  _SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT);
 
   /*
    * Now we have to wait some time so that the other thread can actually start
@@ -58,7 +60,7 @@ static void wait_for_giant(void)
 {
   SMP_barrier_State state = SMP_BARRIER_STATE_INITIALIZER;
 
-  _SMP_barrier_Wait(&barrier, &state, CPU_COUNT);
+  _SMP_barrier_Wait(&giant_barrier, &state, CPU_COUNT);
 
   _Giant_Acquire();
 }
@@ -107,18 +109,23 @@ static void fatal_extension(
       || source == RTEMS_FATAL_SOURCE_SMP
   ) {
     uint32_t self = rtems_smp_get_current_processor();
+    SMP_barrier_State state = SMP_BARRIER_STATE_INITIALIZER;
 
     assert(!is_internal);
 
     if (self == main_cpu) {
       assert(source == RTEMS_FATAL_SOURCE_SMP);
       assert(code == SMP_FATAL_SHUTDOWN);
-
-      rtems_test_endk();
     } else {
       assert(source == RTEMS_FATAL_SOURCE_APPLICATION);
       assert(code == 0xdeadbeef);
     }
+
+    _SMP_barrier_Wait(&fatal_barrier, &state, CPU_COUNT);
+
+    if (self == 0) {
+      rtems_test_endk();
+    }
   }
 }
 




More information about the vc mailing list