[rtems-central commit] spec: Specify some SMP fatal errors

Sebastian Huber sebh at rtems.org
Tue Aug 3 16:08:10 UTC 2021


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Aug  3 12:43:51 2021 +0200

spec: Specify some SMP fatal errors

---

 ...al-boot-processor-not-assigned-to-scheduler.yml |  12 ++
 .../if/fatal-mandatory-processor-not-present.yml   |  12 ++
 ...tal-multitasking-start-on-invalid-processor.yml |  12 ++
 ...-multitasking-start-on-unassigned-processor.yml |  12 ++
 .../fatal-start-of-mandatory-processor-failed.yml  |  12 ++
 .../if/fatal-wrong-cpu-state-to-perform-jobs.yml   |  12 ++
 spec/score/smp/if/group.yml                        |  16 ++
 ...al-boot-processor-not-assigned-to-scheduler.yml |  19 ++
 .../req/fatal-mandatory-processor-not-present.yml  |  19 ++
 ...tal-multitasking-start-on-invalid-processor.yml |  20 ++
 ...-multitasking-start-on-unassigned-processor.yml |  20 ++
 spec/score/smp/req/fatal-shutdown-response.yml     |  18 ++
 .../fatal-start-of-mandatory-processor-failed.yml  |  19 ++
 .../req/fatal-wrong-cpu-state-to-perform-jobs.yml  |  19 ++
 ...al-boot-processor-not-assigned-to-scheduler.yml |  64 +++++++
 .../val/fatal-mandatory-processor-not-present.yml  |  64 +++++++
 .../fatal-start-of-mandatory-processor-failed.yml  |  71 +++++++
 spec/score/smp/val/fatal.yml                       | 207 +++++++++++++++++++++
 ...al-boot-processor-not-assigned-to-scheduler.yml |  46 +++++
 .../fatal-mandatory-processor-not-present.yml      |  75 ++++++++
 spec/testsuites/fatal-smp.yml                      |  44 +++++
 .../fatal-start-of-mandatory-processor-failed.yml  |  45 +++++
 22 files changed, 838 insertions(+)

