diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-10-23 17:15:47 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-10-23 17:15:47 +0200 |
commit | 17889b257caa73ae86118e6249baa359a6f52797 (patch) | |
tree | 997a1b67e40f6521d3daee46ffcd402b2aeceb3e /testsuites | |
parent | sapi: Report only if not an SMP shutdown response (diff) | |
download | rtems-17889b257caa73ae86118e6249baa359a6f52797.tar.bz2 |
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.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/smptests/smpfatal01/init.c | 11 | ||||
-rw-r--r-- | 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 <rtems/test.h> #include <rtems/score/percpu.h> #include <rtems/score/smpimpl.h> +#include <rtems/score/smpbarrier.h> #include <assert.h> #include <stdlib.h> @@ -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 <rtems/test.h> #include <rtems/score/percpu.h> #include <rtems/score/smpimpl.h> +#include <rtems/score/smpbarrier.h> #include <assert.h> #include <stdlib.h> @@ -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 |