diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-19 08:19:48 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-19 08:22:34 +0100 |
commit | 5b5b9bf489edf12be67620e773377f0d5f72ae01 (patch) | |
tree | 25cb7cf574dc2becf9b6b9a10af115a03d977e46 | |
parent | spec: Improve task modes specification (diff) | |
download | rtems-central-5b5b9bf489edf12be67620e773377f0d5f72ae01.tar.bz2 |
spec: Specify EDF SMP set affinity error
-rw-r--r-- | spec/score/sched/smp/edf/req/set-affinity-unsupported-subset.yml | 20 | ||||
-rw-r--r-- | spec/score/sched/smp/edf/val/edf.yml | 50 | ||||
-rw-r--r-- | spec/score/status/if/invalid-number.yml | 12 |
3 files changed, 82 insertions, 0 deletions
diff --git a/spec/score/sched/smp/edf/req/set-affinity-unsupported-subset.yml b/spec/score/sched/smp/edf/req/set-affinity-unsupported-subset.yml new file mode 100644 index 00000000..8efdea32 --- /dev/null +++ b/spec/score/sched/smp/edf/req/set-affinity-unsupported-subset.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: RTEMS_SMP +links: +- role: requirement-refinement + uid: group +functional-type: function +rationale: null +references: [] +requirement-type: functional +text: | + While a thread to processor affinity set is a proper subset of the set of the + online processors, while the affinity set contains at least two processors, + while at least one processor of the affinity set is owned by a scheduler, + while a thread uses the scheduler as its ${/glossary/scheduler-home:/term}, + when an attempt is made to set the thread to processor affinity set of the + thread to the affinity set, the operation shall abort with an error status + derived from ${/score/status/if/invalid-number:/name}. +type: requirement diff --git a/spec/score/sched/smp/edf/val/edf.yml b/spec/score/sched/smp/edf/val/edf.yml new file mode 100644 index 00000000..4883b98c --- /dev/null +++ b/spec/score/sched/smp/edf/val/edf.yml @@ -0,0 +1,50 @@ +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 +links: [] +test-actions: +- action-brief: | + Validate a set affinity error case with an unsupported subset. + action-code: | + if ( rtems_scheduler_get_processor_maximum() >= 3 ) { + rtems_status_code sc; + cpu_set_t affinity; + + CPU_ZERO( &affinity ); + CPU_SET( 0, &affinity ); + CPU_SET( 1, &affinity ); + + RemoveProcessor( SCHEDULER_B_ID, 1 ); + RemoveProcessor( SCHEDULER_C_ID, 2 ); + AddProcessor( SCHEDULER_A_ID, 1 ); + AddProcessor( SCHEDULER_B_ID, 2 ); + + sc = rtems_task_set_affinity( RTEMS_SELF, sizeof( affinity), &affinity ); + T_rsc( sc, RTEMS_INVALID_NUMBER ); + + RemoveProcessor( SCHEDULER_A_ID, 1 ); + RemoveProcessor( SCHEDULER_B_ID, 2 ); + AddProcessor( SCHEDULER_B_ID, 1 ); + AddProcessor( SCHEDULER_C_ID, 2 ); + } + checks: [] + links: + - role: validation + uid: ../req/set-affinity-unsupported-subset +test-brief: | + Tests for operations of the EDF SMP scheduler. +test-context: [] +test-context-support: null +test-description: null +test-header: null +test-includes: +- rtems.h +test-local-includes: +- tx-support.h +test-setup: null +test-stop: null +test-support: null +test-target: testsuites/validation/tc-sched-smp-edf.c +test-teardown: null +type: test-case diff --git a/spec/score/status/if/invalid-number.yml b/spec/score/status/if/invalid-number.yml new file mode 100644 index 00000000..2381100a --- /dev/null +++ b/spec/score/status/if/invalid-number.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 +links: +- role: interface-placement + uid: header +name: STATUS_INVALID_NUMBER +references: [] +type: interface |