summaryrefslogtreecommitdiffstats
path: root/spec/rtems/option
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rtems/option')
-rw-r--r--spec/rtems/option/if/default.yml20
-rw-r--r--spec/rtems/option/if/event-all.yml21
-rw-r--r--spec/rtems/option/if/event-any.yml21
-rw-r--r--spec/rtems/option/if/group.yml18
-rw-r--r--spec/rtems/option/if/header.yml12
-rw-r--r--spec/rtems/option/if/no-wait.yml22
-rw-r--r--spec/rtems/option/if/option.yml20
-rw-r--r--spec/rtems/option/if/wait.yml20
-rw-r--r--spec/rtems/option/req/bit-set.yml15
-rw-r--r--spec/rtems/option/req/default.yml14
-rw-r--r--spec/rtems/option/req/unique.yml14
-rw-r--r--spec/rtems/option/val/options.yml117
12 files changed, 314 insertions, 0 deletions
diff --git a/spec/rtems/option/if/default.yml b/spec/rtems/option/if/default.yml
new file mode 100644
index 00000000..4b93d4c9
--- /dev/null
+++ b/spec/rtems/option/if/default.yml
@@ -0,0 +1,20 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: |
+ This option constant is the default option 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_OPTIONS
+notes: null
+type: interface
diff --git a/spec/rtems/option/if/event-all.yml b/spec/rtems/option/if/event-all.yml
new file mode 100644
index 00000000..da4a727f
--- /dev/null
+++ b/spec/rtems/option/if/event-all.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: |
+ This option constant indicates that the task wishes to wait until all events
+ of interest are available.
+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_EVENT_ALL
+notes: null
+type: interface
diff --git a/spec/rtems/option/if/event-any.yml b/spec/rtems/option/if/event-any.yml
new file mode 100644
index 00000000..6562f06c
--- /dev/null
+++ b/spec/rtems/option/if/event-any.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: |
+ This option constant indicates that the task wishes to wait until any events
+ of interest are available.
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+- Copyright (C) 2008 On-Line Applications Research Corporation (OAR)
+definition:
+ default: '0x00000002'
+ variants: []
+description: null
+enabled-by: true
+interface-type: define
+links:
+- role: interface-placement
+ uid: header
+- role: interface-ingroup
+ uid: group
+name: RTEMS_EVENT_ANY
+notes: null
+type: interface
diff --git a/spec/rtems/option/if/group.yml b/spec/rtems/option/if/group.yml
new file mode 100644
index 00000000..be8a7c4e
--- /dev/null
+++ b/spec/rtems/option/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 directive options.
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+description: null
+enabled-by: true
+identifier: RTEMSAPIClassicOptions
+interface-type: group
+links:
+- role: interface-placement
+ uid: header
+- role: interface-ingroup
+ uid: ../../if/group
+name: Directive Options
+text: |
+ The Classic API shall provide an interface to directive options.
+type: interface
diff --git a/spec/rtems/option/if/header.yml b/spec/rtems/option/if/header.yml
new file mode 100644
index 00000000..ee4d2342
--- /dev/null
+++ b/spec/rtems/option/if/header.yml
@@ -0,0 +1,12 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: This header file defines options provided by the 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/options.h
+prefix: cpukit/include
+type: interface
diff --git a/spec/rtems/option/if/no-wait.yml b/spec/rtems/option/if/no-wait.yml
new file mode 100644
index 00000000..504128c5
--- /dev/null
+++ b/spec/rtems/option/if/no-wait.yml
@@ -0,0 +1,22 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: |
+ This option constant indicates that the task is to not wait on the resource.
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+- Copyright (C) 2008 On-Line Applications Research Corporation (OAR)
+definition:
+ default: '0x00000001'
+ variants: []
+description: |
+ If the resource is not available, then directives shall return immediately
+ with a status to indicate unsatisfied.
+enabled-by: true
+interface-type: define
+links:
+- role: interface-placement
+ uid: header
+- role: interface-ingroup
+ uid: group
+name: RTEMS_NO_WAIT
+notes: null
+type: interface
diff --git a/spec/rtems/option/if/option.yml b/spec/rtems/option/if/option.yml
new file mode 100644
index 00000000..a15781ed
--- /dev/null
+++ b/spec/rtems/option/if/option.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 option sets.
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+- Copyright (C) 1989, 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_option
+notes: null
+type: interface
diff --git a/spec/rtems/option/if/wait.yml b/spec/rtems/option/if/wait.yml
new file mode 100644
index 00000000..940d117f
--- /dev/null
+++ b/spec/rtems/option/if/wait.yml
@@ -0,0 +1,20 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: |
+ This option constant indicates that the task is to wait on resource.
+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_WAIT
+notes: null
+type: interface
diff --git a/spec/rtems/option/req/bit-set.yml b/spec/rtems/option/req/bit-set.yml
new file mode 100644
index 00000000..2b7b8733
--- /dev/null
+++ b/spec/rtems/option/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 directive option constant shall be a power of two
+ representable as an integer of type ${../if/option}.
+type: requirement
diff --git a/spec/rtems/option/req/default.yml b/spec/rtems/option/req/default.yml
new file mode 100644
index 00000000..019b775a
--- /dev/null
+++ b/spec/rtems/option/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 directive option constant shall have a value of zero.
+type: requirement
diff --git a/spec/rtems/option/req/unique.yml b/spec/rtems/option/req/unique.yml
new file mode 100644
index 00000000..ffaafc14
--- /dev/null
+++ b/spec/rtems/option/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 directive option constants shall have unique values.
+type: requirement
diff --git a/spec/rtems/option/val/options.yml b/spec/rtems/option/val/options.yml
new file mode 100644
index 00000000..7efa7885
--- /dev/null
+++ b/spec/rtems/option/val/options.yml
@@ -0,0 +1,117 @@
+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_EVENT_ANY ) );
+ description: |
+ Check that RTEMS_EVENT_ANY is a power of two.
+ links:
+ - role: validation
+ uid: ../req/bit-set
+ - role: validation
+ uid: ../if/event-any
+ - check: |
+ T_step_true( ${step}, IsPowerOfTwo( RTEMS_NO_WAIT ) );
+ description: |
+ Check that RTEMS_NO_WAIT is a power of two.
+ links:
+ - role: validation
+ uid: ../req/bit-set
+ - role: validation
+ uid: ../if/no-wait
+ description: |
+ Validate the non-default option constants.
+ links: []
+- action: |
+ /* No action */
+ checks:
+ - check: |
+ T_step_eq_u32( ${step}, RTEMS_DEFAULT_OPTIONS, 0 );
+ description: |
+ Check that RTEMS_DEFAULT_OPTIONS is equal to zero.
+ links:
+ - role: validation
+ uid: ../req/default
+ - role: validation
+ uid: ../if/default
+ - check: |
+ T_step_eq_u32( ${step}, RTEMS_EVENT_ALL, 0 );
+ description: |
+ Check that RTEMS_EVENT_ALL is equal to zero.
+ links:
+ - role: validation
+ uid: ../req/default
+ - role: validation
+ uid: ../if/event-all
+ - check: |
+ T_step_eq_u32( ${step}, RTEMS_WAIT, 0 );
+ description: |
+ Check that RTEMS_WAIT is equal to zero.
+ links:
+ - role: validation
+ uid: ../req/default
+ - role: validation
+ uid: ../if/wait
+ description: |
+ Validate the default option constants.
+ links: []
+- action: |
+ options = 0;
+ options |= RTEMS_EVENT_ANY;
+ options |= RTEMS_NO_WAIT;
+ checks:
+ - check: |
+ T_step_eq_int( ${step}, PopCount( options ), 2 );
+ description: |
+ Check that the count of set bits in the calculated value is equal to the
+ count of non-default option constants. Since each non-default option
+ constant is a power of two, this proves that each constant has a unique
+ value.
+ links:
+ - role: validation
+ uid: ../req/unique
+ - role: validation
+ uid: ../if/event-any
+ - role: validation
+ uid: ../if/no-wait
+ description: |
+ Calculate the bitwise or of all non-default option constants.
+ links: []
+test-brief: |
+ Tests the option constants 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_option options;
+test-support: |
+ static bool IsPowerOfTwo( rtems_option option )
+ {
+ return option != 0 && ( option & ( option - 1 ) ) == 0;
+ }
+
+ static int PopCount( rtems_option options )
+ {
+ int count;
+
+ count = 0;
+
+ while ( options != 0 ) {
+ ++count;
+ options &= options - 1;
+ }
+
+ return count;
+ }
+test-target: testsuites/validation/tc-options.c
+type: test-case