diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-09-17 11:28:04 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-09-24 12:02:01 +0200 |
commit | a5fd7437ca648abede1583ffea5407bcca2eee1c (patch) | |
tree | a108d768d5378441ed79b8e12c36e3f16431dcd5 | |
parent | spec: Thread pin/unpin with only one CPU (diff) | |
download | rtems-central-a5fd7437ca648abede1583ffea5407bcca2eee1c.tar.bz2 |
spec: Specify one scheduler fatal error
4 files changed, 142 insertions, 0 deletions
diff --git a/spec/score/smp/if/fatal-scheduler-requires-exactly-one-processor.yml b/spec/score/smp/if/fatal-scheduler-requires-exactly-one-processor.yml new file mode 100644 index 00000000..cb9e8123 --- /dev/null +++ b/spec/score/smp/if/fatal-scheduler-requires-exactly-one-processor.yml @@ -0,0 +1,12 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +index-entries: [] +interface-type: unspecified-define +links: +- role: interface-placement + uid: header-impl +name: SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR +references: [] +type: interface diff --git a/spec/score/smp/req/fatal-scheduler-requires-exactly-one-processor.yml b/spec/score/smp/req/fatal-scheduler-requires-exactly-one-processor.yml new file mode 100644 index 00000000..c1a09236 --- /dev/null +++ b/spec/score/smp/req/fatal-scheduler-requires-exactly-one-processor.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: RTEMS_SMP +links: +- role: requirement-refinement + uid: /req/fatal-error +- role: requirement-refinement + uid: ../if/group +functional-type: function +rationale: null +references: [] +requirement-type: functional +text: | + Where the configured scheduler does support exactly one processor, where the + system has not exactly one processor, if the system is initialized, then the + system shall terminate with the ${/score/interr/if/source-smp:/name} fatal + source and the ${../if/fatal-scheduler-requires-exactly-one-processor:/name} + fatal code. +type: requirement diff --git a/spec/score/smp/val/fatal-scheduler-requires-exactly-one-processor.yml b/spec/score/smp/val/fatal-scheduler-requires-exactly-one-processor.yml new file mode 100644 index 00000000..4583b0ec --- /dev/null +++ b/spec/score/smp/val/fatal-scheduler-requires-exactly-one-processor.yml @@ -0,0 +1,64 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: RTEMS_SMP +links: [] +test-actions: +- action-brief: | + The test action is carried out by the application configuration of the test + suite. + action-code: | + /* Nothing to do */ + checks: + - brief: | + Check that the expected fatal source is present. + code: | + T_step_eq_int( ${step}, ctx->source, RTEMS_FATAL_SOURCE_SMP ); + links: + - role: validation + uid: ../req/fatal-scheduler-requires-exactly-one-processor + - brief: | + Check that the expected fatal code is present. + code: | + T_step_eq_ulong( + ${step}, + ctx->code, + SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR + ); + links: + - role: validation + uid: ../req/fatal-scheduler-requires-exactly-one-processor + links: [] +test-brief: | + Tests a fatal error. +test-context: [] +test-context-support: null +test-description: null +test-header: + code: null + freestanding: true + includes: + - rtems.h + local-includes: [] + run-params: + - description: | + is fatal source. + dir: null + name: source + specifier: ${/rtems/userext/if/fatal-source:/name} ${.:name} + - description: | + is fatal code. + dir: null + name: code + specifier: ${/rtems/userext/if/fatal-code:/name} ${.:name} + target: testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.h +test-includes: +- rtems/score/smpimpl.h +test-local-includes: +- tr-fatal-scheduler-requires-exactly-one-processor.h +test-setup: null +test-stop: null +test-support: null +test-target: testsuites/validation/tr-fatal-scheduler-requires-exactly-one-processor.c +test-teardown: null +type: test-case diff --git a/spec/testsuites/fatal-scheduler-requires-exactly-one-processor.yml b/spec/testsuites/fatal-scheduler-requires-exactly-one-processor.yml new file mode 100644 index 00000000..5a09f827 --- /dev/null +++ b/spec/testsuites/fatal-scheduler-requires-exactly-one-processor.yml @@ -0,0 +1,46 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: RTEMS_SMP +links: +- role: requirement-refinement + uid: /req/test-suites +- role: validation + uid: /score/smp/req/fatal-scheduler-requires-exactly-one-processor +test-brief: | + This validation test suite uses an application configuration which triggers a + fatal error during system initialization. +test-code: | + const char rtems_test_name[] = "${.:/test-suite-name}"; + + #define FATAL_SYSINIT_RUN \ + ScoreSmpValFatalSchedulerRequiresExactlyOneProcessor_Run + + #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + + #define CONFIGURE_MAXIMUM_PROCESSORS 2 + + #include <rtems/score/schedulerpriority.h> + + #define CONFIGURE_SCHEDULER_PRIORITY + + #include <rtems/scheduler.h> + + RTEMS_SCHEDULER_PRIORITY( a, 256 ); + + #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \ + RTEMS_SCHEDULER_TABLE_PRIORITY( 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" +test-description: null +test-includes: [] +test-local-includes: +- tr-fatal-scheduler-requires-exactly-one-processor.h +- ts-config.h +test-suite-name: FatalSchedulerRequiresExactlyOneProcessor +test-target: testsuites/validation/ts-fatal-scheduler-requires-exactly-one-processor.c +type: test-suite |