summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-12-09 16:03:56 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-12-09 16:37:31 +0100
commita63a79e7d1eda9b8ae18004c827b737d1d824753 (patch)
tree840c1296ec351f3407c2be4c74afc7b12f6302b4
parentce7f103c53e6b1cabf6b14896145caf1520fafca (diff)
fatal
-rw-r--r--testsuites/validation/tc-score-fatal.c409
-rw-r--r--testsuites/validation/tc-start-of-optional-processor-failed.c116
-rw-r--r--testsuites/validation/tc-terminate.c442
-rw-r--r--testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.c159
-rw-r--r--testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.h84
-rw-r--r--testsuites/validation/tr-fatal-init-task-construct-failed.c158
-rw-r--r--testsuites/validation/tr-fatal-init-task-construct-failed.h84
-rw-r--r--testsuites/validation/tr-fatal-mandatory-processor-not-present.c158
-rw-r--r--testsuites/validation/tr-fatal-mandatory-processor-not-present.h84
-rw-r--r--testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.c159
-rw-r--r--testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.h84
-rw-r--r--testsuites/validation/tr-fatal-smp.c320
-rw-r--r--testsuites/validation/tr-fatal-smp.h81
-rw-r--r--testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.c166
-rw-r--r--testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.h84
-rw-r--r--testsuites/validation/tr-fatal-too-large-tls-size.c168
-rw-r--r--testsuites/validation/tr-fatal-too-large-tls-size.h84
17 files changed, 2840 insertions, 0 deletions
diff --git a/testsuites/validation/tc-score-fatal.c b/testsuites/validation/tc-score-fatal.c
new file mode 100644
index 0000000000..625835f722
--- /dev/null
+++ b/testsuites/validation/tc-score-fatal.c
@@ -0,0 +1,409 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreValFatal
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems.h>
+#include <setjmp.h>
+#include <string.h>
+#include <rtems/score/atomic.h>
+#include <rtems/score/isrlevel.h>
+#include <rtems/score/threaddispatch.h>
+
+#include "tx-support.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreValFatal spec:/score/val/fatal
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesValidation0
+ * @ingroup RTEMSTestSuiteTestsuitesValidationOneCpu0
+ *
+ * @brief Tests some fatal errors.
+ *
+ * This test case performs the following actions:
+ *
+ * - Construct a task with a task body which returns. Check that the right
+ * fatal error occurs.
+ *
+ * - Construct a task which performs a thread dispatch with maskable interrupts
+ * disabled. Check that the right fatal error occurs or no fatal error
+ * occurs.
+ *
+ * - Construct a task which performs a direct thread dispatch with a thread
+ * dispatch level not equal to one. Check that the right fatal error occurs.
+ *
+ * - Create a mutex and construct a task which produces a deadlock which
+ * involves the allocator mutex.
+ *
+ * - Check that rtems_fatal() terminates the system. Since SetFatalHandler()
+ * requires an initial extension this validates CONFIGURE_INITIAL_EXTENSIONS.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for spec:/score/val/fatal test case.
+ */
+typedef struct {
+ /**
+ * @brief This member is a fatal extension invocation counter.
+ */
+ Atomic_Uint counter;
+
+ /**
+ * @brief This member contains the last fatal source.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains the last fatal code.
+ */
+ rtems_fatal_code code;
+} ScoreValFatal_Context;
+
+static ScoreValFatal_Context
+ ScoreValFatal_Instance;
+
+typedef ScoreValFatal_Context Context;
+
+static unsigned int GetFatalCounter( const Context *ctx )
+{
+ return _Atomic_Load_uint( &ctx->counter, ATOMIC_ORDER_RELAXED );
+}
+
+static unsigned int ResetFatalInfo( Context *ctx )
+{
+ ctx->source = RTEMS_FATAL_SOURCE_APPLICATION;
+ ctx->code = INTERNAL_ERROR_NO_MPCI;
+
+ return GetFatalCounter( ctx );
+}
+
+static void Fatal(
+ rtems_fatal_source source,
+ rtems_fatal_code code,
+ Context *ctx
+)
+{
+ ctx->source = source;
+ ctx->code = code;
+ _Atomic_Fetch_add_uint( &ctx->counter, 1, ATOMIC_ORDER_RELAXED );
+}
+
+static void FatalTaskExit(
+ rtems_fatal_source source,
+ rtems_fatal_code code,
+ void *arg
+)
+{
+ Fatal( source, code, arg );
+ rtems_task_exit();
+}
+
+static void ExitTask( rtems_task_argument arg )
+{
+ (void) arg;
+}
+
+static void FatalBadThreadDispatchEnvironment(
+ rtems_fatal_source source,
+ rtems_fatal_code code,
+ void *arg
+)
+{
+ Fatal( source, code, arg );
+ _ISR_Set_level( 0 );
+ _Thread_Dispatch_direct_no_return( _Per_CPU_Get() );
+}
+
+static void ISRDisabledThreadDispatchTask( rtems_task_argument arg )
+{
+ rtems_interrupt_level level;
+
+ (void) arg;
+ rtems_interrupt_local_disable( level );
+ (void) level;
+ rtems_task_exit();
+}
+
+static void FatalBadThreadDispatchDisableLevel(
+ rtems_fatal_source source,
+ rtems_fatal_code code,
+ void *arg
+)
+{
+ Per_CPU_Control *cpu_self;
+
+ Fatal( source, code, arg );
+ cpu_self = _Per_CPU_Get();
+ _Thread_Dispatch_unnest( cpu_self );
+ _Thread_Dispatch_direct_no_return( cpu_self );
+}
+
+static void BadLevelThreadDispatchTask( rtems_task_argument arg )
+{
+ (void) arg;
+ _Thread_Dispatch_disable();
+ rtems_task_exit();
+}
+
+static jmp_buf before_fatal;
+
+static rtems_id deadlock_mutex;
+
+static bool ThreadCreateDeadlock( rtems_tcb *executing, rtems_tcb *created )
+{
+ (void) executing;
+ (void) created;
+
+ ObtainMutex( deadlock_mutex );
+ ReleaseMutex( deadlock_mutex );
+
+ return true;
+}
+
+static void FatalJumpBack(
+ rtems_fatal_source source,
+ rtems_fatal_code code,
+ void *arg
+)
+{
+ SetFatalHandler( NULL, NULL );
+ Fatal( source, code, arg );
+ longjmp( before_fatal, 1 );
+}
+
+static void ThreadQueueDeadlockTask( rtems_task_argument arg )
+{
+ rtems_id id;
+
+ (void) arg;
+ id = CreateTask( "DORM", PRIO_NORMAL );
+ DeleteTask( id );
+
+ rtems_task_exit();
+}
+
+static T_fixture ScoreValFatal_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &ScoreValFatal_Instance
+};
+
+/**
+ * @brief Construct a task with a task body which returns. Check that the
+ * right fatal error occurs.
+ */
+static void ScoreValFatal_Action_0( ScoreValFatal_Context *ctx )
+{
+ rtems_id id;
+ unsigned int counter;
+
+ SetFatalHandler( FatalTaskExit, ctx );
+ SetSelfPriority( PRIO_NORMAL );
+ counter = ResetFatalInfo( ctx );
+ id = CreateTask( "EXIT", PRIO_HIGH );
+ StartTask( id, ExitTask, NULL );
+ T_eq_uint( GetFatalCounter( ctx ), counter + 1 );
+ T_eq_int( ctx->source, INTERNAL_ERROR_CORE );
+ T_eq_ulong( ctx->code, INTERNAL_ERROR_THREAD_EXITTED );
+ RestoreRunnerPriority();
+ SetFatalHandler( NULL, NULL );
+}
+
+/**
+ * @brief Construct a task which performs a thread dispatch with maskable
+ * interrupts disabled. Check that the right fatal error occurs or no fatal
+ * error occurs.
+ */
+static void ScoreValFatal_Action_1( ScoreValFatal_Context *ctx )
+{
+ rtems_id id;
+ unsigned int counter;
+
+ SetFatalHandler( FatalBadThreadDispatchEnvironment, ctx );
+ SetSelfPriority( PRIO_NORMAL );
+ counter = ResetFatalInfo( ctx );
+ id = CreateTask( "BENV", PRIO_HIGH );
+ StartTask( id, ISRDisabledThreadDispatchTask, NULL );
+
+ #if CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE
+ if ( rtems_configuration_get_maximum_processors() > 1 ) {
+ #endif
+ T_eq_uint( GetFatalCounter( ctx ), counter + 1 );
+ T_eq_int( ctx->source, INTERNAL_ERROR_CORE );
+ T_eq_ulong( ctx->code, INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT );
+ #if CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE
+ } else {
+ T_eq_uint( GetFatalCounter( ctx ), counter );
+ }
+ #endif
+
+ RestoreRunnerPriority();
+ SetFatalHandler( NULL, NULL );
+}
+
+/**
+ * @brief Construct a task which performs a direct thread dispatch with a
+ * thread dispatch level not equal to one. Check that the right fatal error
+ * occurs.
+ */
+static void ScoreValFatal_Action_2( ScoreValFatal_Context *ctx )
+{
+ rtems_id id;
+ unsigned int counter;
+
+ SetFatalHandler( FatalBadThreadDispatchDisableLevel, ctx );
+ SetSelfPriority( PRIO_NORMAL );
+ counter = ResetFatalInfo( ctx );
+ id = CreateTask( "BLVL", PRIO_HIGH );
+ StartTask( id, BadLevelThreadDispatchTask, NULL );
+ T_eq_uint( GetFatalCounter( ctx ), counter + 1 );
+ T_eq_int( ctx->source, INTERNAL_ERROR_CORE );
+ T_eq_ulong( ctx->code, INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL );
+ RestoreRunnerPriority();
+ SetFatalHandler( NULL, NULL );
+}
+
+/**
+ * @brief Create a mutex and construct a task which produces a deadlock which
+ * involves the allocator mutex.
+ */
+static void ScoreValFatal_Action_3( ScoreValFatal_Context *ctx )
+{
+ rtems_extensions_table extensions;
+ rtems_status_code sc;
+ rtems_id extension_id;
+ rtems_id task_id;
+ unsigned int counter;
+
+ memset( &extensions, 0, sizeof( extensions ) );
+ extensions.thread_create = ThreadCreateDeadlock;
+
+ sc = rtems_extension_create(
+ rtems_build_name( 'T', 'E', 'X', 'T' ),
+ &extensions,
+ &extension_id
+ );
+ T_rsc_success( sc );
+
+ deadlock_mutex = CreateMutex();
+
+ SetFatalHandler( FatalJumpBack, ctx );
+ SetSelfPriority( PRIO_NORMAL );
+ counter = ResetFatalInfo( ctx );
+
+ ObtainMutex( deadlock_mutex );
+
+ task_id = CreateTask( "WORK", PRIO_HIGH );
+ StartTask( task_id, ThreadQueueDeadlockTask, NULL );
+
+ if ( setjmp( before_fatal ) == 0 ) {
+ (void) CreateTask( "DLCK", PRIO_NORMAL );
+ }
+
+ ReleaseMutex( deadlock_mutex );
+
+ T_eq_uint( GetFatalCounter( ctx ), counter + 1 );
+ T_eq_int( ctx->source, INTERNAL_ERROR_CORE );
+ T_eq_ulong( ctx->code, INTERNAL_ERROR_THREAD_QUEUE_DEADLOCK );
+
+ RestoreRunnerPriority();
+
+ sc = rtems_extension_delete( extension_id );
+ T_rsc_success( sc );
+
+ DeleteMutex( deadlock_mutex );
+}
+
+/**
+ * @brief Check that rtems_fatal() terminates the system. Since
+ * SetFatalHandler() requires an initial extension this validates
+ * CONFIGURE_INITIAL_EXTENSIONS.
+ */
+static void ScoreValFatal_Action_4( ScoreValFatal_Context *ctx )
+{
+ unsigned int counter;
+
+ SetFatalHandler( FatalJumpBack, ctx );
+ counter = ResetFatalInfo( ctx );
+
+ if ( setjmp( before_fatal ) == 0 ) {
+ rtems_fatal( 123, 4567890 );
+ }
+
+ T_eq_uint( GetFatalCounter( ctx ), counter + 1 );
+ T_eq_int( ctx->source, 123 );
+ T_eq_ulong( ctx->code, 4567890 );
+}
+
+/**
+ * @fn void T_case_body_ScoreValFatal( void )
+ */
+T_TEST_CASE_FIXTURE( ScoreValFatal, &ScoreValFatal_Fixture )
+{
+ ScoreValFatal_Context *ctx;
+
+ ctx = T_fixture_context();
+
+ ScoreValFatal_Action_0( ctx );
+ ScoreValFatal_Action_1( ctx );
+ ScoreValFatal_Action_2( ctx );
+ ScoreValFatal_Action_3( ctx );
+ ScoreValFatal_Action_4( ctx );
+}
+
+/** @} */
diff --git a/testsuites/validation/tc-start-of-optional-processor-failed.c b/testsuites/validation/tc-start-of-optional-processor-failed.c
new file mode 100644
index 0000000000..b033a18bae
--- /dev/null
+++ b/testsuites/validation/tc-start-of-optional-processor-failed.c
@@ -0,0 +1,116 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValStartOfOptionalProcessorFailed
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/percpu.h>
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreSmpValStartOfOptionalProcessorFailed \
+ * spec:/score/smp/val/start-of-optional-processor-failed
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesValidationSmpOnly2
+ *
+ * @brief Tests the state of an optional processor which failed to start.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action was carried by the system initialization. If we execute
+ * this test case, then the failed start of an optional processor did not
+ * abort the system initialization.
+ *
+ * - Check that the boot processor is online.
+ *
+ * - Check that the optional processor which failed to start is not online.
+ *
+ * @{
+ */
+
+/**
+ * @brief The test action was carried by the system initialization. If we
+ * execute this test case, then the failed start of an optional processor did
+ * not abort the system initialization.
+ */
+static void ScoreSmpValStartOfOptionalProcessorFailed_Action_0( void )
+{
+ /* Nothing to do */
+
+ /*
+ * Check that the boot processor is online.
+ */
+ T_step_true(
+ 0,
+ _Per_CPU_Is_processor_online( _Per_CPU_Get_by_index( 0 ) )
+ );
+
+ /*
+ * Check that the optional processor which failed to start is not online.
+ */
+ T_step_false(
+ 1,
+ _Per_CPU_Is_processor_online( _Per_CPU_Get_by_index( 1 ) )
+ );
+}
+
+/**
+ * @fn void T_case_body_ScoreSmpValStartOfOptionalProcessorFailed( void )
+ */
+T_TEST_CASE( ScoreSmpValStartOfOptionalProcessorFailed )
+{
+ T_plan( 2 );
+
+ ScoreSmpValStartOfOptionalProcessorFailed_Action_0();
+}
+
+/** @} */
diff --git a/testsuites/validation/tc-terminate.c b/testsuites/validation/tc-terminate.c
new file mode 100644
index 0000000000..4ad4dfa3b7
--- /dev/null
+++ b/testsuites/validation/tc-terminate.c
@@ -0,0 +1,442 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreInterrValTerminate
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <bsp.h>
+#include <setjmp.h>
+#include <string.h>
+#include <rtems/bspIo.h>
+#include <rtems/score/atomic.h>
+#include <rtems/score/io.h>
+#include <rtems/score/percpu.h>
+#include <rtems/score/sysstate.h>
+
+#include "tc-userext.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreInterrValTerminate \
+ * spec:/score/interr/val/terminate
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesTerminate
+ *
+ * @brief Tests system termination procedure.
+ *
+ * This test case performs the following actions:
+ *
+ * - Create five dynamic extensions. Call the system termination procedure.
+ * Delete three dynamic extension during the fatal extension invocation.
+ * Delete the two remaining dynamic extensions.
+ *
+ * - Check that the fatal extensions were invoked with the expected source.
+ *
+ * - Check that the fatal extensions were invoked with the expected always
+ * set to false argument.
+ *
+ * - Check that the fatal extensions were invoked with the expected code.
+ *
+ * - Check that the fatal extensions were invoked in forward order.
+ *
+ * - Check that the fatal extension in the deleted extension set was not
+ * invoked.
+ *
+ * - Check that the system state is terminated.
+ *
+ * - Where the system was built with SMP support enabled, check that a
+ * shutdown request was issued.
+ *
+ * - Check that the system was halted with the expected fatal source.
+ *
+ * - Check that the system was halted with the expected fatal code.
+ *
+ * - Check that the system was finally halted.
+ *
+ * @{
+ */
+
+typedef struct {
+ unsigned int counter;
+ rtems_fatal_source source;
+ bool always_set_to_false;
+ rtems_fatal_code code;
+} FatalInfo;
+
+static Atomic_Uint counter;
+
+static FatalInfo info[ 7 ];
+
+static bool test_case_active;
+
+static const rtems_extensions_table bsp = BSP_INITIAL_EXTENSION;
+
+static jmp_buf before_terminate;
+
+static unsigned int halt_counter;
+
+static rtems_fatal_source halt_source;
+
+static rtems_fatal_code halt_code;
+
+static rtems_id extension_ids[ 7 ];
+
+static unsigned int GetCounter( void )
+{
+ return _Atomic_Fetch_add_uint( &counter, 1, ATOMIC_ORDER_RELAXED ) + 1;
+}
+
+void __real__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr code );
+
+void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr code );
+
+void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr code )
+{
+ if ( test_case_active ) {
+ halt_counter = GetCounter();
+ halt_source = source;
+ halt_code = code;
+ longjmp( before_terminate, 1 );
+ } else {
+#if defined(RTEMS_COVERAGE)
+ _IO_Dump_gcov_info( rtems_put_char, NULL );
+#endif
+ __real__CPU_Fatal_halt( source, code );
+ }
+}
+
+static void FatalExtension(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code,
+ size_t index
+)
+{
+ if ( test_case_active ) {
+ info[ index ].counter = GetCounter();
+ info[ index ].source = source;
+ info[ index ].always_set_to_false = always_set_to_false;
+ info[ index ].code = code;
+ } else {
+ ( *bsp.fatal )( source, always_set_to_false, code );
+ }
+}
+
+void FatalExtension0(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ FatalExtension( source, always_set_to_false, code, 0 );
+}
+
+void FatalExtension1(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ FatalExtension( source, always_set_to_false, code, 1 );
+}
+
+static void FatalExtension2(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ rtems_status_code sc;
+
+ FatalExtension( source, always_set_to_false, code, 2 );
+
+ sc = rtems_extension_delete( extension_ids[ 3 ] );
+ T_quiet_rsc_success( sc );
+}
+
+static void FatalExtension3(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ FatalExtension( source, always_set_to_false, code, 3 );
+}
+
+static void FatalExtension4(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ FatalExtension( source, always_set_to_false, code, 4 );
+}
+
+static void FatalExtension5(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ rtems_status_code sc;
+
+ FatalExtension( source, always_set_to_false, code, 5 );
+
+ sc = rtems_extension_delete( extension_ids[ 5 ] );
+ T_quiet_rsc_success( sc );
+}
+
+static void FatalExtension6(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ rtems_status_code sc;
+
+ FatalExtension( source, always_set_to_false, code, 6 );
+
+ sc = rtems_extension_delete( extension_ids[ 4 ] );
+ T_quiet_rsc_success( sc );
+}
+
+/**
+ * @brief Create five dynamic extensions. Call the system termination
+ * procedure. Delete three dynamic extension during the fatal extension
+ * invocation. Delete the two remaining dynamic extensions.
+ */
+static void ScoreInterrValTerminate_Action_0( void )
+{
+ rtems_status_code sc;
+ rtems_extensions_table table;
+ bool shutdown_ok;
+
+ #if defined(RTEMS_SMP)
+ shutdown_ok =
+ ( _Per_CPU_Get_state( _Per_CPU_Get_snapshot() ) == PER_CPU_STATE_UP );
+ #else
+ shutdown_ok = true;
+ #endif
+
+ memset( &table, 0, sizeof( table ) );
+
+ table.fatal = FatalExtension2;
+ sc = rtems_extension_create(
+ rtems_build_name( ' ', ' ', ' ', '2' ),
+ &table,
+ &extension_ids[ 2 ]
+ );
+ T_step_rsc_success( 0, sc );
+
+ table.fatal = FatalExtension3;
+ sc = rtems_extension_create(
+ rtems_build_name( ' ', ' ', ' ', '3' ),
+ &table,
+ &extension_ids[ 3 ]
+ );
+ T_step_rsc_success( 1, sc );
+
+ table.fatal = FatalExtension4;
+ sc = rtems_extension_create(
+ rtems_build_name( ' ', ' ', ' ', '4' ),
+ &table,
+ &extension_ids[ 4 ]
+ );
+ T_step_rsc_success( 2, sc );
+
+ table.fatal = FatalExtension5;
+ sc = rtems_extension_create(
+ rtems_build_name( ' ', ' ', ' ', '5' ),
+ &table,
+ &extension_ids[ 5 ]
+ );
+ T_step_rsc_success( 3, sc );
+
+ table.fatal = FatalExtension6;
+ sc = rtems_extension_create(
+ rtems_build_name( ' ', ' ', ' ', '6' ),
+ &table,
+ &extension_ids[ 6 ]
+ );
+ T_step_rsc_success( 4, sc );
+
+ test_case_active = true;
+
+ if ( setjmp( before_terminate ) == 0 ) {
+ _Terminate( RTEMS_FATAL_SOURCE_APPLICATION, 123456 );
+ }
+
+ test_case_active = false;
+
+ sc = rtems_extension_delete( extension_ids[ 2 ] );
+ T_step_rsc_success( 5, sc );
+
+ sc = rtems_extension_delete( extension_ids[ 6 ] );
+ T_step_rsc_success( 6, sc );
+
+ /*
+ * Check that the fatal extensions were invoked with the expected source.
+ */
+ T_step_eq_int(
+ 7,
+ info[ 0 ].source,
+ RTEMS_FATAL_SOURCE_APPLICATION
+ );
+ T_step_eq_int(
+ 8,
+ info[ 1 ].source,
+ RTEMS_FATAL_SOURCE_APPLICATION
+ );
+ T_step_eq_int(
+ 9,
+ info[ 2 ].source,
+ RTEMS_FATAL_SOURCE_APPLICATION
+ );
+ T_step_eq_int(
+ 10,
+ info[ 4 ].source,
+ RTEMS_FATAL_SOURCE_APPLICATION
+ );
+ T_step_eq_int(
+ 11,
+ info[ 5 ].source,
+ RTEMS_FATAL_SOURCE_APPLICATION
+ );
+ T_step_eq_int(
+ 12,
+ info[ 6 ].source,
+ RTEMS_FATAL_SOURCE_APPLICATION
+ );
+
+ /*
+ * Check that the fatal extensions were invoked with the expected always set
+ * to false argument.
+ */
+ T_step_false( 13, info[ 0 ].always_set_to_false );
+ T_step_false( 14, info[ 1 ].always_set_to_false );
+ T_step_false( 15, info[ 2 ].always_set_to_false );
+ T_step_false( 16, info[ 4 ].always_set_to_false );
+ T_step_false( 17, info[ 5 ].always_set_to_false );
+ T_step_false( 18, info[ 6 ].always_set_to_false );
+
+ /*
+ * Check that the fatal extensions were invoked with the expected code.
+ */
+ T_step_eq_ulong( 19, info[ 0 ].code, 123456 );
+ T_step_eq_ulong( 20, info[ 1 ].code, 123456 );
+ T_step_eq_ulong( 21, info[ 2 ].code, 123456 );
+ T_step_eq_ulong( 22, info[ 4 ].code, 123456 );
+ T_step_eq_ulong( 23, info[ 5 ].code, 123456 );
+ T_step_eq_ulong( 24, info[ 6 ].code, 123456 );
+
+ /*
+ * Check that the fatal extensions were invoked in forward order.
+ */
+ T_step_eq_uint( 25, info[ 0 ].counter, 1 );
+ T_step_eq_uint( 26, info[ 1 ].counter, 2 );
+ T_step_eq_uint( 27, info[ 2 ].counter, 3 );
+ T_step_eq_uint( 28, info[ 4 ].counter, 4 );
+ T_step_eq_uint( 29, info[ 5 ].counter, 5 );
+ T_step_eq_uint( 30, info[ 6 ].counter, 6 );
+
+ /*
+ * Check that the fatal extension in the deleted extension set was not
+ * invoked.
+ */
+ T_step_eq_int( 31, info[ 3 ].source, 0 );
+ T_step_false( 32, info[ 3 ].always_set_to_false );
+ T_step_eq_ulong( 33, info[ 3 ].code, 0 );
+ T_step_eq_uint( 34, info[ 3 ].counter, 0 );
+
+ /*
+ * Check that the system state is terminated.
+ */
+ T_step_eq_int( 35, _System_state_Get(), SYSTEM_STATE_TERMINATED );
+
+ /*
+ * Where the system was built with SMP support enabled, check that a shutdown
+ * request was issued.
+ */
+ #if defined(RTEMS_SMP)
+ shutdown_ok = ( shutdown_ok && _ISR_Get_level() != 0 &&
+ _Per_CPU_Get_state( _Per_CPU_Get() ) == PER_CPU_STATE_SHUTDOWN );
+ _ISR_Set_level( 0 );
+ #endif
+ T_step_true( 36, shutdown_ok );
+
+ /*
+ * Check that the system was halted with the expected fatal source.
+ */
+ T_step_eq_int( 37, halt_source, RTEMS_FATAL_SOURCE_APPLICATION );
+
+ /*
+ * Check that the system was halted with the expected fatal code.
+ */
+ T_step_eq_ulong( 38, halt_code, 123456 );
+
+ /*
+ * Check that the system was finally halted.
+ */
+ T_step_eq_uint( 39, counter, 7 );
+}
+
+/**
+ * @fn void T_case_body_ScoreInterrValTerminate( void )
+ */
+T_TEST_CASE( ScoreInterrValTerminate )
+{
+ T_plan( 40 );
+
+ ScoreInterrValTerminate_Action_0();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.c b/testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.c
new file mode 100644
index 0000000000..f7cf1e1eb8
--- /dev/null
+++ b/testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.c
@@ -0,0 +1,159 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalBootProcessorNotAssignedToScheduler
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/smpimpl.h>
+
+#include "tr-fatal-boot-processor-not-assigned-to-scheduler.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreSmpValFatalBootProcessorNotAssignedToScheduler \
+ * spec:/score/smp/val/fatal-boot-processor-not-assigned-to-scheduler
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalBootProcessorNotAssignedToScheduler
+ *
+ * @brief Tests a fatal error.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action is carried out by the application configuration of the
+ * test suite.
+ *
+ * - Check that the expected fatal source is present.
+ *
+ * - Check that the expected fatal code is present.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for
+ * spec:/score/smp/val/fatal-boot-processor-not-assigned-to-scheduler test
+ * case.
+ */
+typedef struct {
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Run() parameter.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Run() parameter.
+ */
+ rtems_fatal_code code;
+} ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Context;
+
+static ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Context
+ ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Instance;
+
+static T_fixture ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Instance
+};
+
+/**
+ * @brief The test action is carried out by the application configuration of
+ * the test suite.
+ */
+static void ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Action_0(
+ ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Context *ctx
+)
+{
+ /* Nothing to do */
+
+ /*
+ * Check that the expected fatal source is present.
+ */
+ T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_SMP );
+
+ /*
+ * Check that the expected fatal code is present.
+ */
+ T_step_eq_ulong(
+ 1,
+ ctx->code,
+ SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER
+ );
+}
+
+void ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+)
+{
+ ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Context *ctx;
+
+ ctx = &ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Instance;
+ ctx->source = source;
+ ctx->code = code;
+
+ ctx = T_case_begin(
+ "ScoreSmpValFatalBootProcessorNotAssignedToScheduler",
+ &ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Fixture
+ );
+
+ T_plan( 2 );
+
+ ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Action_0( ctx );
+
+ T_case_end();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.h b/testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.h
new file mode 100644
index 0000000000..3cf19f5322
--- /dev/null
+++ b/testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalBootProcessorNotAssignedToScheduler
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifndef _TR_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER_H
+#define _TR_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER_H
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSTestCaseScoreSmpValFatalBootProcessorNotAssignedToScheduler
+ *
+ * @{
+ */
+
+/**
+ * @brief Runs the parameterized test case.
+ *
+ * @param source is fatal source.
+ *
+ * @param code is fatal code.
+ */
+void ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TR_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER_H */
diff --git a/testsuites/validation/tr-fatal-init-task-construct-failed.c b/testsuites/validation/tr-fatal-init-task-construct-failed.c
new file mode 100644
index 0000000000..9e9b4c865b
--- /dev/null
+++ b/testsuites/validation/tr-fatal-init-task-construct-failed.c
@@ -0,0 +1,158 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseAcfgValFatalInitTaskConstructFailed
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems.h>
+
+#include "tr-fatal-init-task-construct-failed.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseAcfgValFatalInitTaskConstructFailed \
+ * spec:/acfg/val/fatal-init-task-construct-failed
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalInitTaskConstructFailed
+ *
+ * @brief Tests a fatal error.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action is carried out by configuring an invalid task priority
+ * used to construct the initialization task.
+ *
+ * - Check that the expected fatal source is present.
+ *
+ * - Check that the expected fatal code is present.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for spec:/acfg/val/fatal-init-task-construct-failed test
+ * case.
+ */
+typedef struct {
+ /**
+ * @brief This member contains a copy of the corresponding
+ * AcfgValFatalInitTaskConstructFailed_Run() parameter.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains a copy of the corresponding
+ * AcfgValFatalInitTaskConstructFailed_Run() parameter.
+ */
+ rtems_fatal_code code;
+} AcfgValFatalInitTaskConstructFailed_Context;
+
+static AcfgValFatalInitTaskConstructFailed_Context
+ AcfgValFatalInitTaskConstructFailed_Instance;
+
+static T_fixture AcfgValFatalInitTaskConstructFailed_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &AcfgValFatalInitTaskConstructFailed_Instance
+};
+
+/**
+ * @brief The test action is carried out by configuring an invalid task
+ * priority used to construct the initialization task.
+ */
+static void AcfgValFatalInitTaskConstructFailed_Action_0(
+ AcfgValFatalInitTaskConstructFailed_Context *ctx
+)
+{
+ /* Nothing to do */
+
+ /*
+ * Check that the expected fatal source is present.
+ */
+ T_step_eq_int( 0, ctx->source, INTERNAL_ERROR_CORE );
+
+ /*
+ * Check that the expected fatal code is present.
+ */
+ T_step_eq_ulong(
+ 1,
+ ctx->code,
+ INTERNAL_ERROR_RTEMS_INIT_TASK_CONSTRUCT_FAILED
+ );
+}
+
+void AcfgValFatalInitTaskConstructFailed_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+)
+{
+ AcfgValFatalInitTaskConstructFailed_Context *ctx;
+
+ ctx = &AcfgValFatalInitTaskConstructFailed_Instance;
+ ctx->source = source;
+ ctx->code = code;
+
+ ctx = T_case_begin(
+ "AcfgValFatalInitTaskConstructFailed",
+ &AcfgValFatalInitTaskConstructFailed_Fixture
+ );
+
+ T_plan( 2 );
+
+ AcfgValFatalInitTaskConstructFailed_Action_0( ctx );
+
+ T_case_end();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-init-task-construct-failed.h b/testsuites/validation/tr-fatal-init-task-construct-failed.h
new file mode 100644
index 0000000000..1685ed567f
--- /dev/null
+++ b/testsuites/validation/tr-fatal-init-task-construct-failed.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseAcfgValFatalInitTaskConstructFailed
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifndef _TR_FATAL_INIT_TASK_CONSTRUCT_FAILED_H
+#define _TR_FATAL_INIT_TASK_CONSTRUCT_FAILED_H
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSTestCaseAcfgValFatalInitTaskConstructFailed
+ *
+ * @{
+ */
+
+/**
+ * @brief Runs the parameterized test case.
+ *
+ * @param source is fatal source.
+ *
+ * @param code is fatal code.
+ */
+void AcfgValFatalInitTaskConstructFailed_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TR_FATAL_INIT_TASK_CONSTRUCT_FAILED_H */
diff --git a/testsuites/validation/tr-fatal-mandatory-processor-not-present.c b/testsuites/validation/tr-fatal-mandatory-processor-not-present.c
new file mode 100644
index 0000000000..0f2435d0d5
--- /dev/null
+++ b/testsuites/validation/tr-fatal-mandatory-processor-not-present.c
@@ -0,0 +1,158 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalMandatoryProcessorNotPresent
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/smpimpl.h>
+
+#include "tr-fatal-mandatory-processor-not-present.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreSmpValFatalMandatoryProcessorNotPresent \
+ * spec:/score/smp/val/fatal-mandatory-processor-not-present
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalMandatoryProcessorNotPresent
+ *
+ * @brief Tests a fatal error.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action is carried out by the application configuration of the
+ * test suite.
+ *
+ * - Check that the expected fatal source is present.
+ *
+ * - Check that the expected fatal code is present.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for
+ * spec:/score/smp/val/fatal-mandatory-processor-not-present test case.
+ */
+typedef struct {
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalMandatoryProcessorNotPresent_Run() parameter.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalMandatoryProcessorNotPresent_Run() parameter.
+ */
+ rtems_fatal_code code;
+} ScoreSmpValFatalMandatoryProcessorNotPresent_Context;
+
+static ScoreSmpValFatalMandatoryProcessorNotPresent_Context
+ ScoreSmpValFatalMandatoryProcessorNotPresent_Instance;
+
+static T_fixture ScoreSmpValFatalMandatoryProcessorNotPresent_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &ScoreSmpValFatalMandatoryProcessorNotPresent_Instance
+};
+
+/**
+ * @brief The test action is carried out by the application configuration of
+ * the test suite.
+ */
+static void ScoreSmpValFatalMandatoryProcessorNotPresent_Action_0(
+ ScoreSmpValFatalMandatoryProcessorNotPresent_Context *ctx
+)
+{
+ /* Nothing to do */
+
+ /*
+ * Check that the expected fatal source is present.
+ */
+ T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_SMP );
+
+ /*
+ * Check that the expected fatal code is present.
+ */
+ T_step_eq_ulong(
+ 1,
+ ctx->code,
+ SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT
+ );
+}
+
+void ScoreSmpValFatalMandatoryProcessorNotPresent_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+)
+{
+ ScoreSmpValFatalMandatoryProcessorNotPresent_Context *ctx;
+
+ ctx = &ScoreSmpValFatalMandatoryProcessorNotPresent_Instance;
+ ctx->source = source;
+ ctx->code = code;
+
+ ctx = T_case_begin(
+ "ScoreSmpValFatalMandatoryProcessorNotPresent",
+ &ScoreSmpValFatalMandatoryProcessorNotPresent_Fixture
+ );
+
+ T_plan( 2 );
+
+ ScoreSmpValFatalMandatoryProcessorNotPresent_Action_0( ctx );
+
+ T_case_end();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-mandatory-processor-not-present.h b/testsuites/validation/tr-fatal-mandatory-processor-not-present.h
new file mode 100644
index 0000000000..fd41d1b961
--- /dev/null
+++ b/testsuites/validation/tr-fatal-mandatory-processor-not-present.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalMandatoryProcessorNotPresent
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifndef _TR_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT_H
+#define _TR_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT_H
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSTestCaseScoreSmpValFatalMandatoryProcessorNotPresent
+ *
+ * @{
+ */
+
+/**
+ * @brief Runs the parameterized test case.
+ *
+ * @param source is fatal source.
+ *
+ * @param code is fatal code.
+ */
+void ScoreSmpValFatalMandatoryProcessorNotPresent_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TR_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT_H */
diff --git a/testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.c b/testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.c
new file mode 100644
index 0000000000..aefe76bb31
--- /dev/null
+++ b/testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.c
@@ -0,0 +1,159 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalSchedulerRequiresExactlyOneProcessor
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/smpimpl.h>
+
+#include "tr-fatal-scheduler-requires-exactly-one-processor.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreSmpValFatalSchedulerRequiresExactlyOneProcessor \
+ * spec:/score/smp/val/fatal-scheduler-requires-exactly-one-processor
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalSchedulerRequiresExactlyOneProcessor
+ *
+ * @brief Tests a fatal error.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action is carried out by the application configuration of the
+ * test suite.
+ *
+ * - Check that the expected fatal source is present.
+ *
+ * - Check that the expected fatal code is present.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for
+ * spec:/score/smp/val/fatal-scheduler-requires-exactly-one-processor test
+ * case.
+ */
+typedef struct {
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Run() parameter.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Run() parameter.
+ */
+ rtems_fatal_code code;
+} ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Context;
+
+static ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Context
+ ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Instance;
+
+static T_fixture ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Instance
+};
+
+/**
+ * @brief The test action is carried out by the application configuration of
+ * the test suite.
+ */
+static void ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Action_0(
+ ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Context *ctx
+)
+{
+ /* Nothing to do */
+
+ /*
+ * Check that the expected fatal source is present.
+ */
+ T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_SMP );
+
+ /*
+ * Check that the expected fatal code is present.
+ */
+ T_step_eq_ulong(
+ 1,
+ ctx->code,
+ SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR
+ );
+}
+
+void ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+)
+{
+ ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Context *ctx;
+
+ ctx = &ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Instance;
+ ctx->source = source;
+ ctx->code = code;
+
+ ctx = T_case_begin(
+ "ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor",
+ &ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Fixture
+ );
+
+ T_plan( 2 );
+
+ ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Action_0( ctx );
+
+ T_case_end();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.h b/testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.h
new file mode 100644
index 0000000000..2d0e3f32b2
--- /dev/null
+++ b/testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalSchedulerRequiresExactlyOneProcessor
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifndef _TR_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR_H
+#define _TR_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR_H
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSTestCaseScoreSmpValFatalSchedulerRequiresExactlyOneProcessor
+ *
+ * @{
+ */
+
+/**
+ * @brief Runs the parameterized test case.
+ *
+ * @param source is fatal source.
+ *
+ * @param code is fatal code.
+ */
+void ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TR_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR_H */
diff --git a/testsuites/validation/tr-fatal-smp.c b/testsuites/validation/tr-fatal-smp.c
new file mode 100644
index 0000000000..425a95ade0
--- /dev/null
+++ b/testsuites/validation/tr-fatal-smp.c
@@ -0,0 +1,320 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatal
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <setjmp.h>
+#include <rtems/sysinit.h>
+#include <rtems/score/atomic.h>
+#include <rtems/score/percpu.h>
+#include <rtems/score/smpimpl.h>
+
+#include "tr-fatal-smp.h"
+#include "tx-support.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreSmpValFatal spec:/score/smp/val/fatal
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalSmp
+ *
+ * @brief Tests four fatal errors.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action is carried out by TriggerTestCase().
+ *
+ * - Check that the expected fatal source is present.
+ *
+ * - Check that the expected fatal code is present.
+ *
+ * - Check that the processor state is shutdown.
+ *
+ * - Check that a second shutdown request does not end in a recursive
+ * shutdown response.
+ *
+ * - Issue a job on a processor in the shutdown state. Check that the right
+ * fatal error occurs if we try to wait for this job to complete.
+ *
+ * - Start multitasking on an invalid processor. Check that the right fatal
+ * error occurs.
+ *
+ * - Start multitasking on an unassigned processor. Check that the right fatal
+ * error occurs.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for spec:/score/smp/val/fatal test case.
+ */
+typedef struct {
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatal_Run() parameter.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatal_Run() parameter.
+ */
+ rtems_fatal_code code;
+} ScoreSmpValFatal_Context;
+
+static ScoreSmpValFatal_Context
+ ScoreSmpValFatal_Instance;
+
+static void TriggerTestCase( void )
+{
+ _SMP_Request_shutdown();
+ (void) _CPU_Thread_Idle_body( 0 );
+}
+
+RTEMS_SYSINIT_ITEM(
+ TriggerTestCase,
+ RTEMS_SYSINIT_DEVICE_DRIVERS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
+static jmp_buf fatal_before;
+
+static Atomic_Uint fatal_counter;
+
+static rtems_fatal_source fatal_source;
+
+static rtems_fatal_code fatal_code;
+
+static void FatalRecordAndJump(
+ rtems_fatal_source source,
+ rtems_fatal_code code,
+ void *arg
+)
+{
+ (void) arg;
+
+ fatal_source = source;
+ fatal_code = code;
+ _Atomic_Fetch_add_uint( &fatal_counter, 1, ATOMIC_ORDER_RELAXED );
+ longjmp( fatal_before, 1 );
+}
+
+static void DoNothing( void *arg )
+{
+ (void) arg;
+}
+
+static const Per_CPU_Job_context job_context = {
+ .handler = DoNothing
+};
+
+Per_CPU_Job job = {
+ .context = &job_context
+};
+
+static T_fixture ScoreSmpValFatal_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &ScoreSmpValFatal_Instance
+};
+
+/**
+ * @brief The test action is carried out by TriggerTestCase().
+ */
+static void ScoreSmpValFatal_Action_0( ScoreSmpValFatal_Context *ctx )
+{
+ /* Nothing to do */
+
+ /*
+ * Check that the expected fatal source is present.
+ */
+ T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_SMP );
+
+ /*
+ * Check that the expected fatal code is present.
+ */
+ T_step_eq_ulong( 1, ctx->code, SMP_FATAL_SHUTDOWN_RESPONSE );
+
+ /*
+ * Check that the processor state is shutdown.
+ */
+ T_step_eq_int(
+ 2,
+ _Per_CPU_Get_state( _Per_CPU_Get() ),
+ PER_CPU_STATE_SHUTDOWN
+ );
+
+ /*
+ * Check that a second shutdown request does not end in a recursive shutdown
+ * response.
+ */
+ _SMP_Process_message( _Per_CPU_Get(), SMP_MESSAGE_SHUTDOWN );
+}
+
+/**
+ * @brief Issue a job on a processor in the shutdown state. Check that the
+ * right fatal error occurs if we try to wait for this job to complete.
+ */
+static void ScoreSmpValFatal_Action_1( ScoreSmpValFatal_Context *ctx )
+{
+ Per_CPU_Control *cpu;
+
+ SetFatalHandler( FatalRecordAndJump, ctx );
+ cpu = _Per_CPU_Get_by_index( 0 );
+ _Per_CPU_Submit_job( cpu, &job );
+
+ if ( setjmp( fatal_before ) == 0 ) {
+ _Per_CPU_Wait_for_job( cpu, &job );
+ }
+
+ T_step_eq_uint(
+ 3,
+ _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+ 1
+ );
+ T_step_eq_int( 4, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+ T_step_eq_ulong(
+ 5,
+ fatal_code,
+ SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS
+ );
+ SetFatalHandler( NULL, NULL );
+}
+
+/**
+ * @brief Start multitasking on an invalid processor. Check that the right
+ * fatal error occurs.
+ */
+static void ScoreSmpValFatal_Action_2( ScoreSmpValFatal_Context *ctx )
+{
+ Per_CPU_Control *cpu;
+
+ SetFatalHandler( FatalRecordAndJump, ctx );
+
+ /*
+ * This element is outside the array. This is not an issue since
+ * _SMP_Start_multitasking_on_secondary_processor() does not access the
+ * structure.
+ */
+ cpu = _Per_CPU_Get_by_index( 3 );
+
+ if ( setjmp( fatal_before ) == 0 ) {
+ _SMP_Start_multitasking_on_secondary_processor( cpu );
+ }
+
+ T_step_eq_uint(
+ 6,
+ _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+ 2
+ );
+ T_step_eq_int( 7, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+ T_step_eq_ulong(
+ 8,
+ fatal_code,
+ SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR
+ );
+ SetFatalHandler( NULL, NULL );
+}
+
+/**
+ * @brief Start multitasking on an unassigned processor. Check that the right
+ * fatal error occurs.
+ */
+static void ScoreSmpValFatal_Action_3( ScoreSmpValFatal_Context *ctx )
+{
+ Per_CPU_Control *cpu;
+
+ SetFatalHandler( FatalRecordAndJump, ctx );
+ cpu = _Per_CPU_Get_by_index( 2 );
+
+ if ( setjmp( fatal_before ) == 0 ) {
+ _SMP_Start_multitasking_on_secondary_processor( cpu );
+ }
+
+ T_step_eq_uint(
+ 9,
+ _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+ 3
+ );
+ T_step_eq_int( 10, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+ T_step_eq_ulong(
+ 11,
+ fatal_code,
+ SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR
+ );
+ SetFatalHandler( NULL, NULL );
+}
+
+void ScoreSmpValFatal_Run( rtems_fatal_source source, rtems_fatal_code code )
+{
+ ScoreSmpValFatal_Context *ctx;
+
+ ctx = &ScoreSmpValFatal_Instance;
+ ctx->source = source;
+ ctx->code = code;
+
+ ctx = T_case_begin( "ScoreSmpValFatal", &ScoreSmpValFatal_Fixture );
+
+ T_plan( 12 );
+
+ ScoreSmpValFatal_Action_0( ctx );
+ ScoreSmpValFatal_Action_1( ctx );
+ ScoreSmpValFatal_Action_2( ctx );
+ ScoreSmpValFatal_Action_3( ctx );
+
+ T_case_end();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-smp.h b/testsuites/validation/tr-fatal-smp.h
new file mode 100644
index 0000000000..5b36498d29
--- /dev/null
+++ b/testsuites/validation/tr-fatal-smp.h
@@ -0,0 +1,81 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatal
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifndef _TR_FATAL_SMP_H
+#define _TR_FATAL_SMP_H
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSTestCaseScoreSmpValFatal
+ *
+ * @{
+ */
+
+/**
+ * @brief Runs the parameterized test case.
+ *
+ * @param source is fatal source.
+ *
+ * @param code is fatal code.
+ */
+void ScoreSmpValFatal_Run( rtems_fatal_source source, rtems_fatal_code code );
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TR_FATAL_SMP_H */
diff --git a/testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.c b/testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.c
new file mode 100644
index 0000000000..643c4f34f8
--- /dev/null
+++ b/testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.c
@@ -0,0 +1,166 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalStartOfMandatoryProcessorFailed
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/smpimpl.h>
+
+#include "tr-fatal-start-of-mandatory-processor-failed.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseScoreSmpValFatalStartOfMandatoryProcessorFailed \
+ * spec:/score/smp/val/fatal-start-of-mandatory-processor-failed
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalStartOfMandatoryProcessorFailed
+ *
+ * @brief Tests a fatal error.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action is carried out by the application configuration of the
+ * test suite.
+ *
+ * - Check that the expected fatal source is present.
+ *
+ * - Check that the expected fatal code is present.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for
+ * spec:/score/smp/val/fatal-start-of-mandatory-processor-failed test case.
+ */
+typedef struct {
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalStartOfMandatoryProcessorFailed_Run() parameter.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains a copy of the corresponding
+ * ScoreSmpValFatalStartOfMandatoryProcessorFailed_Run() parameter.
+ */
+ rtems_fatal_code code;
+} ScoreSmpValFatalStartOfMandatoryProcessorFailed_Context;
+
+static ScoreSmpValFatalStartOfMandatoryProcessorFailed_Context
+ ScoreSmpValFatalStartOfMandatoryProcessorFailed_Instance;
+
+bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index );
+
+bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index )
+{
+ (void) cpu_index;
+ return false;
+}
+
+static T_fixture ScoreSmpValFatalStartOfMandatoryProcessorFailed_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &ScoreSmpValFatalStartOfMandatoryProcessorFailed_Instance
+};
+
+/**
+ * @brief The test action is carried out by the application configuration of
+ * the test suite.
+ */
+static void ScoreSmpValFatalStartOfMandatoryProcessorFailed_Action_0(
+ ScoreSmpValFatalStartOfMandatoryProcessorFailed_Context *ctx
+)
+{
+ /* Nothing to do */
+
+ /*
+ * Check that the expected fatal source is present.
+ */
+ T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_SMP );
+
+ /*
+ * Check that the expected fatal code is present.
+ */
+ T_step_eq_ulong(
+ 1,
+ ctx->code,
+ SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED
+ );
+}
+
+void ScoreSmpValFatalStartOfMandatoryProcessorFailed_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+)
+{
+ ScoreSmpValFatalStartOfMandatoryProcessorFailed_Context *ctx;
+
+ ctx = &ScoreSmpValFatalStartOfMandatoryProcessorFailed_Instance;
+ ctx->source = source;
+ ctx->code = code;
+
+ ctx = T_case_begin(
+ "ScoreSmpValFatalStartOfMandatoryProcessorFailed",
+ &ScoreSmpValFatalStartOfMandatoryProcessorFailed_Fixture
+ );
+
+ T_plan( 2 );
+
+ ScoreSmpValFatalStartOfMandatoryProcessorFailed_Action_0( ctx );
+
+ T_case_end();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.h b/testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.h
new file mode 100644
index 0000000000..c80456bd77
--- /dev/null
+++ b/testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseScoreSmpValFatalStartOfMandatoryProcessorFailed
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifndef _TR_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED_H
+#define _TR_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED_H
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSTestCaseScoreSmpValFatalStartOfMandatoryProcessorFailed
+ *
+ * @{
+ */
+
+/**
+ * @brief Runs the parameterized test case.
+ *
+ * @param source is fatal source.
+ *
+ * @param code is fatal code.
+ */
+void ScoreSmpValFatalStartOfMandatoryProcessorFailed_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TR_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED_H */
diff --git a/testsuites/validation/tr-fatal-too-large-tls-size.c b/testsuites/validation/tr-fatal-too-large-tls-size.c
new file mode 100644
index 0000000000..d285f48d3a
--- /dev/null
+++ b/testsuites/validation/tr-fatal-too-large-tls-size.c
@@ -0,0 +1,168 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseAcfgValFatalTooLargeTlsSize
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems.h>
+
+#include "tr-fatal-too-large-tls-size.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseAcfgValFatalTooLargeTlsSize \
+ * spec:/acfg/val/fatal-too-large-tls-size
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalTooLargeTlsSize
+ *
+ * @brief Tests a fatal error.
+ *
+ * This test case performs the following actions:
+ *
+ * - The test action is carried out by providing a thread-local storage object
+ * of sufficient size with respect to the application configuration of the
+ * test suite.
+ *
+ * - Check that the expected fatal source is present.
+ *
+ * - Check that the expected fatal code is present.
+ *
+ * @{
+ */
+
+/**
+ * @brief Test context for spec:/acfg/val/fatal-too-large-tls-size test case.
+ */
+typedef struct {
+ /**
+ * @brief This member contains a copy of the corresponding
+ * AcfgValFatalTooLargeTlsSize_Run() parameter.
+ */
+ rtems_fatal_source source;
+
+ /**
+ * @brief This member contains a copy of the corresponding
+ * AcfgValFatalTooLargeTlsSize_Run() parameter.
+ */
+ rtems_fatal_code code;
+} AcfgValFatalTooLargeTlsSize_Context;
+
+static AcfgValFatalTooLargeTlsSize_Context
+ AcfgValFatalTooLargeTlsSize_Instance;
+
+static volatile _Thread_local uint8_t large_tls_object[ RTEMS_TASK_STORAGE_ALIGNMENT + 1 ];
+
+static volatile bool shall_not_load_the_value;
+
+static T_fixture AcfgValFatalTooLargeTlsSize_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_context = &AcfgValFatalTooLargeTlsSize_Instance
+};
+
+/**
+ * @brief The test action is carried out by providing a thread-local storage
+ * object of sufficient size with respect to the application configuration of
+ * the test suite.
+ */
+static void AcfgValFatalTooLargeTlsSize_Action_0(
+ AcfgValFatalTooLargeTlsSize_Context *ctx
+)
+{
+ if ( shall_not_load_the_value ) {
+ uint8_t value;
+
+ value = large_tls_object[ 0 ];
+ RTEMS_OBFUSCATE_VARIABLE( value );
+ }
+
+ /*
+ * Check that the expected fatal source is present.
+ */
+ T_step_eq_int( 0, ctx->source, INTERNAL_ERROR_CORE );
+
+ /*
+ * Check that the expected fatal code is present.
+ */
+ T_step_eq_ulong(
+ 1,
+ ctx->code,
+ INTERNAL_ERROR_TOO_LARGE_TLS_SIZE
+ );
+}
+
+void AcfgValFatalTooLargeTlsSize_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+)
+{
+ AcfgValFatalTooLargeTlsSize_Context *ctx;
+
+ ctx = &AcfgValFatalTooLargeTlsSize_Instance;
+ ctx->source = source;
+ ctx->code = code;
+
+ ctx = T_case_begin(
+ "AcfgValFatalTooLargeTlsSize",
+ &AcfgValFatalTooLargeTlsSize_Fixture
+ );
+
+ T_plan( 2 );
+
+ AcfgValFatalTooLargeTlsSize_Action_0( ctx );
+
+ T_case_end();
+}
+
+/** @} */
diff --git a/testsuites/validation/tr-fatal-too-large-tls-size.h b/testsuites/validation/tr-fatal-too-large-tls-size.h
new file mode 100644
index 0000000000..1b5c24e469
--- /dev/null
+++ b/testsuites/validation/tr-fatal-too-large-tls-size.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseAcfgValFatalTooLargeTlsSize
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifndef _TR_FATAL_TOO_LARGE_TLS_SIZE_H
+#define _TR_FATAL_TOO_LARGE_TLS_SIZE_H
+
+#include <rtems.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup RTEMSTestCaseAcfgValFatalTooLargeTlsSize
+ *
+ * @{
+ */
+
+/**
+ * @brief Runs the parameterized test case.
+ *
+ * @param source is fatal source.
+ *
+ * @param code is fatal code.
+ */
+void AcfgValFatalTooLargeTlsSize_Run(
+ rtems_fatal_source source,
+ rtems_fatal_code code
+);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _TR_FATAL_TOO_LARGE_TLS_SIZE_H */