From 32f0f11a68d3aa521f0398c9b8eec3d47f114c5e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 8 Mar 2022 16:56:49 +0100 Subject: SMP: Fix start multitasking for some targets The previous SMP multitasking start assumed that the initial heir thread of a processor starts execution in _Thread_Handler(). The _Thread_Handler() sets the interrupt state explicitly by _ISR_Set_level() before it calls the thread entry. Under certain timing conditions, processors may perform an initial context switch to a thread which already executes its thread body (see smptests/smpstart01). In this case, interrupts are disabled after the context switch on targets which do not save/restore the interrupt state during a context switch (aarch64, arm, and riscv). Close #4627. --- cpukit/score/src/threadstartmultitasking.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cpukit/score/src/threadstartmultitasking.c') diff --git a/cpukit/score/src/threadstartmultitasking.c b/cpukit/score/src/threadstartmultitasking.c index 5cc2051be4..d97d2e0c82 100644 --- a/cpukit/score/src/threadstartmultitasking.c +++ b/cpukit/score/src/threadstartmultitasking.c @@ -64,6 +64,9 @@ void _Thread_Start_multitasking( void ) #if defined(_CPU_Start_multitasking) _CPU_Start_multitasking( &heir->Registers ); #elif defined(RTEMS_SMP) +#if CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE +#error "The CPU port has to provide _CPU_Start_multitasking()" +#endif { Context_Control trash; -- cgit v1.2.3