From 0fcb279d87cde2c2f1ad45d339e1447ef260fb50 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 3 Aug 2021 11:16:44 +0200 Subject: validation: Test SMP fatal errors --- ...al-boot-processor-not-assigned-to-scheduler.yml | 21 ++ .../fatal-mandatory-processor-not-present.yml | 21 ++ spec/build/testsuites/validation/fatal-smp.yml | 21 ++ .../fatal-start-of-mandatory-processor-failed.yml | 22 ++ spec/build/testsuites/validation/grp.yml | 8 + ...atal-boot-processor-not-assigned-to-scheduler.c | 159 ++++++++++ ...atal-boot-processor-not-assigned-to-scheduler.h | 84 ++++++ .../tr-fatal-mandatory-processor-not-present.c | 158 ++++++++++ .../tr-fatal-mandatory-processor-not-present.h | 84 ++++++ testsuites/validation/tr-fatal-smp.c | 320 +++++++++++++++++++++ testsuites/validation/tr-fatal-smp.h | 81 ++++++ .../tr-fatal-start-of-mandatory-processor-failed.c | 166 +++++++++++ .../tr-fatal-start-of-mandatory-processor-failed.h | 84 ++++++ ...atal-boot-processor-not-assigned-to-scheduler.c | 98 +++++++ .../ts-fatal-bsp-sparc-leon3-shutdown-response.c | 13 + .../ts-fatal-mandatory-processor-not-present.c | 127 ++++++++ testsuites/validation/ts-fatal-smp.c | 97 +++++++ .../ts-fatal-start-of-mandatory-processor-failed.c | 97 +++++++ testsuites/validation/ts-fatal-sysinit.h | 14 +- 19 files changed, 1672 insertions(+), 3 deletions(-) create mode 100644 spec/build/testsuites/validation/fatal-boot-processor-not-assigned-to-scheduler.yml create mode 100644 spec/build/testsuites/validation/fatal-mandatory-processor-not-present.yml create mode 100644 spec/build/testsuites/validation/fatal-smp.yml create mode 100644 spec/build/testsuites/validation/fatal-start-of-mandatory-processor-failed.yml create mode 100644 testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.c create mode 100644 testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.h create mode 100644 testsuites/validation/tr-fatal-mandatory-processor-not-present.c create mode 100644 testsuites/validation/tr-fatal-mandatory-processor-not-present.h create mode 100644 testsuites/validation/tr-fatal-smp.c create mode 100644 testsuites/validation/tr-fatal-smp.h create mode 100644 testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.c create mode 100644 testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.h create mode 100644 testsuites/validation/ts-fatal-boot-processor-not-assigned-to-scheduler.c create mode 100644 testsuites/validation/ts-fatal-mandatory-processor-not-present.c create mode 100644 testsuites/validation/ts-fatal-smp.c create mode 100644 testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.c 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 @@ -12,6 +12,8 @@ ldflags: [] 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 @@ -26,6 +28,12 @@ links: uid: fatal-bsp-sparc-leon3-shutdown-timeout - 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 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 + +#include "tr-fatal-boot-processor-not-assigned-to-scheduler.h" + +#include + +/** + * @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 + +#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 + +#include "tr-fatal-mandatory-processor-not-present.h" + +#include + +/** + * @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 + +#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..f71936049f --- /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 +#include +#include +#include +#include + +#include "tr-fatal-smp.h" +#include "tx-support.h" + +#include + +/** + * @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 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 +}; + +/** + * @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 + +#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 + +#include "tr-fatal-start-of-mandatory-processor-failed.h" + +#include + +/** + * @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 + +#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 + +/** + * @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 + +#define CONFIGURE_SCHEDULER_EDF_SMP + +#include + +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 + #include "tr-fatal-bsp-sparc-leon3-shutdown-response.h" #include @@ -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 + +/** + * @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 + +#define CONFIGURE_SCHEDULER_EDF_SMP + +#include + +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 + +/** + * @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 + +#define CONFIGURE_SCHEDULER_EDF_SMP + +#include + +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 + +/** + * @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 + +#define CONFIGURE_SCHEDULER_EDF_SMP + +#include + +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 9e6afec78b..115142b1bf 100644 --- a/testsuites/validation/ts-fatal-sysinit.h +++ b/testsuites/validation/ts-fatal-sysinit.h @@ -42,6 +42,8 @@ #include +#include "tx-support.h" + static char buffer[ 512 ]; static const T_action actions[] = { @@ -67,13 +69,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; @@ -95,7 +97,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 ) @@ -116,7 +122,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 -- cgit v1.2.3