summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smpfatal02
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-27 13:40:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-28 19:32:24 +0200
commitcbb1103a3ca9d2f42501ba373b5d559b981fb1c7 (patch)
tree8e20c863237d95390b49c82d7ee45791389b5a2a /testsuites/smptests/smpfatal02
parentscore: Remove processor event broadcast/receive (diff)
downloadrtems-cbb1103a3ca9d2f42501ba373b5d559b981fb1c7.tar.bz2
score: Simplify SMP processor state handling
The per-CPU states which control the SMP system initialization were added quite early during the SMP support development. Replace this initial implementation with a simplified one. There is no longer a global SMP lock required which serialized the state changes of all processors. The new implementation better integrates with the per-CPU jobs.
Diffstat (limited to 'testsuites/smptests/smpfatal02')
-rw-r--r--testsuites/smptests/smpfatal02/init.c21
-rw-r--r--testsuites/smptests/smpfatal02/smpfatal02.doc3
2 files changed, 15 insertions, 9 deletions
diff --git a/testsuites/smptests/smpfatal02/init.c b/testsuites/smptests/smpfatal02/init.c
index 25321ca27b..5528a4315d 100644
--- a/testsuites/smptests/smpfatal02/init.c
+++ b/testsuites/smptests/smpfatal02/init.c
@@ -47,6 +47,7 @@ static void fatal_extension(
{
SMP_barrier_State barrier_state = SMP_BARRIER_STATE_INITIALIZER;
uint32_t self = rtems_scheduler_get_processor();
+ uint32_t cpu_count = rtems_scheduler_get_processor_maximum();
assert(!always_set_to_false);
@@ -57,25 +58,29 @@ static void fatal_extension(
assert(code == 0xdeadbeef);
_SMP_Request_shutdown();
+ _SMP_barrier_Wait(&barrier, &barrier_state, cpu_count);
- for (cpu = 0; cpu < MAX_CPUS; ++cpu) {
+ for (cpu = 0; cpu < cpu_count; ++cpu) {
const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
Per_CPU_State state = _Per_CPU_Get_state(per_cpu);
assert(state == PER_CPU_STATE_SHUTDOWN);
}
+ for (cpu = cpu_count; cpu < MAX_CPUS; ++cpu) {
+ const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
+ Per_CPU_State state = _Per_CPU_Get_state(per_cpu);
+
+ assert(state == PER_CPU_STATE_INITIAL);
+ }
+
TEST_END();
} else if ( source == RTEMS_FATAL_SOURCE_SMP ) {
assert(self != main_cpu);
- assert(code == SMP_FATAL_SHUTDOWN);
+ assert(code == SMP_FATAL_SHUTDOWN_RESPONSE);
+ _SMP_barrier_Wait(&barrier, &barrier_state, cpu_count);
+ _SMP_barrier_Wait(&barrier, &barrier_state, cpu_count);
}
-
- _SMP_barrier_Wait(
- &barrier,
- &barrier_state,
- rtems_scheduler_get_processor_maximum()
- );
}
static rtems_status_code test_driver_init(
diff --git a/testsuites/smptests/smpfatal02/smpfatal02.doc b/testsuites/smptests/smpfatal02/smpfatal02.doc
index 9e2e002b37..b962f528ad 100644
--- a/testsuites/smptests/smpfatal02/smpfatal02.doc
+++ b/testsuites/smptests/smpfatal02/smpfatal02.doc
@@ -4,7 +4,8 @@ test set name: smpfatal02
directives:
- - _Per_CPU_State_change()
+ - _Terminate()
+ - _SMP_Start_multitasking_on_secondary_processor()
concepts: