From 36615183d642a8adb2f59ffcc38d7bf08e5dcb2a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 10 Mar 2022 14:11:12 +0100 Subject: smp: Add fatal error Add SMP-specifc SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR fatal error. This fatal error helps to diagnose a broken SMP startup sequence. Without this error a context switch using the NULL pointer for the thread control block happens which may be difficult to debug. --- cpukit/score/src/smp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cpukit/score/src/smp.c') diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 0dc8830c46..7c068f3c51 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -269,6 +269,11 @@ void _SMP_Start_multitasking_on_secondary_processor( _Per_CPU_Set_state( cpu_self, PER_CPU_STATE_READY_TO_START_MULTITASKING ); _SMP_Wait_for_start_multitasking( cpu_self ); + + if ( !_Per_CPU_Is_processor_online( cpu_self ) ) { + _SMP_Fatal( SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR ); + } + _Thread_Start_multitasking(); } -- cgit v1.2.3