diff --git a/spec/score/smp/if/fatal-boot-processor-not-assigned-to-scheduler.yml b/spec/score/smp/if/fatal-boot-processor-not-assigned-to-scheduler.yml
new file mode 100644
index 0000000..e5b2cf5
--- /dev/null
+++ b/spec/score/smp/if/fatal-boot-processor-not-assigned-to-scheduler.yml
@@ -0,0 +1,12 @@
+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
+index-entries: []
+interface-type: unspecified-define
+links:
+- role: interface-placement
+  uid: header-impl
+name: SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER
+references: {}
+type: interface
diff --git a/spec/score/smp/if/fatal-mandatory-processor-not-present.yml b/spec/score/smp/if/fatal-mandatory-processor-not-present.yml
new file mode 100644
index 0000000..7010c5a
--- /dev/null
+++ b/spec/score/smp/if/fatal-mandatory-processor-not-present.yml
@@ -0,0 +1,12 @@
+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
+index-entries: []
+interface-type: unspecified-define
+links:
+- role: interface-placement
+  uid: header-impl
+name: SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT
+references: {}
+type: interface
diff --git a/spec/score/smp/if/fatal-multitasking-start-on-invalid-processor.yml b/spec/score/smp/if/fatal-multitasking-start-on-invalid-processor.yml
new file mode 100644
index 0000000..c998fa5
--- /dev/null
+++ b/spec/score/smp/if/fatal-multitasking-start-on-invalid-processor.yml
@@ -0,0 +1,12 @@
+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
+index-entries: []
+interface-type: unspecified-define
+links:
+- role: interface-placement
+  uid: header-impl
+name: SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR
+references: {}
+type: interface
diff --git a/spec/score/smp/if/fatal-multitasking-start-on-unassigned-processor.yml b/spec/score/smp/if/fatal-multitasking-start-on-unassigned-processor.yml
new file mode 100644
index 0000000..9c57b18
--- /dev/null
+++ b/spec/score/smp/if/fatal-multitasking-start-on-unassigned-processor.yml
@@ -0,0 +1,12 @@
+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
+index-entries: []
+interface-type: unspecified-define
+links:
+- role: interface-placement
+  uid: header-impl
+name: SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR
+references: {}
+type: interface
diff --git a/spec/score/smp/if/fatal-start-of-mandatory-processor-failed.yml b/spec/score/smp/if/fatal-start-of-mandatory-processor-failed.yml
new file mode 100644
index 0000000..c5140c1
--- /dev/null
+++ b/spec/score/smp/if/fatal-start-of-mandatory-processor-failed.yml
@@ -0,0 +1,12 @@
+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
+index-entries: []
+interface-type: unspecified-define
+links:
+- role: interface-placement
+  uid: header-impl
+name: SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED
+references: {}
+type: interface
diff --git a/spec/score/smp/if/fatal-wrong-cpu-state-to-perform-jobs.yml b/spec/score/smp/if/fatal-wrong-cpu-state-to-perform-jobs.yml
new file mode 100644
index 0000000..c5140c1
--- /dev/null
+++ b/spec/score/smp/if/fatal-wrong-cpu-state-to-perform-jobs.yml
@@ -0,0 +1,12 @@
+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
+index-entries: []
+interface-type: unspecified-define
+links:
+- role: interface-placement
+  uid: header-impl
+name: SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED
+references: {}
+type: interface
diff --git a/spec/score/smp/if/group.yml b/spec/score/smp/if/group.yml
new file mode 100644
index 0000000..236757a
--- /dev/null
+++ b/spec/score/smp/if/group.yml
@@ -0,0 +1,16 @@
+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
+identifier: RTEMSScoreSMP
+links:
+- role: interface-ingroup
+  uid: ../../if/group
+non-functional-type: design-group
+rationale: null
+references: []
+requirement-type: non-functional
+text: |
+  The super core shall have a component containing the
+  ${/glossary/smp:/term}-specific implementation.
+type: requirement
diff --git a/spec/score/smp/req/fatal-boot-processor-not-assigned-to-scheduler.yml b/spec/score/smp/req/fatal-boot-processor-not-assigned-to-scheduler.yml
new file mode 100644
index 0000000..ff558e6
--- /dev/null
+++ b/spec/score/smp/req/fatal-boot-processor-not-assigned-to-scheduler.yml
@@ -0,0 +1,19 @@
+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: 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: |
+  While the system is initialized, if the boot processor is not assigned to a
+  scheduler, then the system shall terminate with the
+  ${/score/interr/if/source-smp:/name} fatal source and the
+  ${../if/fatal-boot-processor-not-assigned-to-scheduler:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/req/fatal-mandatory-processor-not-present.yml b/spec/score/smp/req/fatal-mandatory-processor-not-present.yml
new file mode 100644
index 0000000..d262dc9
--- /dev/null
+++ b/spec/score/smp/req/fatal-mandatory-processor-not-present.yml
@@ -0,0 +1,19 @@
+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: 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: |
+  While the system is initialized, if a mandatory processor defined by the
+  application configuration is not present, then the system shall terminate
+  with the ${/score/interr/if/source-smp:/name} fatal source and the
+  ${../if/fatal-mandatory-processor-not-present:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/req/fatal-multitasking-start-on-invalid-processor.yml b/spec/score/smp/req/fatal-multitasking-start-on-invalid-processor.yml
new file mode 100644
index 0000000..af5dce6
--- /dev/null
+++ b/spec/score/smp/req/fatal-multitasking-start-on-invalid-processor.yml
@@ -0,0 +1,20 @@
+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: 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: |
+  While the system is initialized, if multitasking is started on a processor
+  those index is greater than or equal to the processor maximum defined by the
+  application configuration, then the system shall terminate with the
+  ${/score/interr/if/source-smp:/name} fatal source and the
+  ${../if/fatal-multitasking-start-on-invalid-processor:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/req/fatal-multitasking-start-on-unassigned-processor.yml b/spec/score/smp/req/fatal-multitasking-start-on-unassigned-processor.yml
new file mode 100644
index 0000000..ebbd80c
--- /dev/null
+++ b/spec/score/smp/req/fatal-multitasking-start-on-unassigned-processor.yml
@@ -0,0 +1,20 @@
+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: 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: |
+  While the system is initialized, if multitasking is started on a processor
+  which has no scheduler assigned by the application configuration, then the
+  system shall terminate with the ${/score/interr/if/source-smp:/name} fatal
+  source and the
+  ${../if/fatal-multitasking-start-on-unassigned-processor:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/req/fatal-shutdown-response.yml b/spec/score/smp/req/fatal-shutdown-response.yml
new file mode 100644
index 0000000..799e120
--- /dev/null
+++ b/spec/score/smp/req/fatal-shutdown-response.yml
@@ -0,0 +1,18 @@
+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: 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 the processor receives an SMP shutdown request message, then the system
+  shall terminate with the ${/score/interr/if/source-smp:/name} fatal source
+  and the ${../if/fatal-shutdown-response:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/req/fatal-start-of-mandatory-processor-failed.yml b/spec/score/smp/req/fatal-start-of-mandatory-processor-failed.yml
new file mode 100644
index 0000000..45522e6
--- /dev/null
+++ b/spec/score/smp/req/fatal-start-of-mandatory-processor-failed.yml
@@ -0,0 +1,19 @@
+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: 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: |
+  While the system is initialized, if the processor receives an SMP shutdown
+  request message, then the system shall terminate with the
+  ${/score/interr/if/source-smp:/name} fatal source and the
+  ${../if/fatal-start-of-mandatory-processor-failed:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/req/fatal-wrong-cpu-state-to-perform-jobs.yml b/spec/score/smp/req/fatal-wrong-cpu-state-to-perform-jobs.yml
new file mode 100644
index 0000000..17e9f43
--- /dev/null
+++ b/spec/score/smp/req/fatal-wrong-cpu-state-to-perform-jobs.yml
@@ -0,0 +1,19 @@
+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: 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 the target processor of a job is not in the initial, ready to start
+  multiprocessing, or up state, then the system shall terminate with the
+  ${/score/interr/if/source-smp:/name} fatal source and the
+  ${../if/fatal-wrong-cpu-state-to-perform-jobs:/name} fatal code.
+type: requirement
diff --git a/spec/score/smp/val/fatal-boot-processor-not-assigned-to-scheduler.yml b/spec/score/smp/val/fatal-boot-processor-not-assigned-to-scheduler.yml
new file mode 100644
index 0000000..1351261
--- /dev/null
+++ b/spec/score/smp/val/fatal-boot-processor-not-assigned-to-scheduler.yml
@@ -0,0 +1,64 @@
+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: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    The test action is carried out by the application configuration of the test
+    suite.
+  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-boot-processor-not-assigned-to-scheduler
+  - brief: |
+      Check that the expected fatal code is present.
+    code: |
+      T_step_eq_ulong(
+        ${step},
+        ctx->code,
+        SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER
+      );
+    links:
+    - role: validation
+      uid: ../req/fatal-boot-processor-not-assigned-to-scheduler
+  links: []
+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-boot-processor-not-assigned-to-scheduler.h
+test-includes:
+- rtems/score/smpimpl.h
+test-local-includes:
+- tr-fatal-boot-processor-not-assigned-to-scheduler.h
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tr-fatal-boot-processor-not-assigned-to-scheduler.c
+test-teardown: null
+type: test-case
diff --git a/spec/score/smp/val/fatal-mandatory-processor-not-present.yml b/spec/score/smp/val/fatal-mandatory-processor-not-present.yml
new file mode 100644
index 0000000..15882f9
--- /dev/null
+++ b/spec/score/smp/val/fatal-mandatory-processor-not-present.yml
@@ -0,0 +1,64 @@
+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: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    The test action is carried out by the application configuration of the test
+    suite.
+  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-mandatory-processor-not-present
+  - brief: |
+      Check that the expected fatal code is present.
+    code: |
+      T_step_eq_ulong(
+        ${step},
+        ctx->code,
+        SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT
+      );
+    links:
+    - role: validation
+      uid: ../req/fatal-mandatory-processor-not-present
+  links: []
+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-mandatory-processor-not-present.h
+test-includes:
+- rtems/score/smpimpl.h
+test-local-includes:
+- tr-fatal-mandatory-processor-not-present.h
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tr-fatal-mandatory-processor-not-present.c
+test-teardown: null
+type: test-case
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
new file mode 100644
index 0000000..91a2df3
--- /dev/null
+++ b/spec/score/smp/val/fatal-start-of-mandatory-processor-failed.yml
@@ -0,0 +1,71 @@
+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: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    The test action is carried out by the application configuration of the test
+    suite.
+  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-of-mandatory-processor-failed
+  - brief: |
+      Check that the expected fatal code is present.
+    code: |
+      T_step_eq_ulong(
+        ${step},
+        ctx->code,
+        SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED
+      );
+    links:
+    - role: validation
+      uid: ../req/fatal-start-of-mandatory-processor-failed
+  links: []
+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-of-mandatory-processor-failed.h
+test-includes:
+- rtems/score/smpimpl.h
+test-local-includes:
+- tr-fatal-start-of-mandatory-processor-failed.h
+test-setup: null
+test-stop: null
+test-support: |
+  bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index );
+
+  bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index )
+  {
+    (void) cpu_index;
+    return false;
+  }
+test-target: testsuites/validation/tr-fatal-start-of-mandatory-processor-failed.c
+test-teardown: null
+type: test-case
diff --git a/spec/score/smp/val/fatal.yml b/spec/score/smp/val/fatal.yml
new file mode 100644
index 0000000..8ea0720
--- /dev/null
+++ b/spec/score/smp/val/fatal.yml
@@ -0,0 +1,207 @@
+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: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    The test action is carried out by TriggerTestCase().
+  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-shutdown-response
+  - brief: |
+      Check that the expected fatal code is present.
+    code: |
+      T_step_eq_ulong( ${step}, ctx->code, SMP_FATAL_SHUTDOWN_RESPONSE );
+    links:
+    - role: validation
+      uid: ../req/fatal-shutdown-response
+  links: []
+- action-brief: |
+    Issue a job on a processor in the shutdown state.  Check that the right
+    fatal error occurs if we try to wait for this job to complete.
+  action-code: |
+    Per_CPU_Control *cpu;
+
+    SetFatalExtension( FatalRecordAndJump );
+    cpu = _Per_CPU_Get_by_index( 0 );
+    _Per_CPU_Submit_job( cpu, &job );
+
+    if ( setjmp( fatal_before ) == 0 ) {
+      _Per_CPU_Wait_for_job( cpu, &job );
+    }
+
+    T_step_eq_uint(
+      ${step},
+      _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+      1
+    );
+    T_step_eq_int( ${step}, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+    T_step_false( ${step}, fatal_always_set_to_false );
+    T_step_eq_ulong(
+      ${step},
+      fatal_code,
+      SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS
+    );
+    SetFatalExtension( NULL );
+  checks: []
+  links:
+  - role: validation
+    uid: ../req/fatal-wrong-cpu-state-to-perform-jobs
+- action-brief: |
+    Start multitasking on an invalid processor.  Check that the right fatal
+    error occurs.
+  action-code: |
+    Per_CPU_Control *cpu;
+
+    SetFatalExtension( FatalRecordAndJump );
+
+    /*
+     * This element is outside the array.  This is not an issue since
+     * _SMP_Start_multitasking_on_secondary_processor() does not access the
+     * structure.
+     */
+    cpu = _Per_CPU_Get_by_index( 3 );
+
+    if ( setjmp( fatal_before ) == 0 ) {
+      _SMP_Start_multitasking_on_secondary_processor( cpu );
+    }
+
+    T_step_eq_uint(
+      ${step},
+      _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+      2
+    );
+    T_step_eq_int( ${step}, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+    T_step_false( ${step}, fatal_always_set_to_false );
+    T_step_eq_ulong(
+      ${step},
+      fatal_code,
+      SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR
+    );
+    SetFatalExtension( NULL );
+  checks: []
+  links:
+  - role: validation
+    uid: ../req/fatal-multitasking-start-on-invalid-processor
+- action-brief: |
+    Start multitasking on an unassigned processor.  Check that the right fatal
+    error occurs.
+  action-code: |
+    Per_CPU_Control *cpu;
+
+    SetFatalExtension( FatalRecordAndJump );
+    cpu = _Per_CPU_Get_by_index( 2 );
+
+    if ( setjmp( fatal_before ) == 0 ) {
+      _SMP_Start_multitasking_on_secondary_processor( cpu );
+    }
+
+    T_step_eq_uint(
+      ${step},
+      _Atomic_Load_uint( &fatal_counter, ATOMIC_ORDER_RELAXED ),
+      3
+    );
+    T_step_eq_int( ${step}, fatal_source, RTEMS_FATAL_SOURCE_SMP );
+    T_step_false( ${step}, fatal_always_set_to_false );
+    T_step_eq_ulong(
+      ${step},
+      fatal_code,
+      SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR
+    );
+    SetFatalExtension( NULL );
+  checks: []
+  links:
+  - role: validation
+    uid: ../req/fatal-multitasking-start-on-unassigned-processor
+test-brief: |
+  Tests four fatal errors.
+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-smp.h
+test-includes:
+- rtems/sysinit.h
+- rtems/score/atomic.h
+- rtems/score/smpimpl.h
+- setjmp.h
+test-local-includes:
+- tr-fatal-smp.h
+- tx-support.h
+test-setup: null
+test-stop: null
+test-support: |
+  static void TriggerTestCase( void )
+  {
+    _SMP_Request_shutdown();
+    (void) _CPU_Thread_Idle_body( 0 );
+  }
+
+  RTEMS_SYSINIT_ITEM(
+    TriggerTestCase,
+    RTEMS_SYSINIT_DEVICE_DRIVERS,
+    RTEMS_SYSINIT_ORDER_MIDDLE
+  );
+
+  static jmp_buf fatal_before;
+
+  static Atomic_Uint fatal_counter;
+
+  static rtems_fatal_source fatal_source;
+
+  static bool fatal_always_set_to_false;
+
+  static rtems_fatal_code fatal_code;
+
+  static void FatalRecordAndJump(
+    rtems_fatal_source source,
+    bool               always_set_to_false,
+    rtems_fatal_code   code
+  )
+  {
+    fatal_source = source;
+    fatal_always_set_to_false = always_set_to_false;
+    fatal_code = code;
+    _Atomic_Fetch_add_uint( &fatal_counter, 1, ATOMIC_ORDER_RELAXED );
+    longjmp( fatal_before, 1 );
+  }
+
+  static void DoNothing( void *arg )
+  {
+    (void) arg;
+  }
+
+  static const Per_CPU_Job_context job_context = {
+    .handler = DoNothing
+  };
+
+  Per_CPU_Job job = {
+    .context = &job_context
+  };
+test-target: testsuites/validation/tr-fatal-smp.c
+test-teardown: null
+type: test-case
diff --git a/spec/testsuites/fatal-boot-processor-not-assigned-to-scheduler.yml b/spec/testsuites/fatal-boot-processor-not-assigned-to-scheduler.yml
new file mode 100644
index 0000000..7b81f8e
--- /dev/null
+++ b/spec/testsuites/fatal-boot-processor-not-assigned-to-scheduler.yml
@@ -0,0 +1,46 @@
+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: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+- role: validation
+  uid: /score/smp/req/fatal-boot-processor-not-assigned-to-scheduler
+test-brief: |
+  This validation test suite uses an application configuration which triggers a
+  fatal error during system initialization.
+test-code: |
+  const char rtems_test_name[] = "${.:/test-suite-name}";
+
+  #define FATAL_SYSINIT_RUN \
+    ScoreSmpValFatalBootProcessorNotAssignedToScheduler_Run
+
+  #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+  #define CONFIGURE_MAXIMUM_PROCESSORS 2
+
+  #include <rtems/score/scheduleredfsmp.h>
+
+  #define CONFIGURE_SCHEDULER_EDF_SMP
+
+  #include <rtems/scheduler.h>
+
+  RTEMS_SCHEDULER_EDF_SMP( a );
+
+  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+    RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+  #define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+    RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL )
+
+  #include "ts-fatal-sysinit.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- tr-fatal-boot-processor-not-assigned-to-scheduler.h
+- ts-config.h
+test-suite-name: FatalBootProcessorNotAssignedToScheduler
+test-target: testsuites/validation/ts-fatal-boot-processor-not-assigned-to-scheduler.c
+type: test-suite
diff --git a/spec/testsuites/fatal-mandatory-processor-not-present.yml b/spec/testsuites/fatal-mandatory-processor-not-present.yml
new file mode 100644
index 0000000..1c6189a
--- /dev/null
+++ b/spec/testsuites/fatal-mandatory-processor-not-present.yml
@@ -0,0 +1,75 @@
+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: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+- role: validation
+  uid: /score/smp/req/fatal-mandatory-processor-not-present
+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 ScoreSmpValFatalMandatoryProcessorNotPresent_Run
+
+  #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+  #define CONFIGURE_MAXIMUM_PROCESSORS 32
+
+  #include <rtems/score/scheduleredfsmp.h>
+
+  #define CONFIGURE_SCHEDULER_EDF_SMP
+
+  #include <rtems/scheduler.h>
+
+  RTEMS_SCHEDULER_EDF_SMP( a );
+
+  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+    RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+  #define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY )
+
+  #include "ts-fatal-sysinit.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- tr-fatal-mandatory-processor-not-present.h
+- ts-config.h
+test-suite-name: FatalMandatoryProcessorNotPresent
+test-target: testsuites/validation/ts-fatal-mandatory-processor-not-present.c
+type: test-suite
diff --git a/spec/testsuites/fatal-smp.yml b/spec/testsuites/fatal-smp.yml
new file mode 100644
index 0000000..a33c2b1
--- /dev/null
+++ b/spec/testsuites/fatal-smp.yml
@@ -0,0 +1,44 @@
+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: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+test-brief: |
+  This validation test suite contains a test case which triggers
+  ${/glossary/smp:/term}-specific fatal errors.
+test-code: |
+  const char rtems_test_name[] = "${.:/test-suite-name}";
+
+  #define FATAL_SYSINIT_RUN ScoreSmpValFatal_Run
+
+  #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+  #define CONFIGURE_MAXIMUM_PROCESSORS 3
+
+  #include <rtems/score/scheduleredfsmp.h>
+
+  #define CONFIGURE_SCHEDULER_EDF_SMP
+
+  #include <rtems/scheduler.h>
+
+  RTEMS_SCHEDULER_EDF_SMP( a );
+
+  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+    RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+  #define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER
+
+  #include "ts-fatal-sysinit.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- tr-fatal-smp.h
+- ts-config.h
+test-suite-name: FatalSmp
+test-target: testsuites/validation/ts-fatal-smp.c
+type: test-suite
diff --git a/spec/testsuites/fatal-start-of-mandatory-processor-failed.yml b/spec/testsuites/fatal-start-of-mandatory-processor-failed.yml
new file mode 100644
index 0000000..d16f4c0
--- /dev/null
+++ b/spec/testsuites/fatal-start-of-mandatory-processor-failed.yml
@@ -0,0 +1,45 @@
+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: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+- role: validation
+  uid: /score/smp/req/fatal-start-of-mandatory-processor-failed
+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 ScoreSmpValFatalStartOfMandatoryProcessorFailed_Run
+
+  #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+  #define CONFIGURE_MAXIMUM_PROCESSORS 2
+
+  #include <rtems/score/scheduleredfsmp.h>
+
+  #define CONFIGURE_SCHEDULER_EDF_SMP
+
+  #include <rtems/scheduler.h>
+
+  RTEMS_SCHEDULER_EDF_SMP( a );
+
+  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+    RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+  #define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY )
+
+  #include "ts-fatal-sysinit.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- tr-fatal-start-of-mandatory-processor-failed.h
+- ts-config.h
+test-suite-name: FatalStartOfMandatoryProcessorFailed
+test-target: testsuites/validation/ts-fatal-start-of-mandatory-processor-failed.c
+type: test-suite



More information about the vc mailing list