diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-07-04 07:28:44 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-07-07 07:28:35 +0200 |
commit | 6b1d8c7865268071a8de6ba6343159049a8b0e56 (patch) | |
tree | 46083cabb446ad2d1fb3e65d6d9d2f2165446f98 /cpukit/score/include/rtems | |
parent | score: Move processor affinity to Thread_Control (diff) | |
download | rtems-6b1d8c7865268071a8de6ba6343159049a8b0e56.tar.bz2 |
score: Add processor set to scheduler context
Replace the simple processor count with the processor set owned by the
scheduler instance.
Update #3059.
Diffstat (limited to 'cpukit/score/include/rtems')
-rw-r--r-- | cpukit/score/include/rtems/score/scheduler.h | 4 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulerimpl.h | 25 |
2 files changed, 9 insertions, 20 deletions
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 6e7bdcbd9a..7a3ae6b466 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -227,9 +227,9 @@ typedef struct Scheduler_Context { #if defined(RTEMS_SMP) /** - * @brief Count of processors owned by this scheduler instance. + * @brief The set of processors owned by this scheduler instance. */ - uint32_t processor_count; + Processor_mask Processors; #endif } Scheduler_Context; diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index 927c6e1762..895f116066 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -589,28 +589,15 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Has_processor_ownership( #endif } -RTEMS_INLINE_ROUTINE void _Scheduler_Get_processor_set( - const Scheduler_Control *scheduler, - size_t cpusetsize, - cpu_set_t *cpuset +RTEMS_INLINE_ROUTINE const Processor_mask *_Scheduler_Get_processors( + const Scheduler_Control *scheduler ) { - uint32_t cpu_count = _SMP_Get_processor_count(); - uint32_t cpu_index; - - CPU_ZERO_S( cpusetsize, cpuset ); - - for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) { #if defined(RTEMS_SMP) - if ( _Scheduler_Has_processor_ownership( scheduler, cpu_index ) ) { - CPU_SET_S( (int) cpu_index, cpusetsize, cpuset ); - } + return &_Scheduler_Get_context( scheduler )->Processors; #else - (void) scheduler; - - CPU_SET_S( (int) cpu_index, cpusetsize, cpuset ); + return &_Processor_mask_The_one_and_only; #endif - } } bool _Scheduler_Get_affinity( @@ -688,7 +675,9 @@ RTEMS_INLINE_ROUTINE uint32_t _Scheduler_Get_processor_count( ) { #if defined(RTEMS_SMP) - return _Scheduler_Get_context( scheduler )->processor_count; + const Scheduler_Context *context = _Scheduler_Get_context( scheduler ); + + return _Processor_mask_Count( &context->Processors ); #else (void) scheduler; |