summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-18 20:47:23 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-19 08:22:34 +0100
commit8fd32fd7f4f4a6168978b211e922bbca9817ce51 (patch)
tree77ac6900d00ceed239912ab795842d62916254cc
parentspec: Remove clocks requirement (diff)
downloadrtems-central-8fd32fd7f4f4a6168978b211e922bbca9817ce51.tar.bz2
spec: Improve task modes specification
-rw-r--r--spec/rtems/mode/req/interrupt-level.yml17
-rw-r--r--spec/rtems/mode/val/modes.yml46
2 files changed, 62 insertions, 1 deletions
diff --git a/spec/rtems/mode/req/interrupt-level.yml b/spec/rtems/mode/req/interrupt-level.yml
new file mode 100644
index 00000000..1d0de576
--- /dev/null
+++ b/spec/rtems/mode/req/interrupt-level.yml
@@ -0,0 +1,17 @@
+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/interrupt-level
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+ When the ${../if/interrupt-level} macro is used, it shall expand to a
+ constant expression which computes the bitwise and of the value specified by
+ the ${../if/interrupt-level:/params[0]/name} parameter and
+ ${../if/interrupt-mask:/name}.
+type: requirement
diff --git a/spec/rtems/mode/val/modes.yml b/spec/rtems/mode/val/modes.yml
index b1bdb621..90842e11 100644
--- a/spec/rtems/mode/val/modes.yml
+++ b/spec/rtems/mode/val/modes.yml
@@ -202,7 +202,7 @@ test-actions:
T_step_eq_int( ${step}, PopCount( modes ), 11 );
links:
- role: validation
- uid: ../req/unique
+ uid: ../req/masks-unique
- role: validation
uid: ../if/asr-mask
- role: validation
@@ -210,6 +210,50 @@ test-actions:
- role: validation
uid: ../if/timeslice-mask
links: []
+- action-brief: |
+ Calculate the bitwise or of all non-default task mode constants.
+ action-code: |
+ rtems_mode modes;
+
+ modes = 0;
+ modes |= RTEMS_NO_ASR;
+ modes |= RTEMS_NO_PREEMPT;
+ modes |= RTEMS_TIMESLICE;
+ checks:
+ - brief: |
+ Check that the count of set bits in the calculated value is equal to the
+ count of non-default task mode constants. Since each non-default task
+ mode constants except is a power of this proves that each constant has a
+ unique value.
+ code: |
+ T_step_eq_int( ${step}, PopCount( modes ), 3 );
+ links:
+ - role: validation
+ uid: ../req/unique
+ - role: validation
+ uid: ../if/no-asr
+ - role: validation
+ uid: ../if/no-preempt
+ - role: validation
+ uid: ../if/timeslice
+ links: []
+- action-brief: |
+ Validate ${../if/interrupt-level:/name}.
+ action-code: |
+ /* Nothing to do */
+ checks:
+ - brief: |
+ Check the result of ${../if/interrupt-level:/name} for a sample value.
+ code: |
+ T_step_eq_u32(
+ ${step},
+ RTEMS_INTERRUPT_LEVEL( UINT32_MAX ),
+ RTEMS_INTERRUPT_MASK
+ );
+ links:
+ - role: validation
+ uid: ../req/interrupt-level
+ links: []
test-brief: |
Tests the task mode constants and function-like macros of the Classic API.
test-context: []