[rtems-central commit] spec: Specify signal numbers

Sebastian Huber sebh at rtems.org
Fri Nov 19 07:51:57 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    cad51c406124ab59d2016e278045f552af79a2ee
Changeset: http://git.rtems.org/rtems-central/commit/?id=cad51c406124ab59d2016e278045f552af79a2ee

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Nov 17 16:16:22 2021 +0100

spec: Specify signal numbers

---

 spec/rtems/signal/if/header-2.yml         |  2 +
 spec/rtems/signal/if/header.yml           |  2 +
 spec/rtems/signal/req/group.yml           | 16 +++++++
 spec/rtems/signal/req/signal-constant.yml | 78 +++++++++++++++++++++++++++++++
 spec/rtems/signal/req/signal-number.yml   | 15 ++++++
 spec/rtems/signal/val/signal-constant.yml | 60 ++++++++++++++++++++++++
 spec/rtems/signal/val/signals.yml         | 66 ++++++++++++++++++++++++++
 7 files changed, 239 insertions(+)

diff --git a/spec/rtems/signal/if/header-2.yml b/spec/rtems/signal/if/header-2.yml
index eef8150..aec1373 100644
--- a/spec/rtems/signal/if/header-2.yml
+++ b/spec/rtems/signal/if/header-2.yml
@@ -8,6 +8,8 @@ interface-type: header-file
 links:
 - role: interface-placement
   uid: /if/domain
+- role: interface-ingroup
+  uid: ../req/group
 path: rtems/rtems/asr.h
 prefix: cpukit/include
 type: interface
diff --git a/spec/rtems/signal/if/header.yml b/spec/rtems/signal/if/header.yml
index 3e2f181..d64cc33 100644
--- a/spec/rtems/signal/if/header.yml
+++ b/spec/rtems/signal/if/header.yml
@@ -8,6 +8,8 @@ interface-type: header-file
 links:
 - role: interface-placement
   uid: /if/domain
+- role: interface-ingroup
+  uid: ../req/group
 path: rtems/rtems/signal.h
 prefix: cpukit/include
 type: interface
