From 970aa80fe19c9b476f728cd56e279191e3a40b23 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 12 Jun 2014 11:18:48 +0200 Subject: bsp/realview-pbx-a9: Fix SMP startup --- .../lib/libbsp/arm/realview-pbx-a9/startup/bspstarthooks.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/startup/bspstarthooks.c b/c/src/lib/libbsp/arm/realview-pbx-a9/startup/bspstarthooks.c index df9e717c2c..ab766e8626 100644 --- a/c/src/lib/libbsp/arm/realview-pbx-a9/startup/bspstarthooks.c +++ b/c/src/lib/libbsp/arm/realview-pbx-a9/startup/bspstarthooks.c @@ -55,6 +55,20 @@ 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(); + + /* + * QEMU jumps to the entry point of the ELF file on all processors. Prevent + * a SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR this way. + */ + if ( cpu_id >= rtems_configuration_get_maximum_processors() ) { + while (true) { + _ARM_Wait_for_event(); + } + } +#endif + arm_a9mpcore_start_hook_0(); } -- cgit v1.2.3