diff options
Diffstat (limited to 'spec/rtems/mode')
26 files changed, 723 insertions, 0 deletions
diff --git a/spec/rtems/mode/if/all-mode-masks.yml b/spec/rtems/mode/if/all-mode-masks.yml new file mode 100644 index 00000000..92a86105 --- /dev/null +++ b/spec/rtems/mode/if/all-mode-masks.yml @@ -0,0 +1,19 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: This mode constant is a mask with all mode bits set. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x0000ffff' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_ALL_MODE_MASKS +notes: null +type: interface diff --git a/spec/rtems/mode/if/asr-mask.yml b/spec/rtems/mode/if/asr-mask.yml new file mode 100644 index 00000000..690a4cb8 --- /dev/null +++ b/spec/rtems/mode/if/asr-mask.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant corresponds to the signal enable/disable bit. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000400' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_ASR_MASK +notes: null +type: interface diff --git a/spec/rtems/mode/if/asr.yml b/spec/rtems/mode/if/asr.yml new file mode 100644 index 00000000..54231e74 --- /dev/null +++ b/spec/rtems/mode/if/asr.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is used to indicate signal processing is enabled. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000000' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_ASR +notes: null +type: interface diff --git a/spec/rtems/mode/if/current-mode.yml b/spec/rtems/mode/if/current-mode.yml new file mode 100644 index 00000000..06767b5f --- /dev/null +++ b/spec/rtems/mode/if/current-mode.yml @@ -0,0 +1,21 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is used when the user wishes to obtain their current + execution mode. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_CURRENT_MODE +notes: null +type: interface diff --git a/spec/rtems/mode/if/default.yml b/spec/rtems/mode/if/default.yml new file mode 100644 index 00000000..a5d62d71 --- /dev/null +++ b/spec/rtems/mode/if/default.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is the default mode set. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000000' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_DEFAULT_MODES +notes: null +type: interface diff --git a/spec/rtems/mode/if/group.yml b/spec/rtems/mode/if/group.yml new file mode 100644 index 00000000..effb1397 --- /dev/null +++ b/spec/rtems/mode/if/group.yml @@ -0,0 +1,18 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This group contains the Classic API task modes. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +description: null +enabled-by: true +identifier: RTEMSAPIClassicModes +interface-type: group +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: ../../if/group +name: Task Modes +text: | + The Classic API shall provide an interface to task modes. +type: interface diff --git a/spec/rtems/mode/if/header.yml b/spec/rtems/mode/if/header.yml new file mode 100644 index 00000000..17d29647 --- /dev/null +++ b/spec/rtems/mode/if/header.yml @@ -0,0 +1,12 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: This header file defines the task modes of the Task Manager API. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +interface-type: header-file +links: +- role: interface-placement + uid: /if/domain +path: rtems/rtems/modes.h +prefix: cpukit/include +type: interface diff --git a/spec/rtems/mode/if/interrupt-level-body.yml b/spec/rtems/mode/if/interrupt-level-body.yml new file mode 100644 index 00000000..16608cc8 --- /dev/null +++ b/spec/rtems/mode/if/interrupt-level-body.yml @@ -0,0 +1,35 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + Returns a mode with the desired interrupt level in the proper bit-field + location. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: + body: null + params: + - ${/c/if/uint32_t:/name} ${.:/params[0]/name} + return: ${mode:/name} + variants: [] +description: null +enabled-by: true +interface-type: function +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: rtems_interrupt_level_body +notes: | + This function is used by bindings from languages other than C and C++. +params: +- description: is the desired interrupt level. + dir: null + name: level +return: + return: | + A mode with the desired interrupt level in the proper bit-field location is + returned. + return-values: [] +type: interface diff --git a/spec/rtems/mode/if/interrupt-level.yml b/spec/rtems/mode/if/interrupt-level.yml new file mode 100644 index 00000000..b4eb17e5 --- /dev/null +++ b/spec/rtems/mode/if/interrupt-level.yml @@ -0,0 +1,30 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + Returns the processor dependent interrupt level which corresponds to the + requested interrupt level. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: ( ( ${.:/params[0]/name} ) & ${interrupt-mask:/name} ) + variants: [] +description: null +enabled-by: true +interface-type: macro +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_INTERRUPT_LEVEL +notes: | + RTEMS supports 256 interrupt levels using the least significant eight bits of + the mode set. On any particular CPU, fewer than 256 levels may be supported. +params: +- description: is the mode set. + dir: null + name: _mode_set +return: + return: null + return-values: [] +type: interface diff --git a/spec/rtems/mode/if/interrupt-mask-variable.yml b/spec/rtems/mode/if/interrupt-mask-variable.yml new file mode 100644 index 00000000..6e185f6e --- /dev/null +++ b/spec/rtems/mode/if/interrupt-mask-variable.yml @@ -0,0 +1,19 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: '%' +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: const ${/c/if/uint32_t:/name} ${.:/name} + variants: [] +description: '%' +enabled-by: true +interface-type: variable +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: rtems_interrupt_mask +notes: null +type: interface diff --git a/spec/rtems/mode/if/interrupt-mask.yml b/spec/rtems/mode/if/interrupt-mask.yml new file mode 100644 index 00000000..8f343f11 --- /dev/null +++ b/spec/rtems/mode/if/interrupt-mask.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant corresponds to the interrupt enable/disable bits. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: ${/score/cpu/if/modes-interrupt-mask:/name} + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_INTERRUPT_MASK +notes: null +type: interface diff --git a/spec/rtems/mode/if/mode.yml b/spec/rtems/mode/if/mode.yml new file mode 100644 index 00000000..4ecfc56f --- /dev/null +++ b/spec/rtems/mode/if/mode.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This type defines the control block used to manage each a mode set. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: ${/c/if/uint32_t:/name} ${.:/name} + variants: [] +description: null +enabled-by: true +interface-type: typedef +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: rtems_mode +notes: null +type: interface diff --git a/spec/rtems/mode/if/no-asr.yml b/spec/rtems/mode/if/no-asr.yml new file mode 100644 index 00000000..c2278801 --- /dev/null +++ b/spec/rtems/mode/if/no-asr.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is used to indicate signal processing is disabled. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000400' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_NO_ASR +notes: null +type: interface diff --git a/spec/rtems/mode/if/no-preempt.yml b/spec/rtems/mode/if/no-preempt.yml new file mode 100644 index 00000000..f6183fe9 --- /dev/null +++ b/spec/rtems/mode/if/no-preempt.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is used to indicate preemption is disabled. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000100' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_NO_PREEMPT +notes: null +type: interface diff --git a/spec/rtems/mode/if/no-timeslice.yml b/spec/rtems/mode/if/no-timeslice.yml new file mode 100644 index 00000000..de7aec75 --- /dev/null +++ b/spec/rtems/mode/if/no-timeslice.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is used to indicate timeslicing is disabled. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000000' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_NO_TIMESLICE +notes: null +type: interface diff --git a/spec/rtems/mode/if/preempt-mask.yml b/spec/rtems/mode/if/preempt-mask.yml new file mode 100644 index 00000000..8020cb47 --- /dev/null +++ b/spec/rtems/mode/if/preempt-mask.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant corresponds to the preemption enable/disable bit. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000100' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_PREEMPT_MASK +notes: null +type: interface diff --git a/spec/rtems/mode/if/preempt.yml b/spec/rtems/mode/if/preempt.yml new file mode 100644 index 00000000..c513ffac --- /dev/null +++ b/spec/rtems/mode/if/preempt.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is used to indicate preemption is enabled. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000000' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_PREEMPT +notes: null +type: interface diff --git a/spec/rtems/mode/if/timeslice-mask.yml b/spec/rtems/mode/if/timeslice-mask.yml new file mode 100644 index 00000000..c1846c59 --- /dev/null +++ b/spec/rtems/mode/if/timeslice-mask.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant corresponds to the timeslice enable/disable bit. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000200' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_TIMESLICE_MASK +notes: null +type: interface diff --git a/spec/rtems/mode/if/timeslice.yml b/spec/rtems/mode/if/timeslice.yml new file mode 100644 index 00000000..1d2f98b6 --- /dev/null +++ b/spec/rtems/mode/if/timeslice.yml @@ -0,0 +1,20 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +brief: | + This mode constant is used to indicate timeslicing is enabled. +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +- Copyright (C) 2008 On-Line Applications Research Corporation (OAR) +definition: + default: '0x00000200' + variants: [] +description: null +enabled-by: true +interface-type: define +links: +- role: interface-placement + uid: header +- role: interface-ingroup + uid: group +name: RTEMS_TIMESLICE +notes: null +type: interface diff --git a/spec/rtems/mode/req/bit-set.yml b/spec/rtems/mode/req/bit-set.yml new file mode 100644 index 00000000..42c93a46 --- /dev/null +++ b/spec/rtems/mode/req/bit-set.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +non-functional-type: interface +rationale: null +references: [] +requirement-type: non-functional +text: | + Each non-default task mode constant shall be a power of two representable as + an integer of type ${../if/mode:/name}. +type: requirement diff --git a/spec/rtems/mode/req/default.yml b/spec/rtems/mode/req/default.yml new file mode 100644 index 00000000..8e1fbb49 --- /dev/null +++ b/spec/rtems/mode/req/default.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +non-functional-type: interface +rationale: null +references: [] +requirement-type: non-functional +text: | + Each default task mode constant shall have a value of zero. +type: requirement diff --git a/spec/rtems/mode/req/masks-all.yml b/spec/rtems/mode/req/masks-all.yml new file mode 100644 index 00000000..8adf26ed --- /dev/null +++ b/spec/rtems/mode/req/masks-all.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/all-mode-masks +non-functional-type: interface +rationale: null +references: [] +requirement-type: non-functional +text: | + The bitwise and of a task mode mask constant and + ${../if/all-mode-masks:/name} shall be equal to the task mode mask constant. +type: requirement diff --git a/spec/rtems/mode/req/masks-unique.yml b/spec/rtems/mode/req/masks-unique.yml new file mode 100644 index 00000000..61f8bdbc --- /dev/null +++ b/spec/rtems/mode/req/masks-unique.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +non-functional-type: interface +rationale: null +references: [] +requirement-type: non-functional +text: | + The task mode mask constants and 0xff shall have unique values. +type: requirement diff --git a/spec/rtems/mode/req/masks.yml b/spec/rtems/mode/req/masks.yml new file mode 100644 index 00000000..3c9d7dad --- /dev/null +++ b/spec/rtems/mode/req/masks.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +non-functional-type: interface +rationale: null +references: [] +requirement-type: non-functional +text: | + Each task mode mask constant except ${../if/interrupt-mask} shall be a power + of two representable as an integer of type ${../if/mode:/name}. +type: requirement diff --git a/spec/rtems/mode/req/unique.yml b/spec/rtems/mode/req/unique.yml new file mode 100644 index 00000000..d71177e0 --- /dev/null +++ b/spec/rtems/mode/req/unique.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +non-functional-type: interface +rationale: null +references: [] +requirement-type: non-functional +text: | + The non-default task mode constants shall have unique values. +type: requirement diff --git a/spec/rtems/mode/val/modes.yml b/spec/rtems/mode/val/modes.yml new file mode 100644 index 00000000..bcbb32a2 --- /dev/null +++ b/spec/rtems/mode/val/modes.yml @@ -0,0 +1,242 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: [] +test-actions: +- action: | + /* No action */ + checks: + - check: | + T_step_true( ${step}, IsPowerOfTwo( RTEMS_NO_ASR ) ); + description: | + Check that RTEMS_NO_ASR is a power of two representable as an integer of + type rtems_mode. + links: + - role: validation + uid: ../req/bit-set + - role: validation + uid: ../if/no-asr + - check: | + T_step_true( ${step}, IsPowerOfTwo( RTEMS_NO_PREEMPT ) ); + description: | + Check that RTEMS_NO_PREEMPT is a power of two representable as an integer + of type rtems_mode. + links: + - role: validation + uid: ../req/bit-set + - role: validation + uid: ../if/no-preempt + - check: | + T_step_true( ${step}, IsPowerOfTwo( RTEMS_TIMESLICE ) ); + description: | + Check that RTEMS_TIMESLICE is a power of two representable as an integer + of type rtems_mode. + links: + - role: validation + uid: ../req/bit-set + - role: validation + uid: ../if/timeslice + description: | + Validate the non-default task mode constants. + links: [] +- action: | + /* No action */ + checks: + - check: | + T_step_eq_u32( ${step}, RTEMS_ASR, 0 ); + description: | + Check that RTEMS_ASR is equal to zero. + links: + - role: validation + uid: ../req/default + - role: validation + uid: ../if/asr + - check: | + T_step_eq_u32( ${step}, RTEMS_DEFAULT_MODES, 0 ); + description: | + Check that RTEMS_DEFAULT_MODES is equal to zero. + links: + - role: validation + uid: ../req/default + - role: validation + uid: ../if/default + - check: | + T_step_eq_u32( ${step}, RTEMS_NO_TIMESLICE, 0 ); + description: | + Check that RTEMS_NO_TIMESLICE is equal to zero. + links: + - role: validation + uid: ../req/default + - role: validation + uid: ../if/no-timeslice + - check: | + T_step_eq_u32( ${step}, RTEMS_PREEMPT, 0 ); + description: | + Check that RTEMS_PREEMPT is equal to zero. + links: + - role: validation + uid: ../req/default + - role: validation + uid: ../if/preempt + description: | + Validate the default task mode constants. + links: [] +- action: | + /* No action */ + checks: + - check: | + T_step_eq_u32( + ${step}, + RTEMS_ASR_MASK & RTEMS_ALL_MODE_MASKS, + RTEMS_ASR_MASK + ); + description: | + Check that the bitwise and of RTEMS_ASR_MASK and RTEMS_ALL_MODE_MASKS is + equal to RTEMS_ASR_MASK. + links: + - role: validation + uid: ../req/masks-all + - role: validation + uid: ../if/asr-mask + - check: | + T_step_eq_u32( + ${step}, + RTEMS_PREEMPT_MASK & RTEMS_ALL_MODE_MASKS, + RTEMS_PREEMPT_MASK + ); + description: | + Check that the bitwise and of RTEMS_PREEMPT_MASK and RTEMS_ALL_MODE_MASKS + is equal to RTEMS_PREEMPT_MASK. + links: + - role: validation + uid: ../req/masks-all + - role: validation + uid: ../if/preempt-mask + - check: | + T_step_eq_u32( + ${step}, + RTEMS_TIMESLICE_MASK & RTEMS_ALL_MODE_MASKS, + RTEMS_TIMESLICE_MASK + ); + description: | + Check that the bitwise and of RTEMS_TIMESLICE_MASK and + RTEMS_ALL_MODE_MASKS is equal to RTEMS_TIMESLICE_MASK. + links: + - role: validation + uid: ../req/masks-all + - role: validation + uid: ../if/timeslice-mask + - check: | + T_step_eq_u32( + ${step}, + RTEMS_INTERRUPT_MASK & RTEMS_ALL_MODE_MASKS, + RTEMS_INTERRUPT_MASK + ); + description: | + Check that the bitwise and of RTEMS_INTERRUPT_MASK and + RTEMS_ALL_MODE_MASKS is equal to RTEMS_INTERRUPT_MASK. + links: + - role: validation + uid: ../req/masks-all + - role: validation + uid: ../if/interrupt-mask + description: | + Validate RTEMS_ALL_MODE_MASKS. + links: [] +- action: | + /* No action */ + checks: + - check: | + T_step_true( ${step}, IsPowerOfTwo( RTEMS_ASR_MASK ) ); + description: | + Check that RTEMS_ASR_MASK is a power of two representable as an integer + of type rtems_mode. + links: + - role: validation + uid: ../req/masks + - role: validation + uid: ../if/asr-mask + - check: | + T_step_true( ${step}, IsPowerOfTwo( RTEMS_PREEMPT_MASK ) ); + description: | + Check that RTEMS_PREEMPT_MASK is a power of two representable as an + integer of type rtems_mode. + links: + - role: validation + uid: ../req/masks + - role: validation + uid: ../if/preempt-mask + - check: | + T_step_true( ${step}, IsPowerOfTwo( RTEMS_TIMESLICE_MASK ) ); + description: | + Check that RTEMS_TIMESLICE_MASK is a power of two representable as an + integer of type rtems_mode. + links: + - role: validation + uid: ../req/masks + - role: validation + uid: ../if/timeslice-mask + description: | + Validate the task mode mask constants except RTEMS_INTERRUPT_MASK. + links: [] +- action: | + modes = 0; + modes |= 0xff; + modes |= RTEMS_ASR_MASK; + modes |= RTEMS_PREEMPT_MASK; + modes |= RTEMS_TIMESLICE_MASK; + checks: + - check: | + T_step_eq_int( ${step}, PopCount( modes ), 11 ); + description: | + Check that the count of set bits in the calculated value is equal to the + count of task mode mask constants except RTEMS_INTERRUPT_MASK plus eight. + Since each task mode mask constants except RTEMS_INTERRUPT_MASK is a + power of two and the bitwise and of 0xff and RTEMS_INTERRUPT_MASK is + equal to RTEMS_INTERRUPT_MASK this proves that each constant and 0xff has + a unique value. + links: + - role: validation + uid: ../req/unique + - role: validation + uid: ../if/asr-mask + - role: validation + uid: ../if/preempt-mask + - role: validation + uid: ../if/timeslice-mask + description: | + Calculate the bitwise or of all task mode mask constants and 0xff. + links: [] +test-brief: | + Tests the task mode constants and function-like macros of the Classic API. +test-description: null +test-epilogue: null +test-fixture: null +test-header: null +test-includes: +- rtems.h +test-local-includes: [] +test-prologue: | + rtems_mode modes; +test-support: | + static bool IsPowerOfTwo( rtems_mode mode ) + { + return mode != 0 && ( mode & ( mode - 1 ) ) == 0; + } + + static int PopCount( rtems_mode modes ) + { + int count; + + count = 0; + + while ( modes != 0 ) { + ++count; + modes &= modes - 1; + } + + return count; + } +test-target: testsuites/validation/tc-modes.c +type: test-case |