[rtems-central commit] spec: Improve Signal Manager specification

Sebastian Huber sebh at rtems.org
Tue Nov 23 16:20:18 UTC 2021


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Nov 23 16:48:13 2021 +0100

spec: Improve Signal Manager specification

---

 spec/rtems/signal/req/signal-constant.yml |  6 ++--
 spec/rtems/signal/req/signal-count.yml    | 14 ++++++++
 spec/rtems/signal/req/signal-delivery.yml | 16 +++++++++
 spec/rtems/signal/req/signal-number.yml   |  6 ++--
 spec/rtems/signal/req/signal-set.yml      | 15 +++++++++
 spec/rtems/signal/val/signal-constant.yml | 54 +++++++++++++++++++++++++++----
 spec/rtems/signal/val/signals.yml         | 12 +++++--
 7 files changed, 108 insertions(+), 15 deletions(-)

diff --git a/spec/rtems/signal/req/signal-constant.yml b/spec/rtems/signal/req/signal-constant.yml
index de922fa..bcfe93d 100644
--- a/spec/rtems/signal/req/signal-constant.yml
+++ b/spec/rtems/signal/req/signal-constant.yml
@@ -72,7 +72,7 @@ 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`.
+  Let :math:`J\in{0, 1, ..., 31}`.  The :math:`J`-th signal constant shall be a
+  constant expression which evaluates to the integer representation of signal
+  :math:`J`.
 type: requirement
diff --git a/spec/rtems/signal/req/signal-count.yml b/spec/rtems/signal/req/signal-count.yml
new file mode 100644
index 0000000..7ff704f
--- /dev/null
+++ b/spec/rtems/signal/req/signal-count.yml
@@ -0,0 +1,14 @@
+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: |
+  The ${../if/group:/name} shall support exactly 32 signals.
+type: requirement
diff --git a/spec/rtems/signal/req/signal-delivery.yml b/spec/rtems/signal/req/signal-delivery.yml
new file mode 100644
index 0000000..1fb1805
--- /dev/null
+++ b/spec/rtems/signal/req/signal-delivery.yml
@@ -0,0 +1,16 @@
+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/send
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Let :math:`J\in{0, 1, ..., 31}`.  While a task is able to catch signals, when
+  signal :math:`J` is sent to the task, it shall be caught by the task as
+  exactly signal :math:`J`.
+type: requirement
diff --git a/spec/rtems/signal/req/signal-number.yml b/spec/rtems/signal/req/signal-number.yml
index 7510a8f..a8579b0 100644
--- a/spec/rtems/signal/req/signal-number.yml
+++ b/spec/rtems/signal/req/signal-number.yml
@@ -4,12 +4,12 @@ copyrights:
 enabled-by: true
 links:
 - role: requirement-refinement
-  uid: group
+  uid: signal-count
 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`.
+  Let :math:`J\in{0, 1, ..., 31}`.  The signal :math:`J` shall be represented
+  by the integer :math:`2^J`.
 type: requirement
diff --git a/spec/rtems/signal/req/signal-set.yml b/spec/rtems/signal/req/signal-set.yml
new file mode 100644
index 0000000..5b18472
--- /dev/null
+++ b/spec/rtems/signal/req/signal-set.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: interface-function
+  uid: ../if/set
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Let :math:`J\in{0, 1, ..., 31}`.  The ${../if/set:/name} integer type shall
+  be able to represent the integer representation of signal :math:`J`.
+type: requirement
diff --git a/spec/rtems/signal/val/signal-constant.yml b/spec/rtems/signal/val/signal-constant.yml
index f436e39..b883842 100644
--- a/spec/rtems/signal/val/signal-constant.yml
+++ b/spec/rtems/signal/val/signal-constant.yml
@@ -10,8 +10,8 @@ test-actions:
     /* No action */
   checks:
   - brief: |
-      Check that the signal constant is equal to the signal number bit in the
-      signal set.
+      Check that the signal constant is equal to the integer representation of
+      the signal in the signal set.
     code: |
       T_step_eq_u32(
         ${step},
@@ -24,10 +24,43 @@ test-actions:
     - role: validation
       uid: ../req/signal-number
   links: []
+- action-brief: |
+    Validate the signal delivery.
+  action-code: |
+    rtems_status_code sc;
+
+    ctx->signal_set = 0;
+
+    sc = rtems_signal_catch( NULL, RTEMS_DEFAULT_MODES );
+    T_step_rsc_success( ${step}, sc );
+
+    sc = rtems_signal_catch( SignalHandler, RTEMS_NO_ASR );
+    T_step_rsc_success( ${step}, sc );
+
+    sc = rtems_signal_send( RTEMS_SELF, ctx->signal );
+    T_step_rsc_success( ${step}, sc );
+  checks:
+  - brief: |
+      Check that the caught signal set represents exactly the sent signal.
+    code: |
+      T_step_eq_u32(
+        ${step},
+        ctx->signal_set,
+        ctx->signal
+      );
+    links:
+    - role: validation
+      uid: ../req/signal-delivery
+  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: []
+  Tests a signal constant of the ${../if/group:/name} using the signal set of
+  the executing task.
+test-context:
+- brief: |
+    This member contains the caught signal set.
+  description: null
+  member: |
+    rtems_signal_set signal_set
 test-context-support: null
 test-description: null
 test-header:
@@ -54,7 +87,16 @@ test-local-includes:
 - tr-signal-constant.h
 test-setup: null
 test-stop: null
-test-support: null
+test-support: |
+  typedef ${.:/test-context-type} Context;
+
+  static void SignalHandler( rtems_signal_set signal_set )
+  {
+    Context *ctx;
+
+    ctx = T_fixture_context();
+    ctx->signal_set = signal_set;
+  }
 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
index 4dd4f62..56457e8 100644
--- a/spec/rtems/signal/val/signals.yml
+++ b/spec/rtems/signal/val/signals.yml
@@ -5,7 +5,7 @@ enabled-by: true
 links: []
 test-actions:
 - action-brief: |
-    Run the signal constant and number test for all 32 signal constants.
+    Run the signal test for all 32 signal constants.
   action-code: |
     unsigned int i;
 
@@ -14,8 +14,14 @@ test-actions:
       T_step( i ); /* ${steps/32} */
     }
   checks: []
-  links: []
-test-brief: Tests the Signal Manager API.
+  links:
+  - role: validation
+    uid: ../req/signal-count
+  - role: validation
+    uid: ../req/signal-set
+test-brief: |
+  This test case collection provides validation test cases for the
+  ${../if/group:/name}.
 test-context: []
 test-context-support: null
 test-description: null



More information about the vc mailing list