From e6de385a97c2811d4e249665bb63162b73e74af1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 15 Jun 2023 11:46:55 +0200 Subject: validation: Test sparc/leon3 BSP family Update #3716. --- ...al-sparc-leon3-cache-snooping-disabled-boot.yml | 24 +++ ...arc-leon3-cache-snooping-disabled-secondary.yml | 25 +++ .../fatal-sparc-leon3-clock-initialization.yml | 21 ++ .../validation/bsps/fatal-sparc-leon3-shutdown.yml | 24 +++ .../testsuites/validation/bsps/objsparcgr712rc.yml | 14 ++ .../validation/bsps/validation-bsp-0.yml | 2 + spec/build/testsuites/validation/grp.yml | 8 + .../bsps/tc-fatal-sparc-leon3-shutdown.c | 211 +++++++++++++++++++++ testsuites/validation/bsps/tc-sparc-gr712rc.c | 124 ++++++++++++ ...atal-sparc-leon3-cache-snooping-disabled-boot.c | 175 +++++++++++++++++ ...atal-sparc-leon3-cache-snooping-disabled-boot.h | 84 ++++++++ ...sparc-leon3-cache-snooping-disabled-secondary.c | 176 +++++++++++++++++ ...sparc-leon3-cache-snooping-disabled-secondary.h | 84 ++++++++ .../tr-fatal-sparc-leon3-clock-initialization.c | 190 +++++++++++++++++++ .../tr-fatal-sparc-leon3-clock-initialization.h | 84 ++++++++ ...atal-sparc-leon3-cache-snooping-disabled-boot.c | 79 ++++++++ ...sparc-leon3-cache-snooping-disabled-secondary.c | 82 ++++++++ .../ts-fatal-sparc-leon3-clock-initialization.c | 79 ++++++++ .../bsps/ts-fatal-sparc-leon3-shutdown-response.c | 94 +++++++++ .../bsps/ts-fatal-sparc-leon3-shutdown.c | 170 +++++++++++++++++ 20 files changed, 1750 insertions(+) create mode 100644 spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-boot.yml create mode 100644 spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-secondary.yml create mode 100644 spec/build/testsuites/validation/bsps/fatal-sparc-leon3-clock-initialization.yml create mode 100644 spec/build/testsuites/validation/bsps/fatal-sparc-leon3-shutdown.yml create mode 100644 spec/build/testsuites/validation/bsps/objsparcgr712rc.yml create mode 100644 testsuites/validation/bsps/tc-fatal-sparc-leon3-shutdown.c create mode 100644 testsuites/validation/bsps/tc-sparc-gr712rc.c create mode 100644 testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.c create mode 100644 testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.h create mode 100644 testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.c create mode 100644 testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.h create mode 100644 testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.c create mode 100644 testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.h create mode 100644 testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-boot.c create mode 100644 testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-secondary.c create mode 100644 testsuites/validation/bsps/ts-fatal-sparc-leon3-clock-initialization.c create mode 100644 testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown-response.c create mode 100644 testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown.c diff --git a/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-boot.yml b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-boot.yml new file mode 100644 index 0000000000..93afdb2c32 --- /dev/null +++ b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-boot.yml @@ -0,0 +1,24 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: test-program +cflags: [] +copyrights: +- Copyright (C) 2021 embedded brains GmbH & Co. KG +cppflags: [] +cxxflags: [] +enabled-by: + and: + - RTEMS_SMP + - bsps/sparc/leon3 +features: c cprogram +includes: [] +ldflags: [] +links: [] +source: +- testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.c +- testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-boot.c +stlib: [] +target: testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-boot.exe +type: build +use-after: +- validation +use-before: [] diff --git a/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-secondary.yml b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-secondary.yml new file mode 100644 index 0000000000..20c4b43989 --- /dev/null +++ b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-cache-snooping-disabled-secondary.yml @@ -0,0 +1,25 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: test-program +cflags: [] +copyrights: +- Copyright (C) 2021 embedded brains GmbH & Co. KG +cppflags: [] +cxxflags: [] +enabled-by: + and: + - RTEMS_SMP + - bsps/sparc/leon3 +features: c cprogram +includes: [] +ldflags: +- -Wl,--wrap=bsp_start_on_secondary_processor +links: [] +source: +- testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.c +- testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-secondary.c +stlib: [] +target: testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-secondary.exe +type: build +use-after: +- validation +use-before: [] diff --git a/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-clock-initialization.yml b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-clock-initialization.yml new file mode 100644 index 0000000000..f8a24d9ccb --- /dev/null +++ b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-clock-initialization.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 & Co. KG +cppflags: [] +cxxflags: [] +enabled-by: bsps/sparc/leon3 +features: c cprogram +includes: [] +ldflags: [] +links: [] +source: +- testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.c +- testsuites/validation/bsps/ts-fatal-sparc-leon3-clock-initialization.c +stlib: [] +target: testsuites/validation/bsps/ts-fatal-sparc-leon3-clock-initialization.exe +type: build +use-after: +- validation +use-before: [] diff --git a/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-shutdown.yml b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-shutdown.yml new file mode 100644 index 0000000000..c12f447e84 --- /dev/null +++ b/spec/build/testsuites/validation/bsps/fatal-sparc-leon3-shutdown.yml @@ -0,0 +1,24 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: test-program +cflags: [] +copyrights: +- Copyright (C) 2022 embedded brains GmbH & Co. KG +cppflags: [] +cxxflags: [] +enabled-by: + and: + - RTEMS_SMP + - bsps/sparc/leon3 +features: c cprogram +includes: [] +ldflags: [] +links: [] +source: +- testsuites/validation/bsps/tc-fatal-sparc-leon3-shutdown.c +- testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown.c +stlib: [] +target: testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown.exe +type: build +use-after: +- validation +use-before: [] diff --git a/spec/build/testsuites/validation/bsps/objsparcgr712rc.yml b/spec/build/testsuites/validation/bsps/objsparcgr712rc.yml new file mode 100644 index 0000000000..d3dd60d4a0 --- /dev/null +++ b/spec/build/testsuites/validation/bsps/objsparcgr712rc.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: objects +cflags: [] +copyrights: +- Copyright (C) 2021 embedded brains GmbH & Co. KG +cppflags: [] +cxxflags: [] +enabled-by: sparc/gr712rc +includes: [] +install: [] +links: [] +source: +- testsuites/validation/bsps/tc-sparc-gr712rc.c +type: build diff --git a/spec/build/testsuites/validation/bsps/validation-bsp-0.yml b/spec/build/testsuites/validation/bsps/validation-bsp-0.yml index 0ce137cce9..af811b8502 100644 --- a/spec/build/testsuites/validation/bsps/validation-bsp-0.yml +++ b/spec/build/testsuites/validation/bsps/validation-bsp-0.yml @@ -13,6 +13,8 @@ ldflags: links: - role: build-dependency uid: objgrlib +- role: build-dependency + uid: objsparcgr712rc source: - testsuites/validation/bsps/ts-validation-bsp-0.c stlib: [] diff --git a/spec/build/testsuites/validation/grp.yml b/spec/build/testsuites/validation/grp.yml index 9000cf9624..682ebc1a51 100644 --- a/spec/build/testsuites/validation/grp.yml +++ b/spec/build/testsuites/validation/grp.yml @@ -80,6 +80,14 @@ links: uid: validation-tls-0 - role: build-dependency uid: validation-tls-1 +- role: build-dependency + uid: bsps/fatal-sparc-leon3-cache-snooping-disabled-boot +- role: build-dependency + uid: bsps/fatal-sparc-leon3-cache-snooping-disabled-secondary +- role: build-dependency + uid: bsps/fatal-sparc-leon3-clock-initialization +- role: build-dependency + uid: bsps/fatal-sparc-leon3-shutdown - role: build-dependency uid: bsps/validation-bsp-0 type: build diff --git a/testsuites/validation/bsps/tc-fatal-sparc-leon3-shutdown.c b/testsuites/validation/bsps/tc-fatal-sparc-leon3-shutdown.c new file mode 100644 index 0000000000..9b1f1626ec --- /dev/null +++ b/testsuites/validation/bsps/tc-fatal-sparc-leon3-shutdown.c @@ -0,0 +1,211 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValFatalShutdown + */ + +/* + * Copyright (C) 2021, 2022 embedded brains GmbH & Co. KG + * + * 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 "tx-support.h" + +#include + +/** + * @defgroup BspSparcLeon3ValFatalShutdown \ + * spec:/bsp/sparc/leon3/val/fatal-shutdown + * + * @ingroup TestsuitesBspsFatalSparcLeon3Shutdown + * + * @brief Tests the leon3 BSP family shutdown procedure. + * + * This test case performs the following actions: + * + * - Check the effects of the leon3 BSP family shutdown procedure. + * + * - Check that the second processor was not powered down during system + * initialization. + * + * - Wait until the second processor is powered down. + * + * - Check that the RTEMS_FATAL_SOURCE_SMP with SMP_FATAL_SHUTDOWN_RESPONSE + * fatal error occurred exactly once. + * + * - Check that the RTEMS_FATAL_SOURCE_SMP with SMP_FATAL_SHUTDOWN_RESPONSE + * fatal error occurred on the second processor. + * + * - Check that no dynamic fatal error extension was invoked. This shows + * that the leon3 BSP family shutdown procedure called the wrapped + * _CPU_Fatal_halt() function of the test suite. + * + * @{ + */ + +static uint32_t mpstat_during_sysinit; + +static Atomic_Uint shutdown_response_counter; + +static uint32_t shutdown_response_cpu_index = UINT32_MAX; + +static Atomic_Uint dynamic_fatal_extension_counter; + +static rtems_status_code status; + +static unsigned int Add( Atomic_Uint *a, unsigned int b ) +{ + return _Atomic_Fetch_add_uint( a, b, ATOMIC_ORDER_RELAXED ); +} + +static void ShutdownFatalHandler( + rtems_fatal_source source, + rtems_fatal_code code, + void *arg +) +{ + T_null( arg ); + + if ( + source == RTEMS_FATAL_SOURCE_SMP && + code == SMP_FATAL_SHUTDOWN_RESPONSE + ) { + (void) Add( &shutdown_response_counter, 1 ); + shutdown_response_cpu_index = rtems_scheduler_get_processor(); + } +} + +static void DynamicFatalHandler( + rtems_fatal_source source, + bool always_set_to_false, + rtems_fatal_code code +) +{ + (void) source; + (void) code; + (void) always_set_to_false; + (void) Add( &dynamic_fatal_extension_counter, 1 ); +} + +static void InitTestCase( void ) +{ + rtems_extensions_table table = { .fatal = DynamicFatalHandler }; + irqamp *regs; + rtems_id id; + + regs = LEON3_IrqCtrl_Regs; + mpstat_during_sysinit = grlib_load_32( ®s->mpstat ); + SetFatalHandler( ShutdownFatalHandler, NULL ); + status = rtems_extension_create( OBJECT_NAME, &table, &id ); +} + +RTEMS_SYSINIT_ITEM( + InitTestCase, + RTEMS_SYSINIT_DEVICE_DRIVERS, + RTEMS_SYSINIT_ORDER_MIDDLE +); + +/** + * @brief Check the effects of the leon3 BSP family shutdown procedure. + */ +static void BspSparcLeon3ValFatalShutdown_Action_0( void ) +{ + irqamp *regs; + uint32_t counter; + + regs = LEON3_IrqCtrl_Regs; + + /* + * Check that the second processor was not powered down during system + * initialization. + */ + T_step_eq_u32( 0, mpstat_during_sysinit & 0x2, 0 ); + + /* + * Wait until the second processor is powered down. + */ + while ( ( grlib_load_32( ®s->mpstat ) & 0x2 ) != 0x2U ) { + /* Wait */ + } + + /* + * Check that the RTEMS_FATAL_SOURCE_SMP with SMP_FATAL_SHUTDOWN_RESPONSE + * fatal error occurred exactly once. + */ + counter = Add( &shutdown_response_counter, 0 ); + T_step_eq_uint( 1, counter, 1 ); + + /* + * Check that the RTEMS_FATAL_SOURCE_SMP with SMP_FATAL_SHUTDOWN_RESPONSE + * fatal error occurred on the second processor. + */ + T_step_eq_u32( 2, shutdown_response_cpu_index, 1 ); + + /* + * Check that no dynamic fatal error extension was invoked. This shows that + * the leon3 BSP family shutdown procedure called the wrapped + * _CPU_Fatal_halt() function of the test suite. + */ + T_step_rsc_success( 3, status ); + counter = Add( &dynamic_fatal_extension_counter, 0 ); + T_step_eq_u32( 4, dynamic_fatal_extension_counter, 0 ); +} + +/** + * @fn void T_case_body_BspSparcLeon3ValFatalShutdown( void ) + */ +T_TEST_CASE( BspSparcLeon3ValFatalShutdown ) +{ + T_plan( 5 ); + + BspSparcLeon3ValFatalShutdown_Action_0(); +} + +/** @} */ diff --git a/testsuites/validation/bsps/tc-sparc-gr712rc.c b/testsuites/validation/bsps/tc-sparc-gr712rc.c new file mode 100644 index 0000000000..a16de3d6ed --- /dev/null +++ b/testsuites/validation/bsps/tc-sparc-gr712rc.c @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValGr712rc + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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 "tx-support.h" + +#include + +/** + * @defgroup BspSparcLeon3ValGr712rc spec:/bsp/sparc/leon3/val/gr712rc + * + * @ingroup TestsuitesBspsValidationBsp0 + * + * @brief This test case collection provides validation test cases for the + * ``sparc/gr712rc`` BSP. + * + * This test case performs the following actions: + * + * - Validate the use of the ``-mfix-gr712rc`` compiler option. + * + * - Check that the compiler built-in define ``__FIX_LEON3FT_B2BST`` is + * defined. + * + * - Check that the compiler built-in define ``__FIX_LEON3FT_TN0018`` is + * defined. + * + * - Check that the ``SPARC_LEON3FT_B2BST_NOP`` define expands to a ``nop`` + * instruction. + * + * @{ + */ + +/** + * @brief Validate the use of the ``-mfix-gr712rc`` compiler option. + */ +static void BspSparcLeon3ValGr712rc_Action_0( void ) +{ + const char *s; + + /* + * Check that the compiler built-in define ``__FIX_LEON3FT_B2BST`` is + * defined. + */ + #if !defined(__FIX_LEON3FT_B2BST) + #error "__FIX_LEON3FT_B2BST is not defined" + #endif + + /* + * Check that the compiler built-in define ``__FIX_LEON3FT_TN0018`` is + * defined. + */ + #if !defined(__FIX_LEON3FT_TN0018) + #error "__FIX_LEON3FT_TN0018 is not defined" + #endif + + /* + * Check that the ``SPARC_LEON3FT_B2BST_NOP`` define expands to a ``nop`` + * instruction. + */ + s = RTEMS_XSTRING( SPARC_LEON3FT_B2BST_NOP ); + T_true( IsEqualIgnoreWhiteSpace( s, "nop" ) ); +} + +/** + * @fn void T_case_body_BspSparcLeon3ValGr712rc( void ) + */ +T_TEST_CASE( BspSparcLeon3ValGr712rc ) +{ + BspSparcLeon3ValGr712rc_Action_0(); +} + +/** @} */ diff --git a/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.c b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.c new file mode 100644 index 0000000000..748fd88e70 --- /dev/null +++ b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.c @@ -0,0 +1,175 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValFatalCacheSnoopingDisabledBoot + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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 "tr-fatal-sparc-leon3-cache-snooping-disabled-boot.h" + +#include + +/** + * @defgroup BspSparcLeon3ValFatalCacheSnoopingDisabledBoot \ + * spec:/bsp/sparc/leon3/val/fatal-cache-snooping-disabled-boot + * + * @ingroup TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledBoot + * + * @brief Tests a fatal error. + * + * This test case performs the following actions: + * + * - The test action is carried out by the DisableCacheSnooping() system + * initialization handler. + * + * - Check that the expected fatal source is present. + * + * - Check that the expected fatal code is present. + * + * @{ + */ + +/** + * @brief Test context for + * spec:/bsp/sparc/leon3/val/fatal-cache-snooping-disabled-boot test case. + */ +typedef struct { + /** + * @brief This member contains a copy of the corresponding + * BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Run() parameter. + */ + rtems_fatal_source source; + + /** + * @brief This member contains a copy of the corresponding + * BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Run() parameter. + */ + rtems_fatal_code code; +} BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Context; + +static BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Context + BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Instance; + +static void DisableCacheSnooping( void ) +{ + uint32_t control; + + control = leon3_get_cache_control_register(); + control &= ~LEON3_REG_CACHE_CTRL_DS; + leon3_set_cache_control_register( control ); +} + +RTEMS_SYSINIT_ITEM( + DisableCacheSnooping, + RTEMS_SYSINIT_BSP_EARLY, + RTEMS_SYSINIT_ORDER_FIRST +); + +static T_fixture BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Fixture = { + .setup = NULL, + .stop = NULL, + .teardown = NULL, + .scope = NULL, + .initial_context = &BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Instance +}; + +/** + * @brief The test action is carried out by the DisableCacheSnooping() system + * initialization handler. + */ +static void BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Action_0( + BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Context *ctx +) +{ + /* Nothing to do */ + + /* + * Check that the expected fatal source is present. + */ + T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_BSP ); + + /* + * Check that the expected fatal code is present. + */ + T_step_eq_ulong( + 1, + ctx->code, + LEON3_FATAL_INVALID_CACHE_CONFIG_BOOT_PROCESSOR + ); +} + +void BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Run( + rtems_fatal_source source, + rtems_fatal_code code +) +{ + BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Context *ctx; + + ctx = &BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Instance; + ctx->source = source; + ctx->code = code; + + ctx = T_case_begin( + "BspSparcLeon3ValFatalCacheSnoopingDisabledBoot", + &BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Fixture + ); + + T_plan( 2 ); + + BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Action_0( ctx ); + + T_case_end(); +} + +/** @} */ diff --git a/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.h b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.h new file mode 100644 index 0000000000..e375e6baac --- /dev/null +++ b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-boot.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValFatalCacheSnoopingDisabledBoot + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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_SPARC_LEON3_CACHE_SNOOPING_DISABLED_BOOT_H +#define _TR_FATAL_SPARC_LEON3_CACHE_SNOOPING_DISABLED_BOOT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup BspSparcLeon3ValFatalCacheSnoopingDisabledBoot + * + * @{ + */ + +/** + * @brief Runs the parameterized test case. + * + * @param source is fatal source. + * + * @param code is fatal code. + */ +void BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Run( + rtems_fatal_source source, + rtems_fatal_code code +); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* _TR_FATAL_SPARC_LEON3_CACHE_SNOOPING_DISABLED_BOOT_H */ diff --git a/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.c b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.c new file mode 100644 index 0000000000..4d90abf42d --- /dev/null +++ b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.c @@ -0,0 +1,176 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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 "tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.h" + +#include + +/** + * @defgroup BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary \ + * spec:/bsp/sparc/leon3/val/fatal-cache-snooping-disabled-secondary + * + * @ingroup TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledSecondary + * + * @brief Tests a fatal error. + * + * This test case performs the following actions: + * + * - The test action is carried out by the wrapped + * bsp_start_on_secondary_processor() function. + * + * - Check that the expected fatal source is present. + * + * - Check that the expected fatal code is present. + * + * @{ + */ + +/** + * @brief Test context for + * spec:/bsp/sparc/leon3/val/fatal-cache-snooping-disabled-secondary test + * case. + */ +typedef struct { + /** + * @brief This member contains a copy of the corresponding + * BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Run() parameter. + */ + rtems_fatal_source source; + + /** + * @brief This member contains a copy of the corresponding + * BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Run() parameter. + */ + rtems_fatal_code code; +} BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Context; + +static BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Context + BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Instance; + +void __real_bsp_start_on_secondary_processor( struct Per_CPU_Control *cpu_self ); + +void __wrap_bsp_start_on_secondary_processor( struct Per_CPU_Control *cpu_self ); + +void __wrap_bsp_start_on_secondary_processor( struct Per_CPU_Control *cpu_self ) +{ + uint32_t control; + + control = leon3_get_cache_control_register(); + control &= ~LEON3_REG_CACHE_CTRL_DS; + leon3_set_cache_control_register( control ); + + __real_bsp_start_on_secondary_processor( cpu_self ); +} + +static T_fixture BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Fixture = { + .setup = NULL, + .stop = NULL, + .teardown = NULL, + .scope = NULL, + .initial_context = &BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Instance +}; + +/** + * @brief The test action is carried out by the wrapped + * bsp_start_on_secondary_processor() function. + */ +static void BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Action_0( + BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Context *ctx +) +{ + /* Nothing to do */ + + /* + * Check that the expected fatal source is present. + */ + T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_BSP ); + + /* + * Check that the expected fatal code is present. + */ + T_step_eq_ulong( + 1, + ctx->code, + LEON3_FATAL_INVALID_CACHE_CONFIG_SECONDARY_PROCESSOR + ); +} + +void BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Run( + rtems_fatal_source source, + rtems_fatal_code code +) +{ + BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Context *ctx; + + ctx = &BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Instance; + ctx->source = source; + ctx->code = code; + + ctx = T_case_begin( + "BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary", + &BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Fixture + ); + + T_plan( 2 ); + + BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Action_0( ctx ); + + T_case_end(); +} + +/** @} */ diff --git a/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.h b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.h new file mode 100644 index 0000000000..0782942222 --- /dev/null +++ b/testsuites/validation/bsps/tr-fatal-sparc-leon3-cache-snooping-disabled-secondary.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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_SPARC_LEON3_CACHE_SNOOPING_DISABLED_SECONDARY_H +#define _TR_FATAL_SPARC_LEON3_CACHE_SNOOPING_DISABLED_SECONDARY_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary + * + * @{ + */ + +/** + * @brief Runs the parameterized test case. + * + * @param source is fatal source. + * + * @param code is fatal code. + */ +void BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Run( + rtems_fatal_source source, + rtems_fatal_code code +); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* _TR_FATAL_SPARC_LEON3_CACHE_SNOOPING_DISABLED_SECONDARY_H */ diff --git a/testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.c b/testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.c new file mode 100644 index 0000000000..5cd81b736c --- /dev/null +++ b/testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.c @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValFatalClockInitialization + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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 "tr-fatal-sparc-leon3-clock-initialization.h" + +#include + +/** + * @defgroup BspSparcLeon3ValFatalClockInitialization \ + * spec:/bsp/sparc/leon3/val/fatal-clock-initialization + * + * @ingroup TestsuitesBspsFatalSparcLeon3ClockInitialization + * + * @brief Tests a fatal error. + * + * This test case performs the following actions: + * + * - The test action is carried out by the OccupyClockInterrupt() system + * initialization handler. + * + * - Check that the expected fatal source is present. + * + * - Check that the expected fatal code is present. + * + * @{ + */ + +/** + * @brief Test context for spec:/bsp/sparc/leon3/val/fatal-clock-initialization + * test case. + */ +typedef struct { + /** + * @brief This member contains a copy of the corresponding + * BspSparcLeon3ValFatalClockInitialization_Run() parameter. + */ + rtems_fatal_source source; + + /** + * @brief This member contains a copy of the corresponding + * BspSparcLeon3ValFatalClockInitialization_Run() parameter. + */ + rtems_fatal_code code; +} BspSparcLeon3ValFatalClockInitialization_Context; + +static BspSparcLeon3ValFatalClockInitialization_Context + BspSparcLeon3ValFatalClockInitialization_Instance; + +static void ClockInterrupt( void *arg ) +{ + (void) arg; +} + +static rtems_interrupt_entry interrupt_entry = RTEMS_INTERRUPT_ENTRY_INITIALIZER( + ClockInterrupt, + NULL, + "Clock" +); + +static void OccupyClockInterrupt( void ) +{ + rtems_vector_number vector; + + vector = GPTIMER_CONFIG_IRQ_GET( grlib_load_32( &LEON3_Timer_Regs->config ) ); + (void) rtems_interrupt_entry_install( + vector, + RTEMS_INTERRUPT_UNIQUE, + &interrupt_entry + ); +} + +RTEMS_SYSINIT_ITEM( + OccupyClockInterrupt, + RTEMS_SYSINIT_DEVICE_DRIVERS, + RTEMS_SYSINIT_ORDER_FIRST +); + +static T_fixture BspSparcLeon3ValFatalClockInitialization_Fixture = { + .setup = NULL, + .stop = NULL, + .teardown = NULL, + .scope = NULL, + .initial_context = &BspSparcLeon3ValFatalClockInitialization_Instance +}; + +/** + * @brief The test action is carried out by the OccupyClockInterrupt() system + * initialization handler. + */ +static void BspSparcLeon3ValFatalClockInitialization_Action_0( + BspSparcLeon3ValFatalClockInitialization_Context *ctx +) +{ + /* Nothing to do */ + + /* + * Check that the expected fatal source is present. + */ + T_step_eq_int( 0, ctx->source, RTEMS_FATAL_SOURCE_BSP ); + + /* + * Check that the expected fatal code is present. + */ + T_step_eq_ulong( + 1, + ctx->code, + LEON3_FATAL_CLOCK_INITIALIZATION + ); +} + +void BspSparcLeon3ValFatalClockInitialization_Run( + rtems_fatal_source source, + rtems_fatal_code code +) +{ + BspSparcLeon3ValFatalClockInitialization_Context *ctx; + + ctx = &BspSparcLeon3ValFatalClockInitialization_Instance; + ctx->source = source; + ctx->code = code; + + ctx = T_case_begin( + "BspSparcLeon3ValFatalClockInitialization", + &BspSparcLeon3ValFatalClockInitialization_Fixture + ); + + T_plan( 2 ); + + BspSparcLeon3ValFatalClockInitialization_Action_0( ctx ); + + T_case_end(); +} + +/** @} */ diff --git a/testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.h b/testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.h new file mode 100644 index 0000000000..6997b3f22c --- /dev/null +++ b/testsuites/validation/bsps/tr-fatal-sparc-leon3-clock-initialization.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValFatalClockInitialization + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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_SPARC_LEON3_CLOCK_INITIALIZATION_H +#define _TR_FATAL_SPARC_LEON3_CLOCK_INITIALIZATION_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup BspSparcLeon3ValFatalClockInitialization + * + * @{ + */ + +/** + * @brief Runs the parameterized test case. + * + * @param source is fatal source. + * + * @param code is fatal code. + */ +void BspSparcLeon3ValFatalClockInitialization_Run( + rtems_fatal_source source, + rtems_fatal_code code +); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* _TR_FATAL_SPARC_LEON3_CLOCK_INITIALIZATION_H */ diff --git a/testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-boot.c b/testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-boot.c new file mode 100644 index 0000000000..53e18b5b0b --- /dev/null +++ b/testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-boot.c @@ -0,0 +1,79 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledBoot + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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-sparc-leon3-cache-snooping-disabled-boot.h" + +#include + +/** + * @defgroup TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledBoot \ + * spec:/testsuites/bsps/fatal-sparc-leon3-cache-snooping-disabled-boot + * + * @ingroup RTEMSTestSuitesValidation + * + * @brief This validation test suite contains a test case which triggers a + * fatal error during system initialization. + * + * @{ + */ + +const char rtems_test_name[] = "TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledBoot"; + +#define FATAL_SYSINIT_RUN BspSparcLeon3ValFatalCacheSnoopingDisabledBoot_Run + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#include "ts-fatal-sysinit.h" + +/** @} */ diff --git a/testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-secondary.c b/testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-secondary.c new file mode 100644 index 0000000000..3b8829dcf9 --- /dev/null +++ b/testsuites/validation/bsps/ts-fatal-sparc-leon3-cache-snooping-disabled-secondary.c @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledSecondary + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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-sparc-leon3-cache-snooping-disabled-secondary.h" + +#include + +/** + * @defgroup TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledSecondary \ + * spec:/testsuites/bsps/fatal-sparc-leon3-cache-snooping-disabled-secondary + * + * @ingroup RTEMSTestSuitesValidation + * + * @brief This validation test suite contains a test case which triggers a + * fatal error during system initialization. + * + * @{ + */ + +const char rtems_test_name[] = "TestsuitesBspsFatalSparcLeon3CacheSnoopingDisabledSecondary"; + +#define FATAL_SYSINIT_RUN \ + BspSparcLeon3ValFatalCacheSnoopingDisabledSecondary_Run + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_PROCESSORS 2 + +#include "ts-fatal-sysinit.h" + +/** @} */ diff --git a/testsuites/validation/bsps/ts-fatal-sparc-leon3-clock-initialization.c b/testsuites/validation/bsps/ts-fatal-sparc-leon3-clock-initialization.c new file mode 100644 index 0000000000..b75223537f --- /dev/null +++ b/testsuites/validation/bsps/ts-fatal-sparc-leon3-clock-initialization.c @@ -0,0 +1,79 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup TestsuitesBspsFatalSparcLeon3ClockInitialization + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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-sparc-leon3-clock-initialization.h" + +#include + +/** + * @defgroup TestsuitesBspsFatalSparcLeon3ClockInitialization \ + * spec:/testsuites/bsps/fatal-sparc-leon3-clock-initialization + * + * @ingroup RTEMSTestSuitesValidation + * + * @brief This validation test suite contains a test case which triggers a + * fatal error during system initialization. + * + * @{ + */ + +const char rtems_test_name[] = "TestsuitesBspsFatalSparcLeon3ClockInitialization"; + +#define FATAL_SYSINIT_RUN BspSparcLeon3ValFatalClockInitialization_Run + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#include "ts-fatal-sysinit.h" + +/** @} */ diff --git a/testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown-response.c b/testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown-response.c new file mode 100644 index 0000000000..d730b6d027 --- /dev/null +++ b/testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown-response.c @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestSuiteTestsuitesFatalBspSparcLeon3ShutdownResponse + */ + +/* + * Copyright (C) 2021 embedded brains GmbH & Co. KG + * + * 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-sparc-leon3-shutdown-response.h" + +#include + +/** + * @defgroup RTEMSTestSuiteTestsuitesFatalBspSparcLeon3ShutdownResponse \ + * spec:/testsuites/fatal-sparc-leon3-shutdown-response + * + * @ingroup RTEMSTestSuitesValidation + * + * @brief This validation test suite contains a test case which performs a + * system shutdown. + * + * @{ + */ + +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 + +#include "ts-fatal-sysinit.h" + +/** @} */ diff --git a/testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown.c b/testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown.c new file mode 100644 index 0000000000..7f5ddbb614 --- /dev/null +++ b/testsuites/validation/bsps/ts-fatal-sparc-leon3-shutdown.c @@ -0,0 +1,170 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup TestsuitesBspsFatalSparcLeon3Shutdown + */ + +/* + * Copyright (C) 2021, 2022 embedded brains GmbH & Co. KG + * + * 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 + +#include "ts-config.h" +#include "tx-support.h" + +#include + +/** + * @defgroup TestsuitesBspsFatalSparcLeon3Shutdown \ + * spec:/testsuites/bsps/fatal-sparc-leon3-shutdown + * + * @ingroup RTEMSTestSuitesValidation + * + * @brief This validation test suite provides an application configuration to + * perform a shutdown. + * + * @{ + */ + +const char rtems_test_name[] = "TestsuitesBspsFatalSparcLeon3Shutdown"; + +static char buffer[ 512 ]; + +static const T_action actions[] = { + T_report_hash_sha256 +}; + +static const T_config test_config = { + .name = rtems_test_name, + .buf = buffer, + .buf_size = sizeof( buffer ), + .putchar = rtems_put_char, + .verbosity = RTEMS_TEST_VERBOSITY, + .now = T_now_tick, + .allocate = T_memory_allocate, + .deallocate = T_memory_deallocate, + .action_count = T_ARRAY_SIZE( actions ), + .actions = actions +}; + +void __real__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr code ); + +void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr code ); + +void __wrap__CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr code ) +{ + int exit_code; + + T_register(); + exit_code = T_main( &test_config ); + + if ( exit_code == 0 ) { + rtems_test_end( rtems_test_name ); + } + +#if defined(RTEMS_GCOV_COVERAGE) + rtems_test_gcov_dump_info(); +#endif + __real__CPU_Fatal_halt( source, code ); +} + +#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 ) + +#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 0 + +#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 + +#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY + +#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM + +#define CONFIGURE_IDLE_TASK_STORAGE_SIZE RTEMS_MINIMUM_STACK_SIZE + +#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION + +static void *ShutdownIdleBody( uintptr_t arg ) +{ + if ( rtems_scheduler_get_processor() == 0 ) { + rtems_test_begin( rtems_test_name, TEST_STATE ); + rtems_fatal( RTEMS_FATAL_SOURCE_SMP, SMP_FATAL_SHUTDOWN ); + } + + return _CPU_Thread_Idle_body( arg ); +} + +#define CONFIGURE_IDLE_TASK_BODY ShutdownIdleBody + +#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = FatalInitialExtension } + +#define CONFIGURE_INIT + +#include + +/** @} */ -- cgit v1.2.3