summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-18 07:14:41 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-18 07:16:26 +0200
commit1b57b7527ab10863f27f439059338f29f47d4f06 (patch)
tree00da10ba5c2d9bdd15b549ba6d0405abbe23c9af
parentscore: Avoid structurally dead code (diff)
downloadrtems-1b57b7527ab10863f27f439059338f29f47d4f06.tar.bz2
bsp/realview-pbx-a9: Support unassigned processors
-rw-r--r--bsps/arm/realview-pbx-a9/start/bspstarthooks.c14
1 files 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 <bsp/arm-cp15-start.h>
#include <bsp/arm-a9mpcore-start.h>
+#ifdef RTEMS_SMP
+#include <rtems/score/smpimpl.h>
+#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();
}