summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-12 11:18:48 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-12 13:00:47 +0200
commit970aa80fe19c9b476f728cd56e279191e3a40b23 (patch)
tree287ea00534923ac8ee4c4d6342c3a26efdf0d02c
parentsmptests/smpscheduler03: Test all SMP schedulers (diff)
downloadrtems-970aa80fe19c9b476f728cd56e279191e3a40b23.tar.bz2
bsp/realview-pbx-a9: Fix SMP startup
-rw-r--r--c/src/lib/libbsp/arm/realview-pbx-a9/startup/bspstarthooks.c14
1 files changed, 14 insertions, 0 deletions
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();
}