[rtems commit] score: Move out of __RTEMS_HAVE_SYS_CPUSET_H__

Joel Sherrill joel.sherrill at OARcorp.com
Mon May 12 14:03:53 UTC 2014


Thanks. I had a similar patch in the queue.

Is it worth keeping all these ifdef's on having sys/cpuset.h?
It was a polite way to get across the incompatible toolset bump.

On 5/12/2014 8:50 AM, Sebastian Huber wrote:
> Module:    rtems
> Branch:    master
> Commit:    390e73c4eea85f613a918e8fa3988ccc877726ac
> Changeset: http://git.rtems.org/rtems/commit/?id=390e73c4eea85f613a918e8fa3988ccc877726ac
>
> Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
> Date:      Mon May 12 15:55:25 2014 +0200
>
> score: Move out of __RTEMS_HAVE_SYS_CPUSET_H__
>
> Move _Scheduler_Get() and _Scheduler_Set() out of the #if
> defined(__RTEMS_HAVE_SYS_CPUSET_H__) block.
>
> ---
>
>  cpukit/score/include/rtems/score/schedulerimpl.h |   68 +++++++++++-----------
>  1 files changed, 34 insertions(+), 34 deletions(-)
>
> diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
> index cb73d5e..74fa403 100644
> --- a/cpukit/score/include/rtems/score/schedulerimpl.h
> +++ b/cpukit/score/include/rtems/score/schedulerimpl.h
> @@ -330,6 +330,40 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Has_processor_ownership(
>  #endif
>  }
>  
> +RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get(
> +  Thread_Control *the_thread
> +)
> +{
> +#if defined(RTEMS_SMP)
> +  return the_thread->scheduler;
> +#else
> +  (void) the_thread;
> +
> +  return &_Scheduler_Table[ 0 ];
> +#endif
> +}
> +
> +RTEMS_INLINE_ROUTINE void _Scheduler_Set(
> +  const Scheduler_Control *scheduler,
> +  Thread_Control          *the_thread
> +)
> +{
> +#if defined(RTEMS_SMP)
> +  const Scheduler_Control *current_scheduler = _Scheduler_Get( the_thread );
> +
> +  if ( current_scheduler != scheduler ) {
> +    _Thread_Set_state( the_thread, STATES_MIGRATING );
> +    _Scheduler_Free( _Scheduler_Get( the_thread ), the_thread );
> +    the_thread->scheduler = scheduler;
> +    _Scheduler_Allocate( scheduler, the_thread );
> +    _Scheduler_Update( scheduler, the_thread );
> +    _Thread_Clear_state( the_thread, STATES_MIGRATING );
> +  }
> +#else
> +  (void) scheduler;
> +#endif
> +}
> +
>  #if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
>  
>  RTEMS_INLINE_ROUTINE void _Scheduler_Get_processor_set(
> @@ -377,40 +411,6 @@ bool _Scheduler_Get_affinity(
>    cpu_set_t               *cpuset
>  );
>  
> -RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get(
> -  Thread_Control *the_thread
> -)
> -{
> -#if defined(RTEMS_SMP)
> -  return the_thread->scheduler;
> -#else
> -  (void) the_thread;
> -
> -  return &_Scheduler_Table[ 0 ];
> -#endif
> -}
> -
> -RTEMS_INLINE_ROUTINE void _Scheduler_Set(
> -  const Scheduler_Control *scheduler,
> -  Thread_Control          *the_thread
> -)
> -{
> -#if defined(RTEMS_SMP)
> -  const Scheduler_Control *current_scheduler = _Scheduler_Get( the_thread );
> -
> -  if ( current_scheduler != scheduler ) {
> -    _Thread_Set_state( the_thread, STATES_MIGRATING );
> -    _Scheduler_Free( _Scheduler_Get( the_thread ), the_thread );
> -    the_thread->scheduler = scheduler;
> -    _Scheduler_Allocate( scheduler, the_thread );
> -    _Scheduler_Update( scheduler, the_thread );
> -    _Thread_Clear_state( the_thread, STATES_MIGRATING );
> -  }
> -#else
> -  (void) scheduler;
> -#endif
> -}
> -
>  RTEMS_INLINE_ROUTINE bool _Scheduler_default_Set_affinity_body(
>    const Scheduler_Control *scheduler,
>    Thread_Control          *the_thread,
>
> _______________________________________________
> rtems-vc mailing list
> rtems-vc at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-vc

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985




More information about the devel mailing list