[rtems-central commit] spec: Specify SMP multitasking start error

Sebastian Huber sebh at rtems.org
Wed Mar 23 16:14:10 UTC 2022


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar 10 14:49:19 2022 +0100

spec: Specify SMP multitasking start error

---

 .../smp/if/fatal-start-on-not-online-processor.yml | 12 ++++
 .../req/fatal-start-on-not-online-processor.yml    | 18 ++++++
 .../fatal-start-of-mandatory-processor-failed.yml  |  2 +-
 .../val/fatal-start-on-not-online-processor.yml    | 74 ++++++++++++++++++++++
 .../fatal-start-on-not-online-processor.yml        | 28 ++++++++
 5 files changed, 133 insertions(+), 1 deletion(-)

diff --git a/spec/score/smp/if/fatal-start-on-not-online-processor.yml b/spec/score/smp/if/fatal-start-on-not-online-processor.yml
new file mode 100644
index 0000000..a27becb
--- /dev/null
+++ b/spec/score/smp/if/fatal-start-on-not-online-processor.yml
@@ -0,0 +1,12 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+index-entries: []
+interface-type: unspecified-define
+links:
+- role: interface-placement
+  uid: header-impl
+name: SMP_FATAL_START_ON_NOT_ONLINE_PROCESSOR
+references: []
+type: interface
diff --git a/spec/score/smp/req/fatal-start-on-not-online-processor.yml b/spec/score/smp/req/fatal-start-on-not-online-processor.yml
new file mode 100644
index 0000000..12966cb
--- /dev/null
+++ b/spec/score/smp/req/fatal-start-on-not-online-processor.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/fatal-error
+- role: requirement-refinement
+  uid: ../if/group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  If multitasking is started on a not online processor, then the system shall
+  terminate with the ${/score/interr/if/source-smp:/name} fatal source and the
+  ${../if/fatal-start-on-not-online-processor:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/val/fatal-start-of-mandatory-processor-failed.yml b/spec/score/smp/val/fatal-start-of-mandatory-processor-failed.yml
index 7d91dfd..c1782b2 100644
--- a/spec/score/smp/val/fatal-start-of-mandatory-processor-failed.yml
+++ b/spec/score/smp/val/fatal-start-of-mandatory-processor-failed.yml
@@ -6,7 +6,7 @@ links: []
 test-actions:
 - action-brief: |
     The test action is carried out by the application configuration of the test
-    suite.
+    suite and the wrapped _CPU_SMP_Start_processor().
   action-code: |
     /* Nothing to do */
   checks:
diff --git a/spec/score/smp/val/fatal-start-on-not-online-processor.yml b/spec/score/smp/val/fatal-start-on-not-online-processor.yml
new file mode 100644
index 0000000..9394706
--- /dev/null
+++ b/spec/score/smp/val/fatal-start-on-not-online-processor.yml
@@ -0,0 +1,74 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    The test action is carried out by the wrapped _CPU_SMP_Start_processor().
+  action-code: |
+    /* Nothing to do */
+  checks:
+  - brief: |
+      Check that the expected fatal source is present.
+    code: |
+      T_step_eq_int( ${step}, ctx->source, RTEMS_FATAL_SOURCE_SMP );
+    links:
+    - role: validation
+      uid: ../req/fatal-start-on-not-online-processor
+  - brief: |
+      Check that the expected fatal code is present.
+    code: |
+      T_step_eq_ulong(
+        ${step},
+        ctx->code,
+        SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR
+      );
+    links:
+    - role: validation
+      uid: ../req/fatal-start-on-not-online-processor
+  links:
+  - role: validation
+    uid: /acfg/req/scheduler-assign-processor-mandatory
+test-brief: |
+  Tests a fatal error.
+test-context: []
+test-context-support: null
+test-description: null
+test-header:
+  code: null
+  freestanding: true
+  includes:
+  - rtems.h
+  local-includes: []
+  run-params:
+  - description: |
+      is fatal source.
+    dir: null
+    name: source
+    specifier: ${/rtems/userext/if/fatal-source:/name} ${.:name}
+  - description: |
+      is fatal code.
+    dir: null
+    name: code
+    specifier: ${/rtems/userext/if/fatal-code:/name} ${.:name}
+  target: testsuites/validation/tr-fatal-start-on-not-online-processor.h
+test-includes:
+- rtems/score/smpimpl.h
+test-local-includes:
+- tr-fatal-start-on-not-online-processor.h
+test-setup: null
+test-stop: null
+test-support: |
+  bool __real__CPU_SMP_Start_processor( uint32_t cpu_index );
+
+  bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index );
+
+  bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index )
+  {
+    (void) __real__CPU_SMP_Start_processor( cpu_index );
+    return false;
+  }
+test-target: testsuites/validation/tr-fatal-start-on-not-online-processor.c
+test-teardown: null
+type: test-case
diff --git a/spec/testsuites/fatal-start-on-not-online-processor.yml b/spec/testsuites/fatal-start-on-not-online-processor.yml
new file mode 100644
index 0000000..87e5b5e
--- /dev/null
+++ b/spec/testsuites/fatal-start-on-not-online-processor.yml
@@ -0,0 +1,28 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+test-brief: |
+  This validation test suite contains a test case which triggers a fatal error
+  during system initialization.
+test-code: |
+  const char rtems_test_name[] = "${.:/test-suite-name}";
+
+  #define FATAL_SYSINIT_RUN ScoreSmpValFatalStartOnNotOnlineProcessor_Run
+
+  #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+  #define CONFIGURE_MAXIMUM_PROCESSORS 2
+
+  #include "ts-fatal-sysinit.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- tr-fatal-start-on-not-online-processor.h
+- ts-config.h
+test-suite-name: FatalStartOnNotOnlineProcessor
+test-target: testsuites/validation/ts-fatal-start-on-not-online-processor.c
+type: test-suite



More information about the vc mailing list