[rtems-central commit] spec: Specify scheduler language bindings

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


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Nov 17 20:42:27 2021 +0100

spec: Specify scheduler language bindings

---

 .../req/get-processor-maximum-non-smp.yml          |  6 +-
 .../req/get-processor-maximum-smp-only.yml         | 10 +--
 spec/rtems/scheduler/req/get-processor-maximum.yml | 16 +++++
 spec/rtems/scheduler/req/get-processor-non-smp.yml |  6 +-
 .../rtems/scheduler/req/get-processor-smp-only.yml |  8 +--
 spec/rtems/scheduler/req/get-processor.yml         | 16 +++++
 spec/rtems/scheduler/val/scheduler.yml             | 82 ++++++++++++++++++++++
 7 files changed, 129 insertions(+), 15 deletions(-)

diff --git a/spec/rtems/scheduler/req/get-processor-maximum-non-smp.yml b/spec/rtems/scheduler/req/get-processor-maximum-non-smp.yml
index 1b8057d..d437dcf 100644
--- a/spec/rtems/scheduler/req/get-processor-maximum-non-smp.yml
+++ b/spec/rtems/scheduler/req/get-processor-maximum-non-smp.yml
@@ -5,12 +5,12 @@ enabled-by:
   not: RTEMS_SMP
 links:
 - role: interface-function
-  uid: ../if/get-processor-maximum
+  uid: ../if/get-processor-maximum-macro
 functional-type: function
 rationale: null
 references: []
 requirement-type: functional
 text: |
-  The ${../if/get-processor-maximum:/name} directive call shall be a constant
-  expression which evaluates to one.
+  The ${../if/get-processor-maximum-macro:/name} directive call shall evaluate
+  to a constant expression which is equal to one.
 type: requirement
diff --git a/spec/rtems/scheduler/req/get-processor-maximum-smp-only.yml b/spec/rtems/scheduler/req/get-processor-maximum-smp-only.yml
index 3db68ef..5664816 100644
--- a/spec/rtems/scheduler/req/get-processor-maximum-smp-only.yml
+++ b/spec/rtems/scheduler/req/get-processor-maximum-smp-only.yml
@@ -4,14 +4,14 @@ copyrights:
 enabled-by: RTEMS_SMP
 links:
 - role: interface-function
-  uid: ../if/get-processor-maximum
+  uid: ../if/get-processor-maximum-macro
 functional-type: function
 rationale: null
 references: []
 requirement-type: functional
 text: |
-  The return value of the ${../if/get-processor-maximum:/name} directive shall
-  be the minimum of the processors available at the ${/glossary/target:/term}
-  and the ${/acfg/if/max-processors:/name} application configuration option
-  value.
+  The return value of the ${../if/get-processor-maximum-macro:/name} directive
+  shall be the minimum of the processors available at the
+  ${/glossary/target:/term} and the ${/acfg/if/max-processors:/name}
+  application configuration option value.
 type: requirement
diff --git a/spec/rtems/scheduler/req/get-processor-maximum.yml b/spec/rtems/scheduler/req/get-processor-maximum.yml
new file mode 100644
index 0000000..0f6d7e6
--- /dev/null
+++ b/spec/rtems/scheduler/req/get-processor-maximum.yml
@@ -0,0 +1,16 @@
+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/get-processor-maximum
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/get-processor-maximum:/name} directive is called, the
+  directive shall return the return value of a call to
+  ${../if/get-processor-maximum-macro:/name}.
+type: requirement
diff --git a/spec/rtems/scheduler/req/get-processor-non-smp.yml b/spec/rtems/scheduler/req/get-processor-non-smp.yml
index 4e9dd03..4f7650b 100644
--- a/spec/rtems/scheduler/req/get-processor-non-smp.yml
+++ b/spec/rtems/scheduler/req/get-processor-non-smp.yml
@@ -5,12 +5,12 @@ enabled-by:
   not: RTEMS_SMP
 links:
 - role: interface-function
-  uid: ../if/get-processor
+  uid: ../if/get-processor-macro
 functional-type: function
 rationale: null
 references: []
 requirement-type: functional
 text: |
