diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-14 10:12:52 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-29 11:06:07 +0200 |
commit | baf8f4dabc12bc9ff64354e832a06dd5aa03e484 (patch) | |
tree | a0f742b9eaff5dfeb03d0a74f9b51eeb7e9aa100 /cpukit/score/src/percpu.c | |
parent | smp: Make CPU_ALLOCATE_INTERRUPT_STACK optional (diff) | |
download | rtems-baf8f4dabc12bc9ff64354e832a06dd5aa03e484.tar.bz2 |
smp: Simplify main CPU initialization
Call _SMP_Handler_initialize() later and move bsp_smp_initialize() into
_SMP_Handler_initialize(). Change bsp_smp_initialize() prototype to
match integer types of calling context.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/percpu.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c index d40b2a6154..f01d933cfe 100644 --- a/cpukit/score/src/percpu.c +++ b/cpukit/score/src/percpu.c @@ -31,13 +31,14 @@ void _SMP_Handler_initialize(void) { - int cpu; + uint32_t max_cpus = rtems_configuration_get_maximum_processors(); + uint32_t cpu; /* * Initialize per cpu pointer table */ _Per_CPU_Information_p[0] = &_Per_CPU_Information[0]; - for (cpu=1 ; cpu < rtems_configuration_get_maximum_processors(); cpu++ ) { + for ( cpu = 1 ; cpu < max_cpus; ++cpu ) { Per_CPU_Control *p = &_Per_CPU_Information[cpu]; @@ -59,6 +60,13 @@ p->state = RTEMS_BSP_SMP_CPU_INITIAL_STATE; RTEMS_COMPILER_MEMORY_BARRIER(); } + + /* + * Discover and initialize the secondary cores in an SMP system. + */ + max_cpus = bsp_smp_initialize( max_cpus ); + + _SMP_Processor_count = max_cpus; } #else /* |