diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-07-07 07:45:57 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-07-07 07:55:03 +0200 |
commit | 76d119857f62ceff860439ae8bbf3fa29757dc87 (patch) | |
tree | 0b2efcae7e04f9cae4d4c15ceba76355892012b2 /cpukit/score | |
parent | score: Use processor mask for set affinity (diff) | |
download | rtems-76d119857f62ceff860439ae8bbf3fa29757dc87.tar.bz2 |
score: Introduce _SMP_Get_online_processors()
Update #3059.
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/smpimpl.h | 9 | ||||
-rw-r--r-- | cpukit/score/src/smpmulticastaction.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/threadinitialize.c | 5 |
3 files changed, 14 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h index bc800b9e42..950f83a149 100644 --- a/cpukit/score/include/rtems/score/smpimpl.h +++ b/cpukit/score/include/rtems/score/smpimpl.h @@ -335,6 +335,15 @@ bool _SMP_Before_multitasking_action_broadcast( do { } while ( 0 ) #endif +RTEMS_INLINE_ROUTINE const Processor_mask *_SMP_Get_online_processors( void ) +{ +#if defined(RTEMS_SMP) + return &_SMP_Online_processors; +#else + return &_Processor_mask_The_one_and_only. +#endif +} + /** @} */ #ifdef __cplusplus diff --git a/cpukit/score/src/smpmulticastaction.c b/cpukit/score/src/smpmulticastaction.c index 73b15001ab..455fbd7d34 100644 --- a/cpukit/score/src/smpmulticastaction.c +++ b/cpukit/score/src/smpmulticastaction.c @@ -106,7 +106,7 @@ void _SMP_Multicast_action( } if( cpus == NULL ) { - _Processor_mask_Assign( &targets, &_SMP_Online_processors ); + _Processor_mask_Assign( &targets, _SMP_Get_online_processors() ); } else { _Processor_mask_Zero( &targets ); diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index 803ee7b646..3230eac2fe 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -248,7 +248,10 @@ bool _Thread_Initialize( RTEMS_STATIC_ASSERT( THREAD_SCHEDULER_BLOCKED == 0, Scheduler_state ); the_thread->Scheduler.home = scheduler; _ISR_lock_Initialize( &the_thread->Scheduler.Lock, "Thread Scheduler" ); - _Processor_mask_Assign( &the_thread->Scheduler.Affinity, &_SMP_Online_processors ); + _Processor_mask_Assign( + &the_thread->Scheduler.Affinity, + _SMP_Get_online_processors() + ); _ISR_lock_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default" ); _Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer ); _RBTree_Initialize_node( &the_thread->Wait.Link.Registry_node ); |