-  The ${../if/get-processor:/name} directive call shall be a constant
-  expression which evaluates to zero.
+  The ${../if/get-processor-macro:/name} directive call shall evaluate
+  to a constant expression which is equal to zero.
 type: requirement
diff --git a/spec/rtems/scheduler/req/get-processor-smp-only.yml b/spec/rtems/scheduler/req/get-processor-smp-only.yml
index 0fc3030..db9ae16 100644
--- a/spec/rtems/scheduler/req/get-processor-smp-only.yml
+++ b/spec/rtems/scheduler/req/get-processor-smp-only.yml
@@ -4,13 +4,13 @@ copyrights:
 enabled-by: RTEMS_SMP
 links:
 - role: interface-function
-  uid: ../if/get-processor
+  uid: ../if/get-processor-macro
 functional-type: function
 rationale: null
 references: []
 requirement-type: functional
 text: |
-  The return value of the ${../if/get-processor:/name} directive shall be the
-  index of a processor which executed at least one instruction of the directive
-  call.
+  The return value of the ${../if/get-processor-macro:/name} directive shall be
+  the index of a processor which executed at least one instruction of the
+  directive call.
 type: requirement
diff --git a/spec/rtems/scheduler/req/get-processor.yml b/spec/rtems/scheduler/req/get-processor.yml
new file mode 100644
index 0000000..c5748fc
--- /dev/null
+++ b/spec/rtems/scheduler/req/get-processor.yml
@@ -0,0 +1,16 @@
+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/get-processor
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  When the ${../if/get-processor:/name} directive is called, the directive
+  shall return the return value of a call to
+  ${../if/get-processor-macro:/name}.
+type: requirement
diff --git a/spec/rtems/scheduler/val/scheduler.yml b/spec/rtems/scheduler/val/scheduler.yml
new file mode 100644
index 0000000..4e05c64
--- /dev/null
+++ b/spec/rtems/scheduler/val/scheduler.yml
@@ -0,0 +1,82 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links: []
+test-actions:
+- action-brief: |
+    Validate ${../if/get-processor:/name}.
+  action-code: |
+    uint32_t cpu_index;
+    uint32_t cpu_index_macro;
+
+    cpu_index = GetProcessor();
+    cpu_index_macro = GetProcessorMacro();
+  checks:
+  - brief: |
+      Check that the values returned by ${../if/get-processor:/name}
+      and ${../if/get-processor-macro:/name} are equal.
+    code: |
+      T_step_eq_u32( ${step}, cpu_index, cpu_index_macro );
+    links:
+    - role: validation
+      uid: ../req/get-processor
+  links: []
+- action-brief: |
+    Validate ${../if/get-processor-maximum:/name}.
+  action-code: |
+    uint32_t cpu_max;
+    uint32_t cpu_max_macro;
+
+    cpu_max = GetProcessorMaximum();
+    cpu_max_macro = GetProcessorMaximumMacro();
+  checks:
+  - brief: |
+      Check that the values returned by ${../if/get-processor-maximum:/name}
+      and ${../if/get-processor-maximum-macro:/name} are equal.
+    code: |
+      T_step_eq_u32( ${step}, cpu_max, cpu_max_macro );
+    links:
+    - role: validation
+      uid: ../req/get-processor-maximum
+  links: []
+test-brief: |
+  This test case collection provides validation test cases for
+  general requirements of the ${../if/group:/name}.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes:
+- tx-support.h
+test-setup: null
+test-stop: null
+test-support: |
+  static uint32_t GetProcessorMaximumMacro( void )
+  {
+    return rtems_scheduler_get_processor_maximum();
+  }
+
+  #undef rtems_scheduler_get_processor_maximum
+
+  static uint32_t GetProcessorMaximum( void )
+  {
+    return rtems_scheduler_get_processor_maximum();
+  }
+
+  static uint32_t GetProcessorMacro( void )
+  {
+    return rtems_scheduler_get_processor();
+  }
+
+  #undef rtems_scheduler_get_processor
+
+  static uint32_t GetProcessor( void )
+  {
+    return rtems_scheduler_get_processor();
+  }
+test-target: testsuites/validation/tc-scheduler.c
+test-teardown: null
+type: test-case



More information about the vc mailing list