diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-18 13:03:27 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-02-19 09:59:42 +0100 |
commit | 282bfd3b41e3725ac9f5fb08b1e391af02572f4f (patch) | |
tree | 17b5fa005f3fd6c788a1bb726831d487c75d9324 /cpukit | |
parent | bsp/leon3: Declare LEON3_IrqCtrl_EIrq only once (diff) | |
download | rtems-282bfd3b41e3725ac9f5fb08b1e391af02572f4f.tar.bz2 |
score: Move _SMP_Handler_initialize()
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/score/src/percpu.c | 31 | ||||
-rw-r--r-- | cpukit/score/src/smp.c | 22 |
2 files changed, 22 insertions, 31 deletions
diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c index aa95aa9c8d..c68f378d1a 100644 --- a/cpukit/score/src/percpu.c +++ b/cpukit/score/src/percpu.c @@ -18,40 +18,9 @@ #include "config.h" #endif -#include <rtems/system.h> -#include <rtems/score/address.h> -#include <rtems/score/thread.h> #include <rtems/score/percpu.h> -#include <rtems/score/wkspace.h> -#include <rtems/config.h> -#include <string.h> #if defined(RTEMS_SMP) - - #include <rtems/score/smp.h> - - void _SMP_Handler_initialize(void) - { - uint32_t max_cpus = rtems_configuration_get_maximum_processors(); - uint32_t cpu; - - /* - * Discover and initialize the secondary cores in an SMP system. - */ - max_cpus = _CPU_SMP_Initialize( max_cpus ); - - _SMP_Processor_count = max_cpus; - - for ( cpu = 1 ; cpu < max_cpus; ++cpu ) { - const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu ); - - _Per_CPU_Wait_for_state( - per_cpu, - PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING - ); - } - } - void _Per_CPU_Change_state( Per_CPU_Control *per_cpu, Per_CPU_State new_state diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 86116da3cf..bfd77dcdd9 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -29,6 +29,28 @@ #include <rtems/bspIo.h> #endif +void _SMP_Handler_initialize( void ) +{ + uint32_t max_cpus = rtems_configuration_get_maximum_processors(); + uint32_t cpu; + + /* + * Discover and initialize the secondary cores in an SMP system. + */ + max_cpus = _CPU_SMP_Initialize( max_cpus ); + + _SMP_Processor_count = max_cpus; + + for ( cpu = 1 ; cpu < max_cpus; ++cpu ) { + const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu ); + + _Per_CPU_Wait_for_state( + per_cpu, + PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING + ); + } +} + void _SMP_Start_multitasking_on_secondary_processor( void ) { Per_CPU_Control *self_cpu = _Per_CPU_Get(); |