[rtems-central commit] spec: Clarify event numbers

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


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

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

spec: Clarify event numbers

---

 spec/rtems/event/req/event-constant.yml |  5 +++--
 spec/rtems/event/req/event-number.yml   | 15 +++++++++++++++
 spec/rtems/event/val/event-constant.yml |  2 ++
 spec/rtems/event/val/events.yml         |  6 +++---
 4 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/spec/rtems/event/req/event-constant.yml b/spec/rtems/event/req/event-constant.yml
index 9f0ec8e..f030e95 100644
--- a/spec/rtems/event/req/event-constant.yml
+++ b/spec/rtems/event/req/event-constant.yml
@@ -72,6 +72,7 @@ rationale: null
 references: []
 requirement-type: functional
 text: |
-  The ``i``-the event constant shall be a constant expression which evaluates
-  to a value of two to the power of ``i``.
+  Let :math:`J\in{0, 1, ..., 31}`.  The :math:`J`-th event number constant
+  shall be a constant expression which evaluates to the integer representation
+  of event number :math:`J`.
 type: requirement
diff --git a/spec/rtems/event/req/event-number.yml b/spec/rtems/event/req/event-number.yml
new file mode 100644
index 0000000..b9c5fb7
--- /dev/null
+++ b/spec/rtems/event/req/event-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 event number :math:`J` shall be
+  represented by the integer :math:`2^J`.
+type: requirement
diff --git a/spec/rtems/event/val/event-constant.yml b/spec/rtems/event/val/event-constant.yml
index 6d9e863..1a60164 100644
--- a/spec/rtems/event/val/event-constant.yml
+++ b/spec/rtems/event/val/event-constant.yml
@@ -21,6 +21,8 @@ test-actions:
     links:
     - role: validation
       uid: ../req/event-constant
+    - role: validation
+      uid: ../req/event-number
   - brief: |
       Check that the event number bit of the event constant is not set in
       RTEMS_PENDING_EVENTS.
diff --git a/spec/rtems/event/val/events.yml b/spec/rtems/event/val/events.yml
index f00276a..f3bb1e3 100644
--- a/spec/rtems/event/val/events.yml
+++ b/spec/rtems/event/val/events.yml
@@ -7,11 +7,11 @@ test-actions:
 - action-brief: |
     Run the event constant and number test for all 32 event constants.
   action-code: |
-    int i;
+    unsigned int i;
 
     for ( i = 0; i < 32; ++i ) {
       ${event-constant:/test-run}( events[ i ], i );
-      T_step( (unsigned int) i ); /* ${steps/32} */
+      T_step( i ); /* ${steps/32} */
     }
   checks: []
   links: []
@@ -105,7 +105,7 @@ test-support: |
     RTEMS_EVENT_28,
     RTEMS_EVENT_29,
     RTEMS_EVENT_30,
-    RTEMS_EVENT_31,
+    RTEMS_EVENT_31
   };
 test-target: testsuites/validation/tc-events.c
 test-teardown: null



More information about the vc mailing list