diff --git a/spec/rtems/signal/req/group.yml b/spec/rtems/signal/req/group.yml
new file mode 100644
index 0000000..682aa8d
--- /dev/null
+++ b/spec/rtems/signal/req/group.yml
@@ -0,0 +1,16 @@
+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
+identifier: RTEMSImplClassicSignal
+links:
+- role: interface-ingroup
+  uid: ../../req/group
+non-functional-type: design-group
+rationale: null
+references: []
+requirement-type: non-functional
+text: |
+  The software architecture shall have a component containing the Signal
+  Manager implementation.
+type: requirement
diff --git a/spec/rtems/signal/req/signal-constant.yml b/spec/rtems/signal/req/signal-constant.yml
new file mode 100644
index 0000000..de922fa
--- /dev/null
+++ b/spec/rtems/signal/req/signal-constant.yml
@@ -0,0 +1,78 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: interface-function
+  uid: ../if/signal-00
+- role: interface-function
+  uid: ../if/signal-01
+- role: interface-function
+  uid: ../if/signal-02
+- role: interface-function
+  uid: ../if/signal-03
+- role: interface-function
+  uid: ../if/signal-04
+- role: interface-function
+  uid: ../if/signal-05
+- role: interface-function
+  uid: ../if/signal-06
+- role: interface-function
+  uid: ../if/signal-07
+- role: interface-function
+  uid: ../if/signal-08
+- role: interface-function
+  uid: ../if/signal-09
+- role: interface-function
+  uid: ../if/signal-10
+- role: interface-function
+  uid: ../if/signal-11
+- role: interface-function
+  uid: ../if/signal-12
+- role: interface-function
+  uid: ../if/signal-13
+- role: interface-function
+  uid: ../if/signal-14
+- role: interface-function
+  uid: ../if/signal-15
+- role: interface-function
+  uid: ../if/signal-16
+- role: interface-function
+  uid: ../if/signal-17
+- role: interface-function
+  uid: ../if/signal-18
+- role: interface-function
+  uid: ../if/signal-19
+- role: interface-function
+  uid: ../if/signal-20
+- role: interface-function
+  uid: ../if/signal-21
+- role: interface-function
+  uid: ../if/signal-22
+- role: interface-function
+  uid: ../if/signal-23
+- role: interface-function
+  uid: ../if/signal-24
+- role: interface-function
+  uid: ../if/signal-25
+- role: interface-function
+  uid: ../if/signal-26
+- role: interface-function
+  uid: ../if/signal-27
+- role: interface-function
+  uid: ../if/signal-28
+- role: interface-function
+  uid: ../if/signal-29
+- role: interface-function
+  uid: ../if/signal-30
+- role: interface-function
+  uid: ../if/signal-31
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Let :math:`J\in{0, 1, ..., 31}`.  The :math:`J`-th signal number constant
+  shall be a constant expression which evaluates to the integer representation
+  of signal number :math:`J`.
+type: requirement
diff --git a/spec/rtems/signal/req/signal-number.yml b/spec/rtems/signal/req/signal-number.yml
new file mode 100644
index 0000000..7510a8f
--- /dev/null
+++ b/spec/rtems/signal/req/signal-number.yml
@@ -0,0 +1,15 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: requirement-refinement
+  uid: group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Let :math:`J\in{0, 1, ..., 31}`.  The signal number :math:`J` shall be
+  represented by the integer :math:`2^J`.
+type: requirement
diff --git a/spec/rtems/signal/val/signal-constant.yml b/spec/rtems/signal/val/signal-constant.yml
new file mode 100644
index 0000000..f436e39
--- /dev/null
+++ b/spec/rtems/signal/val/signal-constant.yml
@@ -0,0 +1,60 @@
+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 the signal constant.
+  action-code: |
+    /* No action */
+  checks:
+  - brief: |
+      Check that the signal constant is equal to the signal number bit in the
+      signal set.
+    code: |
+      T_step_eq_u32(
+        ${step},
+        ctx->signal,
+        ( (rtems_signal_set) 1 ) << ctx->number
+      );
+    links:
+    - role: validation
+      uid: ../req/signal-constant
+    - role: validation
+      uid: ../req/signal-number
+  links: []
+test-brief: |
+  Tests an signal constant and number of the Signal Manager using the Classic and
+  system signal sets of the executing task.
+test-context: []
+test-context-support: null
+test-description: null
+test-header:
+  code: null
+  freestanding: false
+  includes:
+  - rtems.h
+  local-includes: []
+  run-params:
+  - description: |
+      is the signal constant.
+    dir: null
+    name: signal
+    specifier: rtems_signal_set ${.:name}
+  - description: |
+      is the signal number.
+    dir: null
+    name: number
+    specifier: int ${.:name}
+  target: testsuites/validation/tr-signal-constant.h
+test-includes:
+- rtems.h
+test-local-includes:
+- tr-signal-constant.h
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tr-signal-constant.c
+test-teardown: null
+type: test-case
diff --git a/spec/rtems/signal/val/signals.yml b/spec/rtems/signal/val/signals.yml
new file mode 100644
index 0000000..4dd4f62
--- /dev/null
+++ b/spec/rtems/signal/val/signals.yml
@@ -0,0 +1,66 @@
+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: |
+    Run the signal constant and number test for all 32 signal constants.
+  action-code: |
+    unsigned int i;
+
+    for ( i = 0; i < 32; ++i ) {
+      ${signal-constant:/test-run}( signals[ i ], i );
+      T_step( i ); /* ${steps/32} */
+    }
+  checks: []
+  links: []
+test-brief: Tests the Signal Manager API.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes:
+- tr-signal-constant.h
+test-setup: null
+test-stop: null
+test-support: |
+  static const rtems_signal_set signals[] = {
+    RTEMS_SIGNAL_0,
+    RTEMS_SIGNAL_1,
+    RTEMS_SIGNAL_2,
+    RTEMS_SIGNAL_3,
+    RTEMS_SIGNAL_4,
+    RTEMS_SIGNAL_5,
+    RTEMS_SIGNAL_6,
+    RTEMS_SIGNAL_7,
+    RTEMS_SIGNAL_8,
+    RTEMS_SIGNAL_9,
+    RTEMS_SIGNAL_10,
+    RTEMS_SIGNAL_11,
+    RTEMS_SIGNAL_12,
+    RTEMS_SIGNAL_13,
+    RTEMS_SIGNAL_14,
+    RTEMS_SIGNAL_15,
+    RTEMS_SIGNAL_16,
+    RTEMS_SIGNAL_17,
+    RTEMS_SIGNAL_18,
+    RTEMS_SIGNAL_19,
+    RTEMS_SIGNAL_20,
+    RTEMS_SIGNAL_21,
+    RTEMS_SIGNAL_22,
+    RTEMS_SIGNAL_23,
+    RTEMS_SIGNAL_24,
+    RTEMS_SIGNAL_25,
+    RTEMS_SIGNAL_26,
+    RTEMS_SIGNAL_27,
+    RTEMS_SIGNAL_28,
+    RTEMS_SIGNAL_29,
+    RTEMS_SIGNAL_30,
+    RTEMS_SIGNAL_31
+  };
+test-target: testsuites/validation/tc-signals.c
+test-teardown: null
+type: test-case



More information about the vc mailing list