From edde99bd213d20c55430dd29089e0d8a807ab6d8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Jun 2013 14:26:34 +0200 Subject: score: Rename rtems_smp_get_number_of_processors() Rename in rtems_smp_get_processor_count(). Always provide and . Add _SMP_Get_processor_count(). This function will be a compile time constant defined to be one on uni-processor configurations. This allows iterations over all processors without overhead on uni-processor configurations. --- cpukit/score/src/smp.c | 8 ++++---- cpukit/score/src/threadcreateidle.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index a8d8f4986f..10acbe25de 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -126,7 +126,7 @@ void _SMP_Send_message( int cpu, uint32_t message ) void _SMP_Broadcast_message( uint32_t message ) { int self = bsp_smp_processor_id(); - int ncpus = _SMP_Processor_count; + int ncpus = _SMP_Get_processor_count(); int cpu; for ( cpu = 0 ; cpu < ncpus ; ++cpu ) { @@ -146,7 +146,7 @@ void _SMP_Broadcast_message( uint32_t message ) void _SMP_Request_other_cores_to_perform_first_context_switch( void ) { int self = bsp_smp_processor_id(); - int ncpus = _SMP_Processor_count; + int ncpus = _SMP_Get_processor_count(); int cpu; for ( cpu = 0 ; cpu < ncpus ; ++cpu ) { @@ -165,7 +165,7 @@ void _SMP_Request_other_cores_to_dispatch( void ) { if ( _System_state_Is_up( _System_state_Get() ) ) { int self = bsp_smp_processor_id(); - int ncpus = _SMP_Processor_count; + int ncpus = _SMP_Get_processor_count(); int cpu; for ( cpu = 0 ; cpu < ncpus ; ++cpu ) { @@ -185,7 +185,7 @@ void _SMP_Request_other_cores_to_dispatch( void ) void _SMP_Request_other_cores_to_shutdown( void ) { int self = bsp_smp_processor_id(); - int ncpus = _SMP_Processor_count; + int ncpus = _SMP_Get_processor_count(); int cpu; _SMP_Broadcast_message( RTEMS_BSP_SMP_SHUTDOWN ); diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c index e4581c8ecb..f90db795bf 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -89,7 +89,7 @@ void _Thread_Create_idle( void ) #if defined(RTEMS_SMP) int cpu; - for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) { + for ( cpu=0 ; cpu < _SMP_Get_processor_count() ; cpu++ ) { _Thread_Create_idle_helper( _Objects_Build_name( 'I', 'D', 'L', 'E' ), cpu -- cgit v1.2.3