summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/smp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-03-08 09:44:31 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-03-08 19:29:09 +0100
commit5fcc2caa103531b0cf2267e822e952e26684aab8 (patch)
tree89358c4ebeeeffc68ab7dbeaf2ad47d0a76faf20 /cpukit/score/src/smp.c
parentsmptests/smpstart01: New test program (diff)
downloadrtems-5fcc2caa103531b0cf2267e822e952e26684aab8.tar.bz2
score: Disable thread dispatching earlier
Disable thread dispatching earlier on secondary processors. This ensures that fatal error and per-CPU job handlers are called with thread dispatching disabled. On the boot processor, the thread dispatching is already disabled by _Thread_Dispatch_initialization().
Diffstat (limited to '')
-rw-r--r--cpukit/score/src/smp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index 125c54e1ba..0dc8830c46 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -253,6 +253,12 @@ void _SMP_Start_multitasking_on_secondary_processor(
cpu_index_self = _Per_CPU_Get_index( cpu_self );
+ /*
+ * Call fatal error and per-CPU job handlers with thread dispatching
+ * disabled.
+ */
+ cpu_self->thread_dispatch_disable_level = 1;
+
if ( cpu_index_self >= rtems_configuration_get_maximum_processors() ) {
_SMP_Fatal( SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR );
}