From 17889b257caa73ae86118e6249baa359a6f52797 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 23 Oct 2014 17:15:47 +0200 Subject: tests/smptests: Use barriers in smpfatal0{12} Call the test extension explicitly and wait for report output using a barrier. This avoids problems with an early shutdown of the system. --- testsuites/smptests/smpfatal01/init.c | 11 +++++++++-- testsuites/smptests/smpfatal02/init.c | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/testsuites/smptests/smpfatal01/init.c b/testsuites/smptests/smpfatal01/init.c index 5ef9ffe41a..7f565d64bd 100644 --- a/testsuites/smptests/smpfatal01/init.c +++ b/testsuites/smptests/smpfatal01/init.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -30,6 +31,8 @@ const char rtems_test_name[] = "SMPFATAL 1"; static uint32_t main_cpu; +static SMP_barrier_Control barrier = SMP_BARRIER_CONTROL_INITIALIZER; + static void Init(rtems_task_argument arg) { assert(0); @@ -41,6 +44,8 @@ static void fatal_extension( rtems_fatal_code code ) { + SMP_barrier_State barrier_state = SMP_BARRIER_STATE_INITIALIZER; + if (source == RTEMS_FATAL_SOURCE_SMP) { uint32_t self = rtems_get_current_processor(); @@ -58,8 +63,11 @@ static void fatal_extension( } rtems_test_endk(); + rtems_test_fatal_extension(source, is_internal, code); } } + + _SMP_barrier_Wait(&barrier, &barrier_state, rtems_get_processor_count()); } static rtems_status_code test_driver_init( @@ -114,8 +122,7 @@ static rtems_status_code test_driver_init( { .initialization_entry = test_driver_init } #define CONFIGURE_INITIAL_EXTENSIONS \ - { .fatal = fatal_extension }, \ - RTEMS_TEST_INITIAL_EXTENSION + { .fatal = fatal_extension } #define CONFIGURE_SMP_APPLICATION diff --git a/testsuites/smptests/smpfatal02/init.c b/testsuites/smptests/smpfatal02/init.c index 266251f600..72d1ff5dc9 100644 --- a/testsuites/smptests/smpfatal02/init.c +++ b/testsuites/smptests/smpfatal02/init.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -30,6 +31,8 @@ const char rtems_test_name[] = "SMPFATAL 2"; static uint32_t main_cpu; +static SMP_barrier_Control barrier = SMP_BARRIER_CONTROL_INITIALIZER; + static void Init(rtems_task_argument arg) { assert(0); @@ -41,6 +44,8 @@ static void fatal_extension( rtems_fatal_code code ) { + SMP_barrier_State barrier_state = SMP_BARRIER_STATE_INITIALIZER; + if ( source == RTEMS_FATAL_SOURCE_APPLICATION || source == RTEMS_FATAL_SOURCE_SMP @@ -63,11 +68,14 @@ static void fatal_extension( } rtems_test_endk(); + rtems_test_fatal_extension(source, is_internal, code); } else { assert(source == RTEMS_FATAL_SOURCE_SMP); assert(code == SMP_FATAL_SHUTDOWN); } } + + _SMP_barrier_Wait(&barrier, &barrier_state, rtems_get_processor_count()); } static rtems_status_code test_driver_init( @@ -119,8 +127,7 @@ static rtems_status_code test_driver_init( { .initialization_entry = test_driver_init } #define CONFIGURE_INITIAL_EXTENSIONS \ - { .fatal = fatal_extension }, \ - RTEMS_TEST_INITIAL_EXTENSION + { .fatal = fatal_extension } #define CONFIGURE_SMP_APPLICATION -- cgit v1.2.3