diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-10 09:59:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-10 10:11:32 +0200 |
commit | c983beffed4bd4d20ec459bb9a097ab25db7aa1b (patch) | |
tree | 66e818c6d8837df7b50724170ad7f1bae69019ad | |
parent | 103b160b1646f2523ca859dfdfd16bc0cf40ed5a (diff) |
validation: Test SMP fatal errors
3 files changed, 20 insertions, 3 deletions
diff --git a/testsuites/validation/tr-fatal-bsp-sparc-leon3-shutdown-response.c b/testsuites/validation/tr-fatal-bsp-sparc-leon3-shutdown-response.c index 1d04d6b51f..c6f22c2523 100644 --- a/testsuites/validation/tr-fatal-bsp-sparc-leon3-shutdown-response.c +++ b/testsuites/validation/tr-fatal-bsp-sparc-leon3-shutdown-response.c @@ -116,7 +116,7 @@ static T_fixture BspSparcLeon3ValFatalShutdownResponse_Fixture = { static void TriggerTestCase( void ) { - rtems_fatal( RTEMS_FATAL_SOURCE_SMP, 123456 ); + rtems_fatal( RTEMS_FATAL_SOURCE_APPLICATION, 123456 ); } RTEMS_SYSINIT_ITEM( @@ -143,7 +143,7 @@ static void BspSparcLeon3ValFatalShutdownResponse_Action_0( /* * Check that the expected fatal source is present. */ - T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_SMP ); + T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_APPLICATION ); /* * Check that the expected fatal code is present. diff --git a/testsuites/validation/ts-fatal-bsp-sparc-leon3-shutdown-response.c b/testsuites/validation/ts-fatal-bsp-sparc-leon3-shutdown-response.c index c31aef5a7f..6f5eb21bfb 100644 --- a/testsuites/validation/ts-fatal-bsp-sparc-leon3-shutdown-response.c +++ b/testsuites/validation/ts-fatal-bsp-sparc-leon3-shutdown-response.c @@ -52,6 +52,8 @@ #include "config.h" #endif +#include <rtems/score/smpimpl.h> + #include "tr-fatal-bsp-sparc-leon3-shutdown-response.h" #include <rtems/test.h> @@ -72,6 +74,17 @@ const char rtems_test_name[] = "FatalBspSparcLeon3ShutdownResponse"; #define FATAL_SYSINIT_RUN BspSparcLeon3ValFatalShutdownResponse_Run +static void FatalSysinitExit( rtems_fatal_code exit_code ) +{ + if ( exit_code == 0 ) { + rtems_fatal( RTEMS_FATAL_SOURCE_SMP, SMP_FATAL_SHUTDOWN ); + } else { + rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, exit_code ); + } +} + +#define FATAL_SYSINIT_EXIT( exit_code ) FatalSysinitExit( exit_code ) + #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_MAXIMUM_PROCESSORS 2 diff --git a/testsuites/validation/ts-fatal-sysinit.h b/testsuites/validation/ts-fatal-sysinit.h index 7793da79ce..25312c6ba6 100644 --- a/testsuites/validation/ts-fatal-sysinit.h +++ b/testsuites/validation/ts-fatal-sysinit.h @@ -72,7 +72,7 @@ static void TestSuiteFatalExtension( rtems_fatal_code code ) { - uint32_t exit_code; + rtems_fatal_code exit_code; (void) always_set_to_false; @@ -94,7 +94,11 @@ static void TestSuiteFatalExtension( exit_code = 1; } +#if defined(FATAL_SYSINIT_EXIT) + FATAL_SYSINIT_EXIT( exit_code ); +#else rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, exit_code ); +#endif } static void TestRunInitialize( void ) |