summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-10 15:48:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-14 08:37:04 +0200
commit53e008b6fda8ccd1cdcf0f000bbccf1d3788206b (patch)
tree09adbf721ce5e3356ed61e4ee59a767994810873 /c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
parentscore: Add _Per_CPU_Get_snapshot() (diff)
downloadrtems-53e008b6fda8ccd1cdcf0f000bbccf1d3788206b.tar.bz2
score: SMP initialization changes
Add and use _CPU_SMP_Start_processor(). Add and use _CPU_SMP_Finalize_initialization(). This makes most _CPU_SMP_Initialize() functions a bit simpler since we can calculate the minimum value of the count of processors requested by the application configuration and the count of physically or virtually available processors in the high-level code. The CPU port has now the ability to signal a processor start failure. With the support for clustered/partitioned scheduling the presence of particular processors can be configured to be optional or mandatory. There will be a fatal error only in case mandatory processors are not present. The CPU port may use a timeout to monitor the start of a processor.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/qoriq/startup/smp.c')
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/startup/smp.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c b/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
index 2ce0ba75ad..5b4c12a2db 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
@@ -141,26 +141,34 @@ static void bsp_inter_processor_interrupt(void *arg)
_SMP_Inter_processor_interrupt_handler();
}
-uint32_t _CPU_SMP_Initialize(uint32_t configured_cpu_count)
+uint32_t _CPU_SMP_Initialize(void)
{
- rtems_status_code sc;
- uint32_t cores = configured_cpu_count < CORE_COUNT ?
- configured_cpu_count : CORE_COUNT;
-
- sc = rtems_interrupt_handler_install(
- QORIQ_IRQ_IPI_0,
- "IPI",
- RTEMS_INTERRUPT_UNIQUE,
- bsp_inter_processor_interrupt,
- NULL
- );
- assert(sc == RTEMS_SUCCESSFUL);
+ return CORE_COUNT;
+}
- if (cores > 1) {
- release_core_1();
- }
+bool _CPU_SMP_Start_processor(uint32_t cpu_index)
+{
+ (void) cpu_index;
+
+ release_core_1();
- return cores;
+ return true;
+}
+
+void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
+{
+ if (cpu_count > 1) {
+ rtems_status_code sc;
+
+ sc = rtems_interrupt_handler_install(
+ QORIQ_IRQ_IPI_0,
+ "IPI",
+ RTEMS_INTERRUPT_UNIQUE,
+ bsp_inter_processor_interrupt,
+ NULL
+ );
+ assert(sc == RTEMS_SUCCESSFUL);
+ }
}
void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)