[rtems-central commit] spec: Specify RTEMS_NO_PRIORITY

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


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov 18 08:40:43 2021 +0100

spec: Specify RTEMS_NO_PRIORITY

---

 spec/rtems/task/req/no-priority.yml | 20 ++++++++++++++++++++
 spec/rtems/task/val/task.yml        | 12 ++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/spec/rtems/task/req/no-priority.yml b/spec/rtems/task/req/no-priority.yml
new file mode 100644
index 0000000..8632f4e
--- /dev/null
+++ b/spec/rtems/task/req/no-priority.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: true
+links:
+- role: interface-function
+  uid: ../if/no-priority
+functional-type: function
+rationale: |
+  Some directives with a task priority parameter ignore the priority value
+  under specific circumstances, for example ${../if/set-priority:/name} may be
+  used to get the current priority.  This constant may be used as a dummy task
+  priority value to document that the priority parameter is unused.
+references: []
+requirement-type: functional
+text: |
+  The ${../if/no-priority} constant shall expand to a constant
+  expression which evaluates to the value of
+  ${../if/current-priority:/name}.
+type: requirement
diff --git a/spec/rtems/task/val/task.yml b/spec/rtems/task/val/task.yml
index aa29cfe..5d36dbc 100644
--- a/spec/rtems/task/val/task.yml
+++ b/spec/rtems/task/val/task.yml
@@ -102,6 +102,18 @@ test-actions:
   - role: validation
     uid: ../req/storage-alignment
 - action-brief: |
+    Assert that ${../if/no-priority:/name} is a constant expression which
+    evaluates to the expected value.
+  action-code: |
+    RTEMS_STATIC_ASSERT(
+      RTEMS_NO_PRIORITY == RTEMS_CURRENT_PRIORITY,
+      NO_PRIORITY
+    );
+  checks: []
+  links:
+  - role: validation
+    uid: ../req/no-priority
+- action-brief: |
     Validate ${../if/self-define:/name} using a sample directive call.
   action-code: |
     rtems_status_code sc;



More information about the vc mailing list