From 1b57b7527ab10863f27f439059338f29f47d4f06 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 18 Jul 2018 07:14:41 +0200 Subject: bsp/realview-pbx-a9: Support unassigned processors --- bsps/arm/realview-pbx-a9/start/bspstarthooks.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bsps/arm/realview-pbx-a9/start/bspstarthooks.c b/bsps/arm/realview-pbx-a9/start/bspstarthooks.c index ab766e8626..db55b03cb6 100644 --- a/bsps/arm/realview-pbx-a9/start/bspstarthooks.c +++ b/bsps/arm/realview-pbx-a9/start/bspstarthooks.c @@ -19,6 +19,10 @@ #include #include +#ifdef RTEMS_SMP +#include +#endif + BSP_START_DATA_SECTION static const arm_cp15_start_section_config rvpbxa9_mmu_config_table[] = { ARMV7_CP15_START_DEFAULT_SECTIONS, @@ -56,13 +60,17 @@ BSP_START_TEXT_SECTION static void setup_mmu_and_cache(void) BSP_START_TEXT_SECTION void bsp_start_hook_0(void) { #ifdef RTEMS_SMP - uint32_t cpu_id = arm_cortex_a9_get_multiprocessor_cpu_id(); + uint32_t cpu_index_self = _SMP_Get_current_processor(); /* * QEMU jumps to the entry point of the ELF file on all processors. Prevent - * a SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR this way. + * the fatal errors SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR and + * SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR this way. */ - if ( cpu_id >= rtems_configuration_get_maximum_processors() ) { + if ( + cpu_index_self >= rtems_configuration_get_maximum_processors() + || !_SMP_Should_start_processor(cpu_index_self) + ) { while (true) { _ARM_Wait_for_event(); } -- cgit v1.2.3