summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-03 11:16:44 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-15 07:50:48 +0200
commit19474b1ca1c7c812b91998a61052a188ad5eca85 (patch)
treee522e1342a3ff2a2e3cacb01f9b1308ca8fe47ad
parent53a69cba45bf16b72312afca5dc1fbd20ad4e857 (diff)
validation: Test SMP fatal errors
-rw-r--r--spec/build/testsuites/validation/fatal-boot-processor-not-assigned-to-scheduler.yml21
-rw-r--r--spec/build/testsuites/validation/fatal-mandatory-processor-not-present.yml21
-rw-r--r--spec/build/testsuites/validation/fatal-smp.yml21
-rw-r--r--spec/build/testsuites/validation/fatal-start-of-mandatory-processor-failed.yml22
-rw-r--r--spec/build/testsuites/validation/grp.yml8
-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-mandatory-processor-not-present.c158
-rw-r--r--testsuites/validation/tr-fatal-mandatory-processor-not-present.h84
-rw-r--r--testsuites/validation/tr-fatal-smp.c324
-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/ts-fatal-boot-processor-not-assigned-to-scheduler.c98
-rw-r--r--testsuites/validation/ts-fatal-bsp-sparc-leon3-shutdown-response.c13
-rw-r--r--testsuites/validation/ts-fatal-mandatory-processor-not-present.c127
-rw-r--r--testsuites/validation/ts-fatal-smp.c97
-rw-r--r--testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.c97
-rw-r--r--testsuites/validation/ts-fatal-sysinit.h14
19 files changed, 1676 insertions, 3 deletions
diff --git a/spec/build/testsuites/validation/fatal-boot-processor-not-assigned-to-scheduler.yml b/spec/build/testsuites/validation/fatal-boot-processor-not-assigned-to-scheduler.yml
new file mode 100644
index 0000000000..d7cc90fd21
--- /dev/null
+++ b/spec/build/testsuites/validation/fatal-boot-processor-not-assigned-to-scheduler.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: test-program
+cflags: []
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+cppflags: []
+cxxflags: []
+enabled-by: RTEMS_SMP
+features: c cprogram
+includes: []
+ldflags: []
+links: []
+source:
+- testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.c
+- testsuites/validation/ts-fatal-boot-processor-not-assigned-to-scheduler.c
+stlib: []
+target: testsuites/validation/ts-fatal-boot-processor-not-assigned-to-scheduler.exe
+type: build
+use-after:
+- validation
+use-before: []
diff --git a/spec/build/testsuites/validation/fatal-mandatory-processor-not-present.yml b/spec/build/testsuites/validation/fatal-mandatory-processor-not-present.yml
new file mode 100644
index 0000000000..5caea07a70
--- /dev/null
+++ b/spec/build/testsuites/validation/fatal-mandatory-processor-not-present.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: test-program
+cflags: []
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+cppflags: []
+cxxflags: []
+enabled-by: RTEMS_SMP
+features: c cprogram
+includes: []
+ldflags: []
+links: []
+source:
+- testsuites/validation/tr-fatal-mandatory-processor-not-present.c
+- testsuites/validation/ts-fatal-mandatory-processor-not-present.c
+stlib: []
+target: testsuites/validation/ts-fatal-mandatory-processor-not-present.exe
+type: build
+use-after:
+- validation
+use-before: []
diff --git a/spec/build/testsuites/validation/fatal-smp.yml b/spec/build/testsuites/validation/fatal-smp.yml
new file mode 100644
index 0000000000..20312a2698
--- /dev/null
+++ b/spec/build/testsuites/validation/fatal-smp.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: test-program
+cflags: []
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+cppflags: []
+cxxflags: []
+enabled-by: RTEMS_SMP
+features: c cprogram
+includes: []
+ldflags: []
+links: []
+source:
+- testsuites/validation/tr-fatal-smp.c
+- testsuites/validation/ts-fatal-smp.c
+stlib: []
+target: testsuites/validation/ts-fatal-smp.exe
+type: build
+use-after:
+- validation
+use-before: []
diff --git a/spec/build/testsuites/validation/fatal-start-of-mandatory-processor-failed.yml b/spec/build/testsuites/validation/fatal-start-of-mandatory-processor-failed.yml
new file mode 100644
index 0000000000..7f546c816a
--- /dev/null
+++ b/spec/build/testsuites/validation/fatal-start-of-mandatory-processor-failed.yml
@@ -0,0 +1,22 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: test-program
+cflags: []
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+cppflags: []
+cxxflags: []
+enabled-by: RTEMS_SMP
+features: c cprogram
+includes: []
+ldflags:
+- -Wl,-wrap=_CPU_SMP_Start_processor
+links: []
+source:
+- testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.c
+- testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.c
+stlib: []
+target: testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.exe
+type: build
+use-after:
+- validation
+use-before: []
diff --git a/spec/build/testsuites/validation/grp.yml b/spec/build/testsuites/validation/grp.yml
index 7a2d45b3f6..7379b61c5b 100644
--- a/spec/build/testsuites/validation/grp.yml
+++ b/spec/build/testsuites/validation/grp.yml
@@ -13,6 +13,8 @@ links:
- role: build-dependency
uid: libvalidation
- role: build-dependency
+ uid: fatal-boot-processor-not-assigned-to-scheduler
+- role: build-dependency
uid: fatal-bsp-sparc-leon3-cache-snooping-disabled-boot
- role: build-dependency
uid: fatal-bsp-sparc-leon3-cache-snooping-disabled-secondary
@@ -27,6 +29,12 @@ links:
- role: build-dependency
uid: fatal-init-task-construct-failed
- role: build-dependency
+ uid: fatal-mandatory-processor-not-present
+- role: build-dependency
+ uid: fatal-smp
+- role: build-dependency
+ uid: fatal-start-of-mandatory-processor-failed
+- role: build-dependency
uid: fatal-too-large-tls-size
- role: build-dependency
uid: model-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-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-smp.c b/testsuites/validation/tr-fatal-smp.c
new file mode 100644
index 0000000000..2e94696d07
--- /dev/null
+++ b/testsuites/validation/tr-fatal-smp.c
@@ -0,0 +1,324 @@
+/* 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 T_fixture ScoreSmpValFatal_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_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 bool fatal_always_set_to_false;
+
+static rtems_fatal_code fatal_code;
+
+static void FatalRecordAndJump(
+ rtems_fatal_source source,
+ bool always_set_to_false,
+ rtems_fatal_code code
+)
+{
+ fatal_source = source;
+ fatal_always_set_to_false = always_set_to_false;
+ 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
+};
+
+/**
+ * @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;
+
+ SetFatalExtension( FatalRecordAndJump );
+ 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_false( 5, fatal_always_set_to_false );
+ T_step_eq_ulong(
+ 6,
+ fatal_code,
+ SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS
+ );
+ SetFatalExtension( 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;
+
+ SetFatalExtension( FatalRecordAndJump );
+
+ /*
+ * 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(
+ 7,
+ _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+ 2
+ );
+ T_step_eq_int( 8, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+ T_step_false( 9, fatal_always_set_to_false );
+ T_step_eq_ulong(
+ 10,
+ fatal_code,
+ SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR
+ );
+ SetFatalExtension( 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;
+
+ SetFatalExtension( FatalRecordAndJump );
+ cpu = _Per_CPU_Get_by_index( 2 );
+
+ if ( setjmp( fatal_before ) == 0 ) {
+ _SMP_Start_multitasking_on_secondary_processor( cpu );
+ }
+
+ T_step_eq_uint(
+ 11,
+ _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+ 3
+ );
+ T_step_eq_int( 12, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+ T_step_false( 13, fatal_always_set_to_false );
+ T_step_eq_ulong(
+ 14,
+ fatal_code,
+ SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR
+ );
+ SetFatalExtension( 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( 15 );
+
+ 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..fc80595661
--- /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;
+
+static T_fixture ScoreSmpValFatalStartOfMandatoryProcessorFailed_Fixture = {
+ .setup = NULL,
+ .stop = NULL,
+ .teardown = NULL,
+ .scope = NULL,
+ .initial_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;
+}
+
+/**
+ * @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/ts-fatal-boot-processor-not-assigned-to-scheduler.c b/testsuites/validation/ts-fatal-boot-processor-not-assigned-to-scheduler.c
new file mode 100644
index 0000000000..1222b26b2e
--- /dev/null
+++ b/testsuites/validation/ts-fatal-boot-processor-not-assigned-to-scheduler.c
@@ -0,0 +1,98 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalBootProcessorNotAssignedToScheduler
+ */
+
+/*
+ * 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 "tr-fatal-boot-processor-not-assigned-to-scheduler.h"
+#include "ts-config.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestSuiteTestsuitesFatalBootProcessorNotAssignedToScheduler \
+ * spec:/testsuites/fatal-boot-processor-not-assigned-to-scheduler
+ *
+ * @ingroup RTEMSTestSuites
+ *
+ * @brief This validation test suite uses an application configuration which
+ * triggers a fatal error during system initialization.
+ *
+ * @{
+ */
+
+const char rtems_test_name[] = "FatalBootProcessorNotAssignedToScheduler";
+
+#define FATAL_SYSINIT_RUN \
+ ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Run
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_PROCESSORS 2
+
+#include <rtems/score/scheduleredfsmp.h>
+
+#define CONFIGURE_SCHEDULER_EDF_SMP
+
+#include <rtems/scheduler.h>
+
+RTEMS_SCHEDULER_EDF_SMP( a );
+
+#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+ RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+#define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+ RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL )
+
+#include "ts-fatal-sysinit.h"
+
+/** @} */
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-mandatory-processor-not-present.c b/testsuites/validation/ts-fatal-mandatory-processor-not-present.c
new file mode 100644
index 0000000000..51763c4d99
--- /dev/null
+++ b/testsuites/validation/ts-fatal-mandatory-processor-not-present.c
@@ -0,0 +1,127 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalMandatoryProcessorNotPresent
+ */
+
+/*
+ * 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 "tr-fatal-mandatory-processor-not-present.h"
+#include "ts-config.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestSuiteTestsuitesFatalMandatoryProcessorNotPresent \
+ * spec:/testsuites/fatal-mandatory-processor-not-present
+ *
+ * @ingroup RTEMSTestSuites
+ *
+ * @brief This validation test suite contains a test case which triggers a
+ * fatal error during system initialization.
+ *
+ * @{
+ */
+
+const char rtems_test_name[] = "FatalMandatoryProcessorNotPresent";
+
+#define FATAL_SYSINIT_RUN ScoreSmpValFatalMandatoryProcessorNotPresent_Run
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_PROCESSORS 32
+
+#include <rtems/score/scheduleredfsmp.h>
+
+#define CONFIGURE_SCHEDULER_EDF_SMP
+
+#include <rtems/scheduler.h>
+
+RTEMS_SCHEDULER_EDF_SMP( a );
+
+#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+ RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+#define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY )
+
+#include "ts-fatal-sysinit.h"
+
+/** @} */
diff --git a/testsuites/validation/ts-fatal-smp.c b/testsuites/validation/ts-fatal-smp.c
new file mode 100644
index 0000000000..c1c4844643
--- /dev/null
+++ b/testsuites/validation/ts-fatal-smp.c
@@ -0,0 +1,97 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalSmp
+ */
+
+/*
+ * 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 "tr-fatal-smp.h"
+#include "ts-config.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestSuiteTestsuitesFatalSmp spec:/testsuites/fatal-smp
+ *
+ * @ingroup RTEMSTestSuites
+ *
+ * @brief This validation test suite contains a test case which triggers
+ * SMP-specific fatal errors.
+ *
+ * @{
+ */
+
+const char rtems_test_name[] = "FatalSmp";
+
+#define FATAL_SYSINIT_RUN ScoreSmpValFatal_Run
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_PROCESSORS 3
+
+#include <rtems/score/scheduleredfsmp.h>
+
+#define CONFIGURE_SCHEDULER_EDF_SMP
+
+#include <rtems/scheduler.h>
+
+RTEMS_SCHEDULER_EDF_SMP( a );
+
+#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+ RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+#define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER
+
+#include "ts-fatal-sysinit.h"
+
+/** @} */
diff --git a/testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.c b/testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.c
new file mode 100644
index 0000000000..76e96f50ef
--- /dev/null
+++ b/testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.c
@@ -0,0 +1,97 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesFatalStartOfMandatoryProcessorFailed
+ */
+
+/*
+ * 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 "tr-fatal-start-of-mandatory-processor-failed.h"
+#include "ts-config.h"
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestSuiteTestsuitesFatalStartOfMandatoryProcessorFailed \
+ * spec:/testsuites/fatal-start-of-mandatory-processor-failed
+ *
+ * @ingroup RTEMSTestSuites
+ *
+ * @brief This validation test suite contains a test case which triggers a
+ * fatal error during system initialization.
+ *
+ * @{
+ */
+
+const char rtems_test_name[] = "FatalStartOfMandatoryProcessorFailed";
+
+#define FATAL_SYSINIT_RUN ScoreSmpValFatalStartOfMandatoryProcessorFailed_Run
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_PROCESSORS 2
+
+#include <rtems/score/scheduleredfsmp.h>
+
+#define CONFIGURE_SCHEDULER_EDF_SMP
+
+#include <rtems/scheduler.h>
+
+RTEMS_SCHEDULER_EDF_SMP( a );
+
+#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+ RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+#define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+ RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY )
+
+#include "ts-fatal-sysinit.h"
+
+/** @} */
diff --git a/testsuites/validation/ts-fatal-sysinit.h b/testsuites/validation/ts-fatal-sysinit.h
index 3b2b278e07..e19d7a74f4 100644
--- a/testsuites/validation/ts-fatal-sysinit.h
+++ b/testsuites/validation/ts-fatal-sysinit.h
@@ -42,6 +42,8 @@
#include <rtems/test.h>
+#include "tx-support.h"
+
static char buffer[ 512 ];
static const T_action actions[] = {
@@ -63,13 +65,13 @@ static const T_config test_config = {
static Atomic_Uint counter;
-static void FatalExtension(
+static void TestSuiteFatalExtension(
rtems_fatal_source source,
bool always_set_to_false,
rtems_fatal_code code
)
{
- uint32_t exit_code;
+ rtems_fatal_code exit_code;
(void) always_set_to_false;
@@ -91,7 +93,11 @@ static void FatalExtension(
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 )
@@ -112,7 +118,9 @@ RTEMS_SYSINIT_ITEM(
#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
-#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = FatalExtension }
+#define CONFIGURE_INITIAL_EXTENSIONS \
+ { .fatal = FatalInitialExtension }, \
+ { .fatal = TestSuiteFatalExtension }
#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION