Changeset 24934e36 in rtems


Ignore:
Timestamp:
Apr 3, 2014, 1:03:35 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
eb2c813
Parents:
439c494
git-author:
Sebastian Huber <sebastian.huber@…> (04/03/14 13:03:35)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/04/14 09:01:18)
Message:

score: Add scheduler control to scheduler ops

Scheduler operations must be free of a global scheduler context to
enable partitioned/clustered scheduling.

Files:
82 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/nanosleep.c

    r439c494 r24934e36  
    6666    _Thread_Disable_dispatch();
    6767      executing = _Thread_Executing;
    68       _Scheduler_Yield( executing );
     68      _Scheduler_Yield( _Scheduler_Get( executing ), executing );
    6969    _Thread_Enable_dispatch();
    7070    if ( rmtp ) {
  • cpukit/posix/src/pthreadcreate.c

    r439c494 r24934e36  
    195195#if defined(RTEMS_SMP) && __RTEMS_HAVE_SYS_CPUSET_H__
    196196   status = _Scheduler_Set_affinity(
     197     _Scheduler_Get( the_thread ),
    197198     the_thread,
    198199     the_attr->affinitysetsize,
  • cpukit/posix/src/pthreadgetaffinitynp.c

    r439c494 r24934e36  
    4848
    4949    case OBJECTS_LOCAL:
    50       ok = _Scheduler_Get_affinity( the_thread, cpusetsize, cpuset );
     50      ok = _Scheduler_Get_affinity(
     51        _Scheduler_Get( the_thread ),
     52        the_thread,
     53        cpusetsize,
     54        cpuset
     55      );
    5156      _Objects_Put( &the_thread->Object );
    52       if (!ok)
    53         return EINVAL;
    54       return 0;
    55       break;
     57      return ok ? 0 : EINVAL;
    5658
    5759#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/posix/src/pthreadsetaffinitynp.c

    r439c494 r24934e36  
    4848
    4949    case OBJECTS_LOCAL:
    50       api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    51       ok = _Scheduler_Set_affinity( the_thread, cpusetsize, cpuset );
    52       if (ok)
     50      ok = _Scheduler_Set_affinity(
     51        _Scheduler_Get( the_thread ),
     52        the_thread,
     53        cpusetsize,
     54        cpuset
     55      );
     56      if ( ok ) {
     57        api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    5358        CPU_COPY( api->Attributes.affinityset, cpuset );
     59      }
    5460      _Objects_Put( &the_thread->Object );
    55       if (!ok)
    56         return EINVAL;
    57       return 0;
    58       break;
     61      return ok ? 0 : EINVAL;
    5962
    6063#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/posix/src/sched_yield.c

    r439c494 r24934e36  
    2727int sched_yield( void )
    2828{
     29  Thread_Control *executing;
     30
    2931  _Thread_Disable_dispatch();
    30     _Scheduler_Yield( _Thread_Executing );
     32    executing = _Thread_Executing;
     33    _Scheduler_Yield( _Scheduler_Get( executing ), executing );
    3134  _Thread_Enable_dispatch();
    3235  return 0;
  • cpukit/rtems/src/clocktick.c

    r439c494 r24934e36  
    3535  _Watchdog_Tickle_ticks();
    3636
    37   _Scheduler_Tick();
     37  _Scheduler_Tick( _Scheduler_Get( NULL ) );
    3838
    3939#if defined( RTEMS_SMP )
  • cpukit/rtems/src/ratemoncancel.c

    r439c494 r24934e36  
    4141      (void) _Watchdog_Remove( &the_period->Timer );
    4242      the_period->state = RATE_MONOTONIC_INACTIVE;
    43       _Scheduler_Release_job(the_period->owner, 0);
     43      _Scheduler_Release_job(
     44        _Scheduler_Get( the_period->owner ),
     45        the_period->owner,
     46        0
     47      );
    4448      _Objects_Put( &the_period->Object );
    4549      return RTEMS_SUCCESSFUL;
  • cpukit/rtems/src/ratemondelete.c

    r439c494 r24934e36  
    3636
    3737    case OBJECTS_LOCAL:
    38       _Scheduler_Release_job(the_period->owner, 0);
     38      _Scheduler_Release_job(
     39        _Scheduler_Get( the_period->owner ),
     40        the_period->owner,
     41        0
     42      );
    3943      _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
    4044      (void) _Watchdog_Remove( &the_period->Timer );
  • cpukit/rtems/src/ratemonperiod.c

    r439c494 r24934e36  
    145145  #endif
    146146
    147   _Scheduler_Release_job(the_period->owner, the_period->next_length);
     147  _Scheduler_Release_job(
     148    _Scheduler_Get( the_period->owner ),
     149    the_period->owner,
     150    the_period->next_length
     151  );
    148152}
    149153
     
    341345
    342346        _Watchdog_Insert_ticks( &the_period->Timer, length );
    343         _Scheduler_Release_job(the_period->owner, the_period->next_length);
     347        _Scheduler_Release_job(
     348          _Scheduler_Get( the_period->owner ),
     349          the_period->owner,
     350          the_period->next_length
     351        );
    344352        _Objects_Put( &the_period->Object );
    345353        return RTEMS_TIMEOUT;
  • cpukit/rtems/src/taskgetaffinity.c

    r439c494 r24934e36  
    3535  Thread_Control        *the_thread;
    3636  Objects_Locations      location;
    37   rtems_status_code      status = RTEMS_SUCCESSFUL;
     37  bool                   ok;
    3838
    3939  if ( !cpuset )
     
    4545
    4646    case OBJECTS_LOCAL:
    47       if ( ! _Scheduler_Get_affinity( the_thread, cpusetsize, cpuset )) {
    48         status = RTEMS_INVALID_NUMBER;
    49       }
     47      ok = _Scheduler_Get_affinity(
     48        _Scheduler_Get( the_thread ),
     49        the_thread,
     50        cpusetsize,
     51        cpuset
     52      );
    5053      _Objects_Put( &the_thread->Object );
    51       return status;
     54      return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER;
    5255
    5356#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/rtems/src/tasksetaffinity.c

    r439c494 r24934e36  
    4343
    4444    case OBJECTS_LOCAL:
    45       ok = _Scheduler_Set_affinity( the_thread, cpusetsize, cpuset );
     45      ok = _Scheduler_Set_affinity(
     46        _Scheduler_Get( the_thread ),
     47        the_thread,
     48        cpusetsize,
     49        cpuset
     50      );
    4651      _Objects_Put( &the_thread->Object );
    47       if (! ok) {
    48         return RTEMS_INVALID_NUMBER;
    49       }
    50       return RTEMS_SUCCESSFUL;
     52      return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER;
    5153
    5254#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/rtems/src/taskwakeafter.c

    r439c494 r24934e36  
    3838
    3939    if ( ticks == 0 ) {
    40       _Scheduler_Yield( executing );
     40      _Scheduler_Yield( _Scheduler_Get( executing ), executing );
    4141    } else {
    4242      _Thread_Set_state( executing, STATES_DELAYING );
  • cpukit/score/include/rtems/score/scheduler.h

    r439c494 r24934e36  
    4141/**@{*/
    4242
     43typedef struct Scheduler_Control Scheduler_Control;
     44
    4345/**
    4446 * function jump table that holds pointers to the functions that
     
    5052
    5153  /** Implements the scheduling decision logic (policy). */
    52   void ( *schedule )( Thread_Control *thread );
     54  void ( *schedule )( Scheduler_Control *, Thread_Control *);
    5355
    5456  /**
     
    5759   * @see _Scheduler_Yield().
    5860   */
    59   void ( *yield )( Thread_Control *thread );
     61  void ( *yield )( Scheduler_Control *, Thread_Control *);
    6062
    6163  /** Removes the given thread from scheduling decisions. */
    62   void ( *block )(Thread_Control *);
     64  void ( *block )( Scheduler_Control *, Thread_Control * );
    6365
    6466  /** Adds the given thread to scheduling decisions. */
    65   void ( *unblock )(Thread_Control *);
     67  void ( *unblock )( Scheduler_Control *, Thread_Control * );
    6668
    6769  /** allocates the scheduler field of the given thread */
    68   void * ( *allocate )(Thread_Control *);
     70  void * ( *allocate )( Scheduler_Control *, Thread_Control * );
    6971
    7072  /** frees the scheduler field of the given thread */
    71   void ( *free )(Thread_Control *);
     73  void ( *free )( Scheduler_Control *, Thread_Control * );
    7274
    7375  /** updates the scheduler field of the given thread -- primarily used
    7476   * when changing the thread's priority. */
    75   void ( *update )(Thread_Control *);
     77  void ( *update )( Scheduler_Control *, Thread_Control * );
    7678
    7779  /** enqueue a thread as the last of its priority group */
    78   void ( *enqueue )(Thread_Control *);
     80  void ( *enqueue )( Scheduler_Control *, Thread_Control * );
    7981
    8082  /** enqueue a thread as the first of its priority group */
    81   void ( *enqueue_first )(Thread_Control *);
     83  void ( *enqueue_first )( Scheduler_Control *, Thread_Control * );
    8284
    8385  /** extract a thread from the ready set */
    84   void ( *extract )(Thread_Control *);
     86  void ( *extract )( Scheduler_Control *, Thread_Control * );
    8587
    8688  /**
     
    8890   * and <0 for lower priority).
    8991   */
    90   int ( *priority_compare )(Priority_Control, Priority_Control);
     92  int ( *priority_compare )(
     93    Priority_Control,
     94    Priority_Control
     95  );
    9196
    9297  /** This routine is called upon release of a new job. */
    93   void ( *release_job ) (Thread_Control *, uint32_t);
     98  void ( *release_job ) ( Scheduler_Control *, Thread_Control *, uint32_t );
    9499
    95100  /** perform scheduler update actions required at each clock tick */
    96   void ( *tick )(void);
     101  void ( *tick )( Scheduler_Control * );
    97102
    98103  /**
     
    101106   * @see _Scheduler_Start_idle().
    102107   */
    103   void ( *start_idle )( Thread_Control *thread, Per_CPU_Control *processor );
     108  void ( *start_idle )(
     109    Scheduler_Control *,
     110    Thread_Control *,
     111    Per_CPU_Control *
     112  );
    104113
    105114#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
     
    109118   * @see _Scheduler_Get_affinity().
    110119   */
    111   bool ( *get_affinity )( Thread_Control *thread, size_t cpusetsize, cpu_set_t *cpuset );
     120  bool ( *get_affinity )(
     121    Scheduler_Control *,
     122    Thread_Control *,
     123    size_t,
     124    cpu_set_t *
     125  );
    112126 
    113127  /**
     
    117131   */
    118132  bool ( *set_affinity )(
    119     Thread_Control  *thread,
    120     size_t           cpusetsize,
    121     const cpu_set_t *cpuset
    122   );
    123 #endif
    124 
     133    Scheduler_Control *,
     134    Thread_Control *,
     135    size_t,
     136    const cpu_set_t *
     137  );
     138#endif
    125139} Scheduler_Operations;
    126140
     
    128142 * This is the structure used to manage the scheduler.
    129143 */
    130 typedef struct {
     144struct Scheduler_Control {
    131145  /**
    132146   *  This points to the data structure used to manage the ready set of
     
    138152  /** The jump table for scheduler-specific functions */
    139153  Scheduler_Operations    Operations;
    140 } Scheduler_Control;
     154};
    141155
    142156/**
     
    153167 * @brief Returns an arbitrary non-NULL value.
    154168 *
    155  * @param[in] thread Unused.
     169 * @param[in] scheduler Unused.
     170 * @param[in] the_thread Unused.
    156171 *
    157172 * @return An arbitrary non-NULL value.
    158173 */
    159174void *_Scheduler_default_Allocate(
    160   Thread_Control *thread
     175  Scheduler_Control *scheduler,
     176  Thread_Control    *the_thread
    161177);
    162178
     
    164180 * @brief Does nothing.
    165181 *
    166  * @param[in] thread Unused.
     182 * @param[in] scheduler Unused.
     183 * @param[in] the_thread Unused.
    167184 */
    168185void _Scheduler_default_Free(
    169   Thread_Control *thread
     186  Scheduler_Control *scheduler,
     187  Thread_Control    *the_thread
    170188);
    171189
     
    173191 * @brief Does nothing.
    174192 *
    175  * @param[in] thread Unused.
     193 * @param[in] scheduler Unused.
     194 * @param[in] the_thread Unused.
    176195 */
    177196void _Scheduler_default_Update(
    178   Thread_Control *the_thread
     197  Scheduler_Control *scheduler,
     198  Thread_Control    *the_thread
    179199);
    180200
     
    182202 * @brief Does nothing.
    183203 *
    184  * @param[in] thread Unused.
     204 * @param[in] scheduler Unused.
     205 * @param[in] the_thread Unused.
    185206 * @param[in] deadline Unused.
    186207 */
    187208void _Scheduler_default_Release_job(
    188   Thread_Control *thread,
    189   uint32_t        deadline
     209  Scheduler_Control *scheduler,
     210  Thread_Control    *the_thread,
     211  uint32_t           deadline
    190212);
    191213
     
    195217 *
    196218 * This routine is invoked as part of processing each clock tick.
    197  */
    198 void _Scheduler_default_Tick( void );
    199 
    200 /**
    201  * @brief Unblocks the thread.
    202  *
    203  * @param[in,out] thread An idle thread.
    204  * @param[in] processor This parameter is unused.
     219 *
     220 * @param[in] scheduler The scheduler.
     221 */
     222void _Scheduler_default_Tick( Scheduler_Control *scheduler );
     223
     224/**
     225 * @brief Starts an idle thread.
     226 *
     227 * @param[in] scheduler The scheduler.
     228 * @param[in] the_thread An idle thread.
     229 * @param[in] cpu This parameter is unused.
    205230 */
    206231void _Scheduler_default_Start_idle(
    207   Thread_Control  *thread,
    208   Per_CPU_Control *processor
     232  Scheduler_Control *scheduler,
     233  Thread_Control    *the_thread,
     234  Per_CPU_Control   *cpu
    209235);
    210236
     
    221247   */
    222248  bool _Scheduler_default_Get_affinity(
    223     Thread_Control *thread,
    224     size_t          cpusetsize,
    225     cpu_set_t      *cpuset
     249    Scheduler_Control *scheduler,
     250    Thread_Control    *thread,
     251    size_t             cpusetsize,
     252    cpu_set_t         *cpuset
    226253  );
    227254
     
    239266   */
    240267  bool _Scheduler_default_Set_affinity(
    241     Thread_Control  *thread,
    242     size_t           cpusetsize,
    243     const cpu_set_t *cpuset
     268    Scheduler_Control *scheduler,
     269    Thread_Control    *thread,
     270    size_t             cpusetsize,
     271    const cpu_set_t   *cpuset
    244272  );
    245273#endif
  • cpukit/score/include/rtems/score/schedulercbs.h

    r439c494 r24934e36  
    149149 */
    150150void _Scheduler_CBS_Unblock(
     151  Scheduler_Control *scheduler,
    151152  Thread_Control    *the_thread
    152153);
     
    165166
    166167void _Scheduler_CBS_Release_job (
    167   Thread_Control  *the_thread,
    168   uint32_t         length
     168  Scheduler_Control *scheduler,
     169  Thread_Control    *the_thread,
     170  uint32_t           length
    169171);
    170172
     
    337339 */
    338340void *_Scheduler_CBS_Allocate(
    339   Thread_Control      *the_thread
     341  Scheduler_Control *scheduler,
     342  Thread_Control    *the_thread
    340343);
    341344#ifdef __cplusplus
  • cpukit/score/include/rtems/score/scheduleredf.h

    r439c494 r24934e36  
    122122 */
    123123void _Scheduler_EDF_Block(
     124  Scheduler_Control *scheduler,
    124125  Thread_Control    *the_thread
    125126);
     
    132133 *  in the rbtree ready queue.
    133134 */
    134 void _Scheduler_EDF_Schedule( Thread_Control *thread );
     135void _Scheduler_EDF_Schedule(
     136  Scheduler_Control *scheduler,
     137  Thread_Control    *the_thread
     138);
    135139
    136140/**
     
    143147 */
    144148void *_Scheduler_EDF_Allocate(
    145   Thread_Control      *the_thread
     149  Scheduler_Control *scheduler,
     150  Thread_Control    *the_thread
    146151);
    147152
     
    155160 */
    156161void _Scheduler_EDF_Free(
    157   Thread_Control      *the_thread
     162  Scheduler_Control *scheduler,
     163  Thread_Control    *the_thread
    158164);
    159165
     
    167173 */
    168174void _Scheduler_EDF_Update(
    169   Thread_Control      *the_thread
     175  Scheduler_Control *scheduler,
     176  Thread_Control    *the_thread
    170177);
    171178
     
    180187 */
    181188void _Scheduler_EDF_Unblock(
     189  Scheduler_Control *scheduler,
    182190  Thread_Control    *the_thread
    183191);
     
    198206 *  @param[in,out] thread The yielding thread.
    199207 */
    200 void _Scheduler_EDF_Yield( Thread_Control *thread );
     208void _Scheduler_EDF_Yield(
     209  Scheduler_Control *scheduler,
     210  Thread_Control    *the_thread
     211);
    201212
    202213/**
     
    208219 */
    209220void _Scheduler_EDF_Enqueue(
     221  Scheduler_Control *scheduler,
    210222  Thread_Control    *the_thread
    211223);
     
    220232 */
    221233void _Scheduler_EDF_Enqueue_first(
     234  Scheduler_Control *scheduler,
    222235  Thread_Control    *the_thread
    223236);
     
    233246 */
    234247void _Scheduler_EDF_Extract(
    235   Thread_Control     *the_thread
     248  Scheduler_Control *scheduler,
     249  Thread_Control    *the_thread
    236250);
    237251
     
    262276 */
    263277void _Scheduler_EDF_Release_job (
    264   Thread_Control  *the_thread,
    265   uint32_t         deadline
     278  Scheduler_Control *scheduler,
     279  Thread_Control    *the_thread,
     280  uint32_t           deadline
    266281);
    267282
  • cpukit/score/include/rtems/score/scheduleredfimpl.h

    r439c494 r24934e36  
    3232 */
    3333
    34 RTEMS_INLINE_ROUTINE Scheduler_EDF_Control *_Scheduler_EDF_Instance( void )
     34RTEMS_INLINE_ROUTINE Scheduler_EDF_Control *
     35  _Scheduler_EDF_Self_from_base( Scheduler_Control *scheduler_base )
    3536{
    36   return _Scheduler.information;
     37  return (Scheduler_EDF_Control *) scheduler_base->information;
    3738}
    3839
    3940RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body(
    40   Thread_Control    *the_thread
     41  Scheduler_Control *scheduler_base,
     42  Thread_Control    *the_thread,
    4143  bool               force_dispatch
    4244)
    4345{
    4446  Scheduler_EDF_Control *scheduler =
    45     _Scheduler_EDF_Instance();
     47    _Scheduler_EDF_Self_from_base( scheduler_base );
    4648  RBTree_Node *first = _RBTree_First(&scheduler->Ready, RBT_LEFT);
    4749  Scheduler_EDF_Per_thread *sched_info =
     
    4951  Thread_Control *heir = (Thread_Control *) sched_info->thread;
    5052
    51   ( void ) thread;
     53  ( void ) the_thread;
    5254
    5355  _Scheduler_Update_heir( heir, force_dispatch );
  • cpukit/score/include/rtems/score/schedulerimpl.h

    r439c494 r24934e36  
    6262 * the scheduler. It does NOT dispatch.
    6363 *
    64  * @param[in] thread The thread which state changed previously.
    65  */
    66 RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *thread )
    67 {
    68   _Scheduler.Operations.schedule( thread );
     64 * @param[in] the_thread The thread which state changed previously.
     65 */
     66RTEMS_INLINE_ROUTINE void _Scheduler_Schedule(
     67  Scheduler_Control *scheduler,
     68  Thread_Control    *the_thread
     69)
     70{
     71  ( *scheduler->Operations.schedule )( scheduler, the_thread );
    6972}
    7073
     
    7578 * of the processor to another thread.
    7679 *
    77  * @param[in] thread The yielding thread.
     80 * @param[in] the_thread The yielding thread.
    7881 */
    7982RTEMS_INLINE_ROUTINE void _Scheduler_Yield(
    80   Thread_Control *thread
    81 )
    82 {
    83   ( *_Scheduler.Operations.yield )( thread );
     83  Scheduler_Control *scheduler,
     84  Thread_Control    *the_thread
     85)
     86{
     87  ( *scheduler->Operations.yield )( scheduler, the_thread );
    8488}
    8589
     
    9397 */
    9498RTEMS_INLINE_ROUTINE void _Scheduler_Block(
    95     Thread_Control    *the_thread
    96 )
    97 {
    98   _Scheduler.Operations.block( the_thread );
     99  Scheduler_Control *scheduler,
     100  Thread_Control    *the_thread
     101)
     102{
     103  ( *scheduler->Operations.block )( scheduler, the_thread );
    99104}
    100105
     
    108113 */
    109114RTEMS_INLINE_ROUTINE void _Scheduler_Unblock(
    110     Thread_Control    *the_thread
    111 )
    112 {
    113   _Scheduler.Operations.unblock( the_thread );
     115  Scheduler_Control *scheduler,
     116  Thread_Control    *the_thread
     117)
     118{
     119  ( *scheduler->Operations.unblock )( scheduler, the_thread );
    114120}
    115121
     
    120126 */
    121127RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate(
    122   Thread_Control    *the_thread
    123 )
    124 {
    125   return _Scheduler.Operations.allocate( the_thread );
     128  Scheduler_Control *scheduler,
     129  Thread_Control    *the_thread
     130)
     131{
     132  return ( *scheduler->Operations.allocate )( scheduler, the_thread );
    126133}
    127134
     
    132139 */
    133140RTEMS_INLINE_ROUTINE void _Scheduler_Free(
    134   Thread_Control    *the_thread
    135 )
    136 {
    137   _Scheduler.Operations.free( the_thread );
     141  Scheduler_Control *scheduler,
     142  Thread_Control    *the_thread
     143)
     144{
     145  ( *scheduler->Operations.free )( scheduler, the_thread );
    138146}
    139147
     
    144152 */
    145153RTEMS_INLINE_ROUTINE void _Scheduler_Update(
    146   Thread_Control    *the_thread
    147 )
    148 {
    149   _Scheduler.Operations.update( the_thread );
     154  Scheduler_Control *scheduler,
     155  Thread_Control    *the_thread
     156)
     157{
     158  ( *scheduler->Operations.update )( scheduler, the_thread );
    150159}
    151160
     
    156165 */
    157166RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
    158   Thread_Control    *the_thread
    159 )
    160 {
    161   _Scheduler.Operations.enqueue( the_thread );
     167  Scheduler_Control *scheduler,
     168  Thread_Control    *the_thread
     169)
     170{
     171  ( *scheduler->Operations.enqueue )( scheduler, the_thread );
    162172}
    163173
     
    168178 */
    169179RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
    170   Thread_Control    *the_thread
    171 )
    172 {
    173   _Scheduler.Operations.enqueue_first( the_thread );
     180  Scheduler_Control *scheduler,
     181  Thread_Control    *the_thread
     182)
     183{
     184  ( *scheduler->Operations.enqueue_first )( scheduler, the_thread );
    174185}
    175186
     
    180191 */
    181192RTEMS_INLINE_ROUTINE void _Scheduler_Extract(
    182   Thread_Control    *the_thread
    183 )
    184 {
    185   _Scheduler.Operations.extract( the_thread );
     193  Scheduler_Control *scheduler,
     194  Thread_Control    *the_thread
     195)
     196{
     197  ( *scheduler->Operations.extract )( scheduler, the_thread );
    186198}
    187199
     
    192204 */
    193205RTEMS_INLINE_ROUTINE int _Scheduler_Priority_compare(
     206  Scheduler_Control *scheduler,
    194207  Priority_Control p1,
    195208  Priority_Control p2
    196209)
    197210{
    198   return _Scheduler.Operations.priority_compare(p1, p2);
     211  return ( *scheduler->Operations.priority_compare )( p1, p2 );
    199212}
    200213
     
    205218 */
    206219RTEMS_INLINE_ROUTINE void _Scheduler_Release_job(
    207   Thread_Control *the_thread,
    208   uint32_t       length
    209 )
    210 {
    211   _Scheduler.Operations.release_job(the_thread, length);
     220  Scheduler_Control *scheduler,
     221  Thread_Control    *the_thread,
     222  uint32_t           length
     223)
     224{
     225  ( *scheduler->Operations.release_job )( scheduler, the_thread, length );
    212226}
    213227
     
    220234 * time-slicing management.
    221235 */
    222 RTEMS_INLINE_ROUTINE void _Scheduler_Tick( void )
    223 {
    224   _Scheduler.Operations.tick();
     236RTEMS_INLINE_ROUTINE void _Scheduler_Tick( Scheduler_Control *scheduler )
     237{
     238  ( *scheduler->Operations.tick )( scheduler );
    225239}
    226240
     
    228242 * @brief Starts the idle thread for a particular processor.
    229243 *
    230  * @param[in,out] thread The idle thread for the processor.
     244 * @param[in,out] the_thread The idle thread for the processor.
    231245 * @parma[in,out] processor The processor for the idle thread.
    232246 *
     
    234248 */
    235249RTEMS_INLINE_ROUTINE void _Scheduler_Start_idle(
    236   Thread_Control *thread,
    237   Per_CPU_Control *processor
    238 )
    239 {
    240   ( *_Scheduler.Operations.start_idle )( thread, processor );
     250  Scheduler_Control *scheduler,
     251  Thread_Control    *the_thread,
     252  Per_CPU_Control   *cpu
     253)
     254{
     255  ( *scheduler->Operations.start_idle )( scheduler, the_thread, cpu );
    241256}
    242257
     
    249264   */
    250265  RTEMS_INLINE_ROUTINE int _Scheduler_Get_affinity(
    251     Thread_Control *thread,
    252     size_t          cpusetsize,
    253     cpu_set_t      *cpuset
     266    Scheduler_Control *scheduler,
     267    Thread_Control    *thread,
     268    size_t             cpusetsize,
     269    cpu_set_t         *cpuset
    254270  )
    255271  {
    256     return (*_Scheduler.Operations.get_affinity)( thread, cpusetsize, cpuset );
     272    return ( *scheduler->Operations.get_affinity )(
     273      scheduler,
     274      thread,
     275      cpusetsize,
     276      cpuset
     277    );
    257278  }
    258279
     
    264285   */
    265286  RTEMS_INLINE_ROUTINE int _Scheduler_Set_affinity(
    266     Thread_Control   *thread,
    267     size_t            cpusetsize,
    268     const cpu_set_t  *cpuset
     287    Scheduler_Control *scheduler,
     288    Thread_Control    *thread,
     289    size_t             cpusetsize,
     290    const cpu_set_t   *cpuset
    269291  )
    270292  {
    271     return (*_Scheduler.Operations.set_affinity)( thread, cpusetsize, cpuset );
     293    return ( *scheduler->Operations.set_affinity )(
     294      scheduler,
     295      thread,
     296      cpusetsize,
     297      cpuset
     298    );
    272299  }
    273300#endif
     
    287314
    288315RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block(
    289   void ( *extract )( Thread_Control *thread ),
    290   void ( *schedule )( Thread_Control *thread, bool force_dispatch ),
    291   Thread_Control *thread
    292 )
    293 {
    294   ( *extract )( thread );
     316  Scheduler_Control *scheduler,
     317  Thread_Control    *the_thread,
     318  void            ( *extract )( Scheduler_Control *, Thread_Control * ),
     319  void            ( *schedule )( Scheduler_Control *, Thread_Control *, bool )
     320)
     321{
     322  ( *extract )( scheduler, the_thread );
    295323
    296324  /* TODO: flash critical section? */
    297325
    298   if ( _Thread_Is_executing( thread ) || _Thread_Is_heir( thread ) ) {
    299     ( *schedule )( thread, true );
     326  if ( _Thread_Is_executing( the_thread ) || _Thread_Is_heir( the_thread ) ) {
     327    ( *schedule )( scheduler, the_thread, true );
    300328  }
    301329}
     
    306334 */
    307335RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_lower_than(
    308   Priority_Control p1,
    309   Priority_Control p2
    310 )
    311 {
    312   return _Scheduler_Priority_compare( p1,  p2 ) < 0;
     336  Scheduler_Control *scheduler,
     337  Priority_Control   p1,
     338  Priority_Control   p2
     339)
     340{
     341  return _Scheduler_Priority_compare( scheduler, p1,  p2 ) < 0;
    313342}
    314343
     
    318347 */
    319348RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_higher_than(
    320   Priority_Control p1,
    321   Priority_Control p2
    322 )
    323 {
    324   return _Scheduler_Priority_compare( p1,  p2 ) > 0;
     349  Scheduler_Control *scheduler,
     350  Priority_Control   p1,
     351  Priority_Control   p2
     352)
     353{
     354  return _Scheduler_Priority_compare( scheduler, p1,  p2 ) > 0;
    325355}
    326356
     
    330360 */
    331361RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Highest_priority_of_two(
    332   Priority_Control p1,
    333   Priority_Control p2
    334 )
    335 {
    336   return _Scheduler_Is_priority_higher_than( p1, p2 ) ? p1 : p2;
     362  Scheduler_Control *scheduler,
     363  Priority_Control   p1,
     364  Priority_Control   p2
     365)
     366{
     367  return _Scheduler_Is_priority_higher_than( scheduler, p1, p2 ) ? p1 : p2;
    337368}
    338369
     
    342373 */
    343374RTEMS_INLINE_ROUTINE void _Scheduler_Set_priority_if_higher(
    344   Thread_Control   *the_thread,
    345   Priority_Control  priority
     375  Scheduler_Control *scheduler,
     376  Thread_Control    *the_thread,
     377  Priority_Control   priority
    346378)
    347379{
    348380  Priority_Control current = the_thread->current_priority;
    349381
    350   if ( _Scheduler_Is_priority_higher_than( priority, current ) ) {
     382  if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) {
    351383    _Thread_Set_priority( the_thread, priority );
    352384  }
     
    358390 */
    359391RTEMS_INLINE_ROUTINE void _Scheduler_Change_priority_if_higher(
    360   Thread_Control   *the_thread,
    361   Priority_Control  priority,
    362   bool              prepend_it
     392  Scheduler_Control *scheduler,
     393  Thread_Control    *the_thread,
     394  Priority_Control   priority,
     395  bool               prepend_it
    363396)
    364397{
    365398  Priority_Control current = the_thread->current_priority;
    366399
    367   if ( _Scheduler_Is_priority_higher_than( priority, current ) ) {
     400  if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) {
    368401    _Thread_Change_priority( the_thread, priority, prepend_it );
    369402  }
    370403}
    371404
     405RTEMS_INLINE_ROUTINE Scheduler_Control *_Scheduler_Get(
     406  Thread_Control *the_thread
     407)
     408{
     409  (void) the_thread;
     410
     411  return &_Scheduler;
     412}
     413
    372414/** @} */
    373415
  • cpukit/score/include/rtems/score/schedulerpriority.h

    r439c494 r24934e36  
    106106 */
    107107void _Scheduler_priority_Block(
     108  Scheduler_Control *scheduler,
    108109  Thread_Control    *the_thread
    109110);
     
    115116 *  by invoking the_scheduler->ready_queue->operations->first().
    116117 */
    117 void _Scheduler_priority_Schedule( Thread_Control *thread );
     118void _Scheduler_priority_Schedule(
     119  Scheduler_Control *scheduler,
     120  Thread_Control    *the_thread
     121);
    118122
    119123/**
     
    126130 */
    127131void * _Scheduler_priority_Allocate(
    128   Thread_Control      *the_thread
     132  Scheduler_Control *scheduler,
     133  Thread_Control    *the_thread
    129134);
    130135
     
    138143 */
    139144void _Scheduler_priority_Free(
    140   Thread_Control      *the_thread
     145  Scheduler_Control *scheduler,
     146  Thread_Control    *the_thread
    141147);
    142148
     
    150156 */
    151157void _Scheduler_priority_Update(
    152   Thread_Control      *the_thread
     158  Scheduler_Control *scheduler,
     159  Thread_Control    *the_thread
    153160);
    154161
     
    163170 */
    164171void _Scheduler_priority_Unblock(
     172  Scheduler_Control *scheduler,
    165173  Thread_Control    *the_thread
    166174);
     
    185193 *  @param[in,out] thread The yielding thread.
    186194 */
    187 void _Scheduler_priority_Yield( Thread_Control *thread );
     195void _Scheduler_priority_Yield(
     196  Scheduler_Control *scheduler,
     197  Thread_Control    *the_thread
     198);
    188199
    189200/**
     
    195206 */
    196207void _Scheduler_priority_Enqueue(
     208  Scheduler_Control *scheduler,
    197209  Thread_Control    *the_thread
    198210);
     
    208220 */
    209221void _Scheduler_priority_Enqueue_first(
     222  Scheduler_Control *scheduler,
    210223  Thread_Control    *the_thread
    211224);
     
    220233 */
    221234void _Scheduler_priority_Extract(
    222   Thread_Control     *the_thread
     235  Scheduler_Control *scheduler,
     236  Thread_Control    *the_thread
    223237);
    224238
     
    229243 */
    230244int _Scheduler_priority_Priority_compare(
    231   Priority_Control      p1,
    232   Priority_Control      p2
     245  Priority_Control   p1,
     246  Priority_Control   p2
    233247);
    234248
  • cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h

    r439c494 r24934e36  
    8282 * @brief Get affinity for the priority affinity smp scheduler.
    8383 *
     84 * @param[in] scheduler The scheduler of the thread.
    8485 * @param[in] thread The associated thread.
    8586 * @param[in] cpusetsize The size of the cpuset.
     
    9091 */
    9192bool _Scheduler_priority_affinity_SMP_Get_affinity(
    92   Thread_Control *thread,
    93   size_t          cpusetsize,
    94   cpu_set_t      *cpuset
     93  Scheduler_Control *scheduler,
     94  Thread_Control    *thread,
     95  size_t             cpusetsize,
     96  cpu_set_t         *cpuset
    9597);
    9698
     
    98100 * @brief Set affinity for the priority affinity smp scheduler.
    99101 *
     102 * @param[in] scheduler The scheduler of the thread.
    100103 * @param[in] thread The associated thread.
    101104 * @param[in] cpusetsize The size of the cpuset.
     
    105108 */
    106109bool _Scheduler_priority_affinity_SMP_Set_affinity(
    107   Thread_Control *thread,
    108   size_t          cpusetsize,
    109   cpu_set_t      *cpuset
     110  Scheduler_Control *scheduler,
     111  Thread_Control    *thread,
     112  size_t             cpusetsize,
     113  cpu_set_t         *cpuset
    110114);
    111115
  • cpukit/score/include/rtems/score/schedulerpriorityimpl.h

    r439c494 r24934e36  
    3737
    3838RTEMS_INLINE_ROUTINE Scheduler_priority_Control *
    39   _Scheduler_priority_Instance( void )
    40 {
    41   return _Scheduler.information;
     39  _Scheduler_priority_Self_from_base( Scheduler_Control *scheduler_base )
     40{
     41  return (Scheduler_priority_Control *) scheduler_base->information;
    4242}
    4343
     
    135135
    136136RTEMS_INLINE_ROUTINE void _Scheduler_priority_Extract_body(
    137   Thread_Control *the_thread
    138 )
    139 {
    140   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     137  Scheduler_Control *scheduler_base,
     138  Thread_Control    *the_thread
     139)
     140{
     141  Scheduler_priority_Control *scheduler =
     142    _Scheduler_priority_Self_from_base( scheduler_base );
    141143
    142144  _Scheduler_priority_Ready_queue_extract( the_thread, &scheduler->Bit_map );
     
    192194 */
    193195RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(
    194   Thread_Control *thread,
    195   bool force_dispatch
    196 )
    197 {
    198   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     196  Scheduler_Control *scheduler_base,
     197  Thread_Control    *the_thread,
     198  bool               force_dispatch
     199)
     200{
     201  Scheduler_priority_Control *scheduler =
     202    _Scheduler_priority_Self_from_base( scheduler_base );
    199203  Thread_Control *heir = _Scheduler_priority_Ready_queue_first(
    200204    &scheduler->Bit_map,
     
    202206  );
    203207
    204   ( void ) thread;
     208  ( void ) the_thread;
    205209
    206210  _Scheduler_Update_heir( heir, force_dispatch );
  • cpukit/score/include/rtems/score/schedulerprioritysmp.h

    r439c494 r24934e36  
    7474void _Scheduler_priority_SMP_Initialize( void );
    7575
    76 void _Scheduler_priority_SMP_Schedule( Thread_Control *thread );
     76void _Scheduler_priority_SMP_Schedule(
     77  Scheduler_Control *base,
     78  Thread_Control *thread
     79);
    7780
    78 void _Scheduler_priority_SMP_Block( Thread_Control *thread );
     81void _Scheduler_priority_SMP_Block(
     82  Scheduler_Control *base,
     83  Thread_Control *thread
     84);
    7985
    80 void _Scheduler_priority_SMP_Update( Thread_Control *thread );
     86void _Scheduler_priority_SMP_Update(
     87  Scheduler_Control *base,
     88  Thread_Control *thread
     89);
    8190
    82 void _Scheduler_priority_SMP_Enqueue_fifo( Thread_Control *thread );
     91void _Scheduler_priority_SMP_Enqueue_fifo(
     92  Scheduler_Control *base,
     93  Thread_Control *thread
     94);
    8395
    84 void _Scheduler_priority_SMP_Enqueue_lifo( Thread_Control *thread );
     96void _Scheduler_priority_SMP_Enqueue_lifo(
     97  Scheduler_Control *base,
     98  Thread_Control *thread
     99);
    85100
    86 void _Scheduler_priority_SMP_Extract( Thread_Control *thread );
     101void _Scheduler_priority_SMP_Extract(
     102  Scheduler_Control *base,
     103  Thread_Control *thread
     104);
    87105
    88 void _Scheduler_priority_SMP_Yield( Thread_Control *thread );
     106void _Scheduler_priority_SMP_Yield(
     107  Scheduler_Control *base,
     108  Thread_Control *thread
     109);
    89110
    90111void _Scheduler_priority_SMP_Start_idle(
     112  Scheduler_Control *base,
    91113  Thread_Control *thread,
    92114  Per_CPU_Control *cpu
  • cpukit/score/include/rtems/score/schedulersimple.h

    r439c494 r24934e36  
    7777 *  information.
    7878 */
    79 void _Scheduler_simple_Schedule( Thread_Control *thread );
     79void _Scheduler_simple_Schedule(
     80  Scheduler_Control *scheduler,
     81  Thread_Control    *the_thread
     82);
    8083
    8184/**
     
    9598 *  @param[in,out] thread The yielding thread.
    9699 */
    97 void _Scheduler_simple_Yield( Thread_Control *thread );
     100void _Scheduler_simple_Yield(
     101  Scheduler_Control *scheduler,
     102  Thread_Control    *the_thread
     103);
    98104
    99105/**
     
    108114 */
    109115void _Scheduler_simple_Block(
    110   Thread_Control *the_thread
     116  Scheduler_Control *scheduler,
     117  Thread_Control    *the_thread
    111118);
    112119
     
    121128 */
    122129void _Scheduler_simple_Unblock(
    123   Thread_Control *the_thread
     130  Scheduler_Control *scheduler,
     131  Thread_Control    *the_thread
    124132);
    125133
     
    133141 */
    134142void _Scheduler_simple_Extract(
    135   Thread_Control *the_thread
     143  Scheduler_Control *scheduler,
     144  Thread_Control    *the_thread
    136145);
    137146
     
    144153 */
    145154void _Scheduler_simple_Enqueue(
    146   Thread_Control *the_thread
     155  Scheduler_Control *scheduler,
     156  Thread_Control    *the_thread
    147157);
    148158
     
    157167 */
    158168void _Scheduler_simple_Enqueue_first(
    159   Thread_Control *the_thread
     169  Scheduler_Control *scheduler,
     170  Thread_Control    *the_thread
    160171);
    161172
     
    169180 */
    170181void _Scheduler_simple_Ready_queue_enqueue(
     182  Scheduler_Control *scheduler,
    171183  Thread_Control    *the_thread
    172184);
     
    182194 */
    183195void _Scheduler_simple_Ready_queue_enqueue_first(
     196  Scheduler_Control *scheduler,
    184197  Thread_Control    *the_thread
    185198);
  • cpukit/score/include/rtems/score/schedulersimpleimpl.h

    r439c494 r24934e36  
    3333/**@{**/
    3434
    35 RTEMS_INLINE_ROUTINE Scheduler_simple_Control *_Scheduler_simple_Instance( void )
     35RTEMS_INLINE_ROUTINE Scheduler_simple_Control *
     36  _Scheduler_simple_Self_from_base( Scheduler_Control *scheduler_base )
    3637{
    37   return _Scheduler.information;
     38  return (Scheduler_simple_Control *) scheduler_base->information;
    3839}
    3940
     
    4546 */
    4647RTEMS_INLINE_ROUTINE void _Scheduler_simple_Ready_queue_requeue(
    47   Scheduler_Control *the_ready_queue,
     48  Scheduler_Control *scheduler,
    4849  Thread_Control    *the_thread
    4950)
     
    5354
    5455  /* enqueue */
    55   _Scheduler_simple_Ready_queue_enqueue( the_thread );
     56  _Scheduler_simple_Ready_queue_enqueue( scheduler, the_thread );
    5657}
    5758
     
    103104
    104105RTEMS_INLINE_ROUTINE void _Scheduler_simple_Schedule_body(
    105   Thread_Control *thread,
    106   bool force_dispatch
     106  Scheduler_Control *scheduler_base,
     107  Thread_Control    *the_thread,
     108  bool               force_dispatch
    107109)
    108110{
    109   Scheduler_simple_Control *scheduler = _Scheduler_simple_Instance();
     111  Scheduler_simple_Control *scheduler =
     112    _Scheduler_simple_Self_from_base( scheduler_base );
    110113  Thread_Control *heir = (Thread_Control *) _Chain_First( &scheduler->Ready );
    111114
    112   ( void ) thread;
     115  ( void ) the_thread;
    113116
    114117  _Scheduler_Update_heir( heir, force_dispatch );
  • cpukit/score/include/rtems/score/schedulersimplesmp.h

    r439c494 r24934e36  
    7676void _Scheduler_simple_smp_Initialize( void );
    7777
    78 void _Scheduler_simple_smp_Block( Thread_Control *thread );
     78void _Scheduler_simple_smp_Block(
     79  Scheduler_Control *base,
     80  Thread_Control *thread
     81);
    7982
    80 void _Scheduler_simple_smp_Enqueue_priority_fifo( Thread_Control *thread );
     83void _Scheduler_simple_smp_Enqueue_priority_fifo(
     84  Scheduler_Control *base,
     85  Thread_Control *thread
     86);
    8187
    82 void _Scheduler_simple_smp_Enqueue_priority_lifo( Thread_Control *thread );
     88void _Scheduler_simple_smp_Enqueue_priority_lifo(
     89  Scheduler_Control *base,
     90  Thread_Control *thread
     91);
    8392
    84 void _Scheduler_simple_smp_Extract( Thread_Control *thread );
     93void _Scheduler_simple_smp_Extract(
     94  Scheduler_Control *base,
     95  Thread_Control *thread
     96);
    8597
    86 void _Scheduler_simple_smp_Yield( Thread_Control *thread );
     98void _Scheduler_simple_smp_Yield(
     99  Scheduler_Control *base,
     100  Thread_Control *thread
     101);
    87102
    88 void _Scheduler_simple_smp_Schedule( Thread_Control *thread );
     103void _Scheduler_simple_smp_Schedule(
     104  Scheduler_Control *base,
     105  Thread_Control *thread
     106);
    89107
    90108void _Scheduler_simple_smp_Start_idle(
     109  Scheduler_Control *base,
    91110  Thread_Control *thread,
    92111  Per_CPU_Control *cpu
  • cpukit/score/include/rtems/score/threadimpl.h

    r439c494 r24934e36  
    177177 *  @param pointer_argument
    178178 *  @param numeric_argument
    179  *  @param[in,out] processor The processor if used to start an idle thread
     179 *  @param[in,out] cpu The processor if used to start an idle thread
    180180 *  during system initialization.  Must be set to @c NULL to start a normal
    181181 *  thread.
     
    187187  void                      *pointer_argument,
    188188  Thread_Entry_numeric_type  numeric_argument,
    189   Per_CPU_Control           *processor
     189  Per_CPU_Control           *cpu
    190190);
    191191
  • cpukit/score/src/coremutexseize.c

    r439c494 r24934e36  
    5454
    5555  if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ) {
     56    Thread_Control *holder = the_mutex->holder;
     57
    5658    _Scheduler_Change_priority_if_higher(
    57       the_mutex->holder,
     59      _Scheduler_Get( holder ),
     60      holder,
    5861      executing->current_priority,
    5962      false
  • cpukit/score/src/schedulercbsallocate.c

    r439c494 r24934e36  
    2727
    2828void *_Scheduler_CBS_Allocate(
    29   Thread_Control      *the_thread
     29  Scheduler_Control *scheduler,
     30  Thread_Control    *the_thread
    3031)
    3132{
    3233  void *sched;
    3334  Scheduler_CBS_Per_thread *schinfo;
     35
     36  (void) scheduler;
    3437
    3538  sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
  • cpukit/score/src/schedulercbsreleasejob.c

    r439c494 r24934e36  
    2525
    2626void _Scheduler_CBS_Release_job(
     27  Scheduler_Control *scheduler,
    2728  Thread_Control    *the_thread,
    2829  uint32_t           deadline
  • cpukit/score/src/schedulercbsunblock.c

    r439c494 r24934e36  
    2626
    2727void _Scheduler_CBS_Unblock(
     28  Scheduler_Control *scheduler,
    2829  Thread_Control    *the_thread
    2930)
     
    3334  Priority_Control new_priority;
    3435
    35   _Scheduler_EDF_Enqueue(the_thread);
     36  _Scheduler_EDF_Enqueue( scheduler, the_thread );
    3637  /* TODO: flash critical section? */
    3738
     
    7475   *    a pseudo-ISR system task, we need to do a context switch.
    7576   */
    76   if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
    77        _Thread_Heir->current_priority)) {
     77  if (
     78    _Scheduler_Is_priority_higher_than(
     79       scheduler,
     80       the_thread->current_priority,
     81       _Thread_Heir->current_priority
     82    )
     83  ) {
    7884    _Thread_Heir = the_thread;
    7985    if ( _Thread_Executing->is_preemptible ||
  • cpukit/score/src/schedulerdefaultallocatefree.c

    r439c494 r24934e36  
    2323
    2424void *_Scheduler_default_Allocate(
    25   Thread_Control *thread
     25  Scheduler_Control *scheduler,
     26  Thread_Control    *the_thread
    2627)
    2728{
    28   ( void ) thread;
     29  ( void ) scheduler;
     30  ( void ) the_thread;
    2931
    3032  return ( void * )-1; /* maybe pick an appropriate poison value */
     
    3234
    3335void _Scheduler_default_Free(
    34   Thread_Control *thread
     36  Scheduler_Control *scheduler,
     37  Thread_Control    *the_thread
    3538)
    3639{
    37   ( void ) thread;
     40  ( void ) scheduler;
     41  ( void ) the_thread;
    3842}
  • cpukit/score/src/schedulerdefaultgetaffinity.c

    r439c494 r24934e36  
    2424
    2525bool _Scheduler_default_Get_affinity(
    26   Thread_Control *thread,
    27   size_t          cpusetsize,
    28   cpu_set_t      *cpuset
     26  Scheduler_Control *scheduler,
     27  Thread_Control    *thread,
     28  size_t             cpusetsize,
     29  cpu_set_t         *cpuset
    2930)
    3031{
    3132  const CPU_set_Control *ctl;
     33
     34  (void) scheduler;
     35  (void) thread;
    3236
    3337  ctl = _CPU_set_Default();
     
    3741
    3842  CPU_COPY( cpuset, ctl->set );
    39  
    40   return true; 
     43
     44  return true;
    4145}
  • cpukit/score/src/schedulerdefaultreleasejob.c

    r439c494 r24934e36  
    2323
    2424void _Scheduler_default_Release_job(
    25   Thread_Control *thread,
    26   uint32_t        deadline
     25  Scheduler_Control *scheduler,
     26  Thread_Control    *the_thread,
     27  uint32_t           deadline
    2728)
    2829{
    29   ( void ) thread;
     30  ( void ) scheduler;
     31  ( void ) the_thread;
    3032  ( void ) deadline;
    3133}
  • cpukit/score/src/schedulerdefaultsetaffinity.c

    r439c494 r24934e36  
    2424
    2525bool _Scheduler_default_Set_affinity(
    26   Thread_Control  *thread,
    27   size_t           cpusetsize,
    28   const cpu_set_t *cpuset
     26  Scheduler_Control *scheduler,
     27  Thread_Control    *thread,
     28  size_t             cpusetsize,
     29  const cpu_set_t   *cpuset
    2930)
    3031{
     32  (void) scheduler;
     33  (void) thread;
     34
    3135  return _CPU_set_Is_valid( cpuset, cpusetsize );
    3236}
  • cpukit/score/src/schedulerdefaultstartidle.c

    r439c494 r24934e36  
    11/*
    2  * Copyright (c) 2013 embedded brains GmbH
     2 * Copyright (c) 2013-2014 embedded brains GmbH
    33 *
    44 * The license and distribution terms for this file may be
     
    1414
    1515void _Scheduler_default_Start_idle(
    16   Thread_Control  *thread,
    17   Per_CPU_Control *processor
     16  Scheduler_Control *scheduler,
     17  Thread_Control    *the_thread,
     18  Per_CPU_Control   *cpu
    1819)
    1920{
    20   (void) processor;
    21   _Scheduler_Unblock( thread );
     21  (void) cpu;
     22  _Scheduler_Unblock( scheduler, the_thread );
    2223}
  • cpukit/score/src/schedulerdefaulttick.c

    r439c494 r24934e36  
    2424#include <rtems/score/smp.h>
    2525
    26 static void _Scheduler_default_Tick_for_executing( Thread_Control *executing )
     26static void _Scheduler_default_Tick_for_executing(
     27  Scheduler_Control *scheduler,
     28  Thread_Control *executing
     29)
    2730{
    2831  #ifdef __RTEMS_USE_TICKS_FOR_STATISTICS__
     
    6669         *  FIFO for this priority and a new heir is selected.
    6770         */
    68         _Scheduler_Yield( executing );
     71        _Scheduler_Yield( scheduler, executing );
    6972        executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
    7073      }
     
    8083}
    8184
    82 void _Scheduler_default_Tick( void )
     85void _Scheduler_default_Tick( Scheduler_Control *scheduler )
    8386{
    8487  uint32_t processor_count = _SMP_Get_processor_count();
     
    8891    const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( processor );
    8992
    90     _Scheduler_default_Tick_for_executing( per_cpu->executing );
     93    _Scheduler_default_Tick_for_executing( scheduler, per_cpu->executing );
    9194  }
    9295}
  • cpukit/score/src/schedulerdefaultupdate.c

    r439c494 r24934e36  
    2323
    2424void _Scheduler_default_Update(
    25   Thread_Control *thread
     25  Scheduler_Control *scheduler,
     26  Thread_Control    *the_thread
    2627)
    2728{
    28   ( void ) thread;
     29  ( void ) scheduler;
     30  ( void ) the_thread;
    2931}
  • cpukit/score/src/scheduleredf.c

    r439c494 r24934e36  
    3939   * but priorities have an opposite sense.
    4040   */
    41   return (-1)*_Scheduler_Priority_compare(value1, value2);
     41  return (-1)*_Scheduler_EDF_Priority_compare(value1, value2);
    4242}
    4343
  • cpukit/score/src/scheduleredfallocate.c

    r439c494 r24934e36  
    2626
    2727void *_Scheduler_EDF_Allocate(
    28   Thread_Control      *the_thread
     28  Scheduler_Control *scheduler,
     29  Thread_Control    *the_thread
    2930)
    3031{
    3132  void *sched;
    3233  Scheduler_EDF_Per_thread *schinfo;
     34
     35  (void) scheduler;
    3336
    3437  sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
  • cpukit/score/src/scheduleredfblock.c

    r439c494 r24934e36  
    2323
    2424void _Scheduler_EDF_Block(
     25  Scheduler_Control *scheduler,
    2526  Thread_Control    *the_thread
    2627)
    2728{
    2829  _Scheduler_Generic_block(
     30    scheduler,
     31    the_thread,
    2932    _Scheduler_EDF_Extract,
    30     _Scheduler_EDF_Schedule_body,
    31     the_thread
     33    _Scheduler_EDF_Schedule_body
    3234  );
    3335}
  • cpukit/score/src/scheduleredfenqueue.c

    r439c494 r24934e36  
    2222
    2323void _Scheduler_EDF_Enqueue(
     24  Scheduler_Control *scheduler_base,
    2425  Thread_Control    *the_thread
    2526)
    2627{
    2728  Scheduler_EDF_Control *scheduler =
    28     _Scheduler_EDF_Instance();
     29    _Scheduler_EDF_Self_from_base( scheduler_base );
    2930  Scheduler_EDF_Per_thread *sched_info =
    3031    (Scheduler_EDF_Per_thread*) the_thread->scheduler_info;
  • cpukit/score/src/scheduleredfenqueuefirst.c

    r439c494 r24934e36  
    2525
    2626void _Scheduler_EDF_Enqueue_first(
     27  Scheduler_Control *scheduler,
    2728  Thread_Control    *the_thread
    2829)
    2930{
    30   _Scheduler_EDF_Enqueue(the_thread);
     31  _Scheduler_EDF_Enqueue( scheduler, the_thread );
    3132}
  • cpukit/score/src/scheduleredfextract.c

    r439c494 r24934e36  
    2222
    2323void _Scheduler_EDF_Extract(
    24   Thread_Control     *the_thread
     24  Scheduler_Control *scheduler_base,
     25  Thread_Control    *the_thread
    2526)
    2627{
    2728  Scheduler_EDF_Control *scheduler =
    28     _Scheduler_EDF_Instance();
     29    _Scheduler_EDF_Self_from_base( scheduler_base );
    2930  Scheduler_EDF_Per_thread *sched_info =
    3031    (Scheduler_EDF_Per_thread*) the_thread->scheduler_info;
  • cpukit/score/src/scheduleredffree.c

    r439c494 r24934e36  
    2727
    2828void _Scheduler_EDF_Free(
    29   Thread_Control      *the_thread
     29  Scheduler_Control *scheduler,
     30  Thread_Control    *the_thread
    3031)
    3132{
     33  (void) scheduler;
     34
    3235  _Workspace_Free( the_thread->scheduler_info );
    3336}
  • cpukit/score/src/scheduleredfreleasejob.c

    r439c494 r24934e36  
    2424
    2525void _Scheduler_EDF_Release_job(
     26  Scheduler_Control *scheduler,
    2627  Thread_Control    *the_thread,
    2728  uint32_t           deadline
     
    2930{
    3031  Priority_Control new_priority;
     32
     33  (void) scheduler;
    3134
    3235  if (deadline) {
  • cpukit/score/src/scheduleredfschedule.c

    r439c494 r24934e36  
    2121#include <rtems/score/scheduleredfimpl.h>
    2222
    23 void _Scheduler_EDF_Schedule( Thread_Control *thread )
     23void _Scheduler_EDF_Schedule(
     24  Scheduler_Control *scheduler,
     25  Thread_Control    *the_thread
     26)
    2427{
    25   _Scheduler_EDF_Schedule_body( thread, false );
     28  _Scheduler_EDF_Schedule_body( scheduler, the_thread, false );
    2629}
  • cpukit/score/src/scheduleredfunblock.c

    r439c494 r24934e36  
    2424
    2525void _Scheduler_EDF_Unblock(
     26  Scheduler_Control *scheduler,
    2627  Thread_Control    *the_thread
    2728)
    2829{
    29   _Scheduler_EDF_Enqueue(the_thread);
     30  _Scheduler_EDF_Enqueue( scheduler, the_thread);
    3031  /* TODO: flash critical section? */
    3132
     
    4344   */
    4445  if ( _Scheduler_Is_priority_lower_than(
     46         scheduler,
    4547         _Thread_Heir->current_priority,
    4648         the_thread->current_priority )) {
  • cpukit/score/src/scheduleredfupdate.c

    r439c494 r24934e36  
    2727
    2828void _Scheduler_EDF_Update(
    29   Thread_Control      *the_thread
     29  Scheduler_Control *scheduler,
     30  Thread_Control    *the_thread
    3031)
    3132{
    3233  Scheduler_EDF_Per_thread *sched_info =
    3334    (Scheduler_EDF_Per_thread*)the_thread->scheduler_info;
     35
     36  (void) scheduler;
    3437
    3538  if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) {
  • cpukit/score/src/scheduleredfyield.c

    r439c494 r24934e36  
    2222#include <rtems/score/scheduleredfimpl.h>
    2323
    24 void _Scheduler_EDF_Yield( Thread_Control *thread )
     24void _Scheduler_EDF_Yield(
     25  Scheduler_Control *scheduler_base,
     26  Thread_Control    *the_thread
     27)
    2528{
    2629  Scheduler_EDF_Control *scheduler =
    27     _Scheduler_EDF_Instance();
     30    _Scheduler_EDF_Self_from_base( scheduler_base );
    2831  ISR_Level              level;
    2932
    3033  Scheduler_EDF_Per_thread *thread_info =
    31     (Scheduler_EDF_Per_thread *) thread->scheduler_info;
     34    (Scheduler_EDF_Per_thread *) the_thread->scheduler_info;
    3235  RBTree_Node *thread_node = &(thread_info->Node);
    3336
     
    4346  _ISR_Flash( level );
    4447
    45   _Scheduler_EDF_Schedule_body( thread, false );
     48  _Scheduler_EDF_Schedule_body( scheduler_base, the_thread, false );
    4649
    4750  _ISR_Enable( level );
  • cpukit/score/src/schedulerpriorityaffinitysmp.c

    r439c494 r24934e36  
    3232}
    3333
    34 void * _Scheduler_priority_affinity_SMP_Allocate( Thread_Control *the_thread )
     34void * _Scheduler_priority_affinity_SMP_Allocate(
     35  Scheduler_Control *scheduler,
     36  Thread_Control    *the_thread
     37)
    3538{
    3639  Scheduler_priority_affinity_SMP_Per_thread *info =
     
    4649
    4750bool _Scheduler_priority_affinity_SMP_Get_affinity(
    48   Thread_Control *thread,
    49   size_t          cpusetsize,
    50   cpu_set_t      *cpuset
     51  Scheduler_Control *scheduler,
     52  Thread_Control    *thread,
     53  size_t             cpusetsize,
     54  cpu_set_t         *cpuset
    5155)
    5256{
    5357  Scheduler_priority_affinity_SMP_Per_thread *info =
    5458    _Scheduler_priority_affinity_Get_scheduler_info(thread);
     59
     60  (void) scheduler;
    5561
    5662  if ( info->Affinity.setsize != cpusetsize ) {
     
    6369
    6470bool _Scheduler_priority_affinity_SMP_Set_affinity(
    65   Thread_Control *thread,
    66   size_t          cpusetsize,
    67   cpu_set_t      *cpuset
     71  Scheduler_Control *scheduler,
     72  Thread_Control    *thread,
     73  size_t             cpusetsize,
     74  cpu_set_t         *cpuset
    6875)
    6976{
    7077  Scheduler_priority_affinity_SMP_Per_thread *info =
    7178    _Scheduler_priority_affinity_Get_scheduler_info(thread);
     79
     80  (void) scheduler;
    7281 
    7382  if ( ! _CPU_set_Is_valid( cpuset, cpusetsize ) ) {
  • cpukit/score/src/schedulerpriorityallocate.c

    r439c494 r24934e36  
    2424
    2525void *_Scheduler_priority_Allocate (
    26   Thread_Control        *the_thread
     26  Scheduler_Control *scheduler,
     27  Thread_Control    *the_thread
    2728)
    2829{
     
    3031    _Workspace_Allocate( sizeof( *sched_info_of_thread ) );
    3132
     33  (void) scheduler;
     34
    3235  the_thread->scheduler_info = sched_info_of_thread;
    3336
  • cpukit/score/src/schedulerpriorityblock.c

    r439c494 r24934e36  
    2323#include <rtems/score/schedulerpriorityimpl.h>
    2424
    25 void _Scheduler_priority_Block( Thread_Control *the_thread )
     25void _Scheduler_priority_Block(
     26  Scheduler_Control *scheduler,
     27  Thread_Control    *the_thread
     28)
    2629{
    2730  _Scheduler_Generic_block(
     31    scheduler,
     32    the_thread,
    2833    _Scheduler_priority_Extract_body,
    29     _Scheduler_priority_Schedule_body,
    30     the_thread
     34    _Scheduler_priority_Schedule_body
    3135  );
    3236}
  • cpukit/score/src/schedulerpriorityenqueue.c

    r439c494 r24934e36  
    2222
    2323void _Scheduler_priority_Enqueue(
    24   Thread_Control      *the_thread
     24  Scheduler_Control *base,
     25  Thread_Control    *the_thread
    2526)
    2627{
    27   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     28  Scheduler_priority_Control *scheduler =
     29    _Scheduler_priority_Self_from_base( base );
    2830
    2931  _Scheduler_priority_Ready_queue_enqueue( the_thread, &scheduler->Bit_map );
  • cpukit/score/src/schedulerpriorityenqueuefirst.c

    r439c494 r24934e36  
    2222
    2323void _Scheduler_priority_Enqueue_first(
    24   Thread_Control      *the_thread
     24  Scheduler_Control *base,
     25  Thread_Control    *the_thread
    2526)
    2627{
    27   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     28  Scheduler_priority_Control *self =
     29    _Scheduler_priority_Self_from_base( base );
    2830
    2931  _Scheduler_priority_Ready_queue_enqueue_first(
    3032    the_thread,
    31     &scheduler->Bit_map
     33    &self->Bit_map
    3234  );
    3335}
  • cpukit/score/src/schedulerpriorityextract.c

    r439c494 r24934e36  
    2222#include <rtems/score/schedulerpriorityimpl.h>
    2323
    24 void _Scheduler_priority_Extract( Thread_Control *the_thread )
     24void _Scheduler_priority_Extract(
     25  Scheduler_Control *base,
     26  Thread_Control    *the_thread
     27)
    2528{
    26   _Scheduler_priority_Extract_body( the_thread );
     29  _Scheduler_priority_Extract_body( base, the_thread );
    2730}
  • cpukit/score/src/schedulerpriorityfree.c

    r439c494 r24934e36  
    2626
    2727void _Scheduler_priority_Free (
     28  Scheduler_Control *base,
    2829  Thread_Control    *the_thread
    2930)
    3031{
     32  (void) base;
     33
    3134  _Workspace_Free( the_thread->scheduler_info );
    3235}
  • cpukit/score/src/schedulerpriorityprioritycompare.c

    r439c494 r24934e36  
    2222
    2323int _Scheduler_priority_Priority_compare(
    24   Priority_Control      p1,
    25   Priority_Control      p2
     24  Priority_Control   p1,
     25  Priority_Control   p2
    2626)
    2727{
  • cpukit/score/src/schedulerpriorityschedule.c

    r439c494 r24934e36  
    2121#include <rtems/score/schedulerpriorityimpl.h>
    2222
    23 void _Scheduler_priority_Schedule( Thread_Control *thread )
     23void _Scheduler_priority_Schedule(
     24  Scheduler_Control *base,
     25  Thread_Control    *the_thread
     26)
    2427{
    25   _Scheduler_priority_Schedule_body( thread, false );
     28  _Scheduler_priority_Schedule_body( base, the_thread, false );
    2629}
  • cpukit/score/src/schedulerprioritysmp.c

    r439c494 r24934e36  
    3030#include <rtems/score/wkspace.h>
    3131
    32 static Scheduler_priority_SMP_Control *_Scheduler_priority_SMP_Instance( void )
    33 {
    34   return _Scheduler.information;
    35 }
    36 
    3732static Scheduler_priority_SMP_Control *
    38 _Scheduler_priority_SMP_Self_from_SMP_base( Scheduler_SMP_Control *base )
     33_Scheduler_priority_SMP_Self_from_base( Scheduler_Control *base )
     34{
     35  return (Scheduler_priority_SMP_Control *) base->information;
     36}
     37
     38static Scheduler_priority_SMP_Control *
     39_Scheduler_priority_SMP_Self_from_SMP_base( Scheduler_SMP_Control *smp_base )
    3940{
    4041  return (Scheduler_priority_SMP_Control *)
    41     ( (char *) base
     42    ( (char *) smp_base
    4243      - offsetof( Scheduler_priority_SMP_Control, Base ) );
    4344}
     
    5657}
    5758
    58 void _Scheduler_priority_SMP_Update( Thread_Control *thread )
    59 {
    60   Scheduler_priority_SMP_Control *self = _Scheduler_priority_SMP_Instance();
     59void _Scheduler_priority_SMP_Update(
     60  Scheduler_Control *base,
     61  Thread_Control *thread
     62)
     63{
     64  Scheduler_priority_SMP_Control *self =
     65    _Scheduler_priority_SMP_Self_from_base( base );
    6166
    6267  _Scheduler_priority_Update_body(
     
    6873
    6974static Thread_Control *_Scheduler_priority_SMP_Get_highest_ready(
    70   Scheduler_SMP_Control *base
    71 )
    72 {
    73   Scheduler_priority_SMP_Control *self =
    74     _Scheduler_priority_SMP_Self_from_SMP_base( base );
     75  Scheduler_SMP_Control *smp_base
     76)
     77{
     78  Scheduler_priority_SMP_Control *self =
     79    _Scheduler_priority_SMP_Self_from_SMP_base( smp_base );
    7580  Thread_Control *highest_ready = NULL;
    7681
     
    8691
    8792static void _Scheduler_priority_SMP_Move_from_scheduled_to_ready(
    88   Scheduler_SMP_Control *base,
     93  Scheduler_SMP_Control *smp_base,
    8994  Thread_Control *scheduled_to_ready
    9095)
    9196{
    9297  Scheduler_priority_SMP_Control *self =
    93     _Scheduler_priority_SMP_Self_from_SMP_base( base );
     98    _Scheduler_priority_SMP_Self_from_SMP_base( smp_base );
    9499
    95100  _Chain_Extract_unprotected( &scheduled_to_ready->Object.Node );
     
    101106
    102107static void _Scheduler_priority_SMP_Move_from_ready_to_scheduled(
    103   Scheduler_SMP_Control *base,
     108  Scheduler_SMP_Control *smp_base,
    104109  Thread_Control *ready_to_scheduled
    105110)
    106111{
    107112  Scheduler_priority_SMP_Control *self =
    108     _Scheduler_priority_SMP_Self_from_SMP_base( base );
     113    _Scheduler_priority_SMP_Self_from_SMP_base( smp_base );
    109114
    110115  _Scheduler_priority_Ready_queue_extract(
     
    119124
    120125static void _Scheduler_priority_SMP_Insert_ready_lifo(
    121   Scheduler_SMP_Control *base,
    122   Thread_Control *thread
    123 )
    124 {
    125   Scheduler_priority_SMP_Control *self =
    126     _Scheduler_priority_SMP_Self_from_SMP_base( base );
     126  Scheduler_SMP_Control *smp_base,
     127  Thread_Control *thread
     128)
     129{
     130  Scheduler_priority_SMP_Control *self =
     131    _Scheduler_priority_SMP_Self_from_SMP_base( smp_base );
    127132
    128133  _Scheduler_priority_Ready_queue_enqueue( thread, &self->Bit_map );
     
    130135
    131136static void _Scheduler_priority_SMP_Insert_ready_fifo(
    132   Scheduler_SMP_Control *base,
    133   Thread_Control *thread
    134 )
    135 {
    136   Scheduler_priority_SMP_Control *self =
    137     _Scheduler_priority_SMP_Self_from_SMP_base( base );
     137  Scheduler_SMP_Control *smp_base,
     138  Thread_Control *thread
     139)
     140{
     141  Scheduler_priority_SMP_Control *self =
     142    _Scheduler_priority_SMP_Self_from_SMP_base( smp_base );
    138143
    139144  _Scheduler_priority_Ready_queue_enqueue_first( thread, &self->Bit_map );
     
    141146
    142147static void _Scheduler_priority_SMP_Do_extract(
    143   Scheduler_SMP_Control *base,
    144   Thread_Control *thread
    145 )
    146 {
    147   Scheduler_priority_SMP_Control *self =
    148     _Scheduler_priority_SMP_Self_from_SMP_base( base );
     148  Scheduler_SMP_Control *smp_base,
     149  Thread_Control *thread
     150)
     151{
     152  Scheduler_priority_SMP_Control *self =
     153    _Scheduler_priority_SMP_Self_from_SMP_base( smp_base );
    149154  bool is_scheduled = thread->is_scheduled;
    150155
     
    159164}
    160165
    161 void _Scheduler_priority_SMP_Block( Thread_Control *thread )
    162 {
    163   Scheduler_priority_SMP_Control *self = _Scheduler_priority_SMP_Instance();
     166void _Scheduler_priority_SMP_Block(
     167  Scheduler_Control *base,
     168  Thread_Control *thread
     169)
     170{
     171  Scheduler_priority_SMP_Control *self =
     172    _Scheduler_priority_SMP_Self_from_base( base );
    164173
    165174  _Scheduler_SMP_Block(
     
    192201}
    193202
    194 void _Scheduler_priority_SMP_Enqueue_lifo( Thread_Control *thread )
    195 {
    196   Scheduler_priority_SMP_Control *self = _Scheduler_priority_SMP_Instance();
     203void _Scheduler_priority_SMP_Enqueue_lifo(
     204  Scheduler_Control *base,
     205  Thread_Control *thread
     206)
     207{
     208  Scheduler_priority_SMP_Control *self =
     209    _Scheduler_priority_SMP_Self_from_base( base );
    197210
    198211  _Scheduler_priority_SMP_Enqueue_ordered(
     
    205218}
    206219
    207 void _Scheduler_priority_SMP_Enqueue_fifo( Thread_Control *thread )
    208 {
    209   Scheduler_priority_SMP_Control *self = _Scheduler_priority_SMP_Instance();
     220void _Scheduler_priority_SMP_Enqueue_fifo(
     221  Scheduler_Control *base,
     222  Thread_Control *thread
     223)
     224{
     225  Scheduler_priority_SMP_Control *self =
     226    _Scheduler_priority_SMP_Self_from_base( base );
    210227
    211228  _Scheduler_priority_SMP_Enqueue_ordered(
     
    218235}
    219236
    220 void _Scheduler_priority_SMP_Extract( Thread_Control *thread )
    221 {
    222   Scheduler_priority_SMP_Control *self = _Scheduler_priority_SMP_Instance();
     237void _Scheduler_priority_SMP_Extract(
     238  Scheduler_Control *base,
     239  Thread_Control *thread
     240)
     241{
     242  Scheduler_priority_SMP_Control *self =
     243    _Scheduler_priority_SMP_Self_from_base( base );
    223244
    224245  _Scheduler_SMP_Extract(
     
    229250}
    230251
    231 void _Scheduler_priority_SMP_Yield( Thread_Control *thread )
     252void _Scheduler_priority_SMP_Yield(
     253  Scheduler_Control *base,
     254  Thread_Control *thread
     255)
    232256{
    233257  ISR_Level level;
     
    235259  _ISR_Disable( level );
    236260
    237   _Scheduler_priority_SMP_Extract( thread );
    238   _Scheduler_priority_SMP_Enqueue_fifo( thread );
     261  _Scheduler_priority_SMP_Extract( base, thread );
     262  _Scheduler_priority_SMP_Enqueue_fifo( base, thread );
    239263
    240264  _ISR_Enable( level );
    241265}
    242266
    243 void _Scheduler_priority_SMP_Schedule( Thread_Control *thread )
    244 {
    245   Scheduler_priority_SMP_Control *self = _Scheduler_priority_SMP_Instance();
     267void _Scheduler_priority_SMP_Schedule(
     268  Scheduler_Control *base,
     269  Thread_Control *thread
     270)
     271{
     272  Scheduler_priority_SMP_Control *self =
     273    _Scheduler_priority_SMP_Self_from_base( base );
    246274
    247275  _Scheduler_SMP_Schedule(
     
    254282
    255283void _Scheduler_priority_SMP_Start_idle(
     284  Scheduler_Control *base,
    256285  Thread_Control *thread,
    257286  Per_CPU_Control *cpu
    258287)
    259288{
    260   Scheduler_priority_SMP_Control *self = _Scheduler_priority_SMP_Instance();
     289  Scheduler_priority_SMP_Control *self =
     290    _Scheduler_priority_SMP_Self_from_base( base );
    261291
    262292  _Scheduler_SMP_Start_idle( &self->Base, thread, cpu );
  • cpukit/score/src/schedulerpriorityunblock.c

    r439c494 r24934e36  
    2424
    2525void _Scheduler_priority_Unblock (
    26   Thread_Control          *the_thread
     26  Scheduler_Control *base,
     27  Thread_Control    *the_thread
    2728)
    2829{
    29   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     30  Scheduler_priority_Control *self =
     31    _Scheduler_priority_Self_from_base( base );
    3032
    31   _Scheduler_priority_Ready_queue_enqueue( the_thread, &scheduler->Bit_map );
     33  _Scheduler_priority_Ready_queue_enqueue( the_thread, &self->Bit_map );
    3234
    3335  /* TODO: flash critical section? */
  • cpukit/score/src/schedulerpriorityupdate.c

    r439c494 r24934e36  
    2020
    2121#include <rtems/score/schedulerpriorityimpl.h>
    22 #include <rtems/score/thread.h>
    2322
    2423void _Scheduler_priority_Update(
     24  Scheduler_Control *base,
    2525  Thread_Control    *the_thread
    2626)
    2727{
    28   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     28  Scheduler_priority_Control *self =
     29    _Scheduler_priority_Self_from_base( base );
    2930
    3031  _Scheduler_priority_Update_body(
    3132    the_thread,
    32     &scheduler->Bit_map,
    33     &scheduler->Ready[ 0 ]
     33    &self->Bit_map,
     34    &self->Ready[ 0 ]
    3435  );
    3536}
  • cpukit/score/src/schedulerpriorityyield.c

    r439c494 r24934e36  
    2323#include <rtems/score/threadimpl.h>
    2424
    25 void _Scheduler_priority_Yield( Thread_Control *thread )
     25void _Scheduler_priority_Yield(
     26  Scheduler_Control *base,
     27  Thread_Control    *the_thread
     28)
    2629{
    2730  Scheduler_priority_Per_thread *sched_info_of_thread =
    28     _Scheduler_priority_Get_scheduler_info( thread );
     31    _Scheduler_priority_Get_scheduler_info( the_thread );
    2932  Chain_Control *ready_chain = sched_info_of_thread->ready_chain;
    3033  ISR_Level level;
    3134
     35  (void) base;
     36
    3237  _ISR_Disable( level );
    3338    if ( !_Chain_Has_only_one_node( ready_chain ) ) {
    34       _Chain_Extract_unprotected( &thread->Object.Node );
    35       _Chain_Append_unprotected( ready_chain, &thread->Object.Node );
     39      _Chain_Extract_unprotected( &the_thread->Object.Node );
     40      _Chain_Append_unprotected( ready_chain, &the_thread->Object.Node );
    3641
    3742      _ISR_Flash( level );
    3843
    39       if ( _Thread_Is_heir( thread ) )
     44      if ( _Thread_Is_heir( the_thread ) )
    4045        _Thread_Heir = (Thread_Control *) _Chain_First( ready_chain );
    4146      _Thread_Dispatch_necessary = true;
    4247    }
    43     else if ( !_Thread_Is_heir( thread ) )
     48    else if ( !_Thread_Is_heir( the_thread ) )
    4449      _Thread_Dispatch_necessary = true;
    4550
  • cpukit/score/src/schedulersimpleblock.c

    r439c494 r24934e36  
    2323
    2424void _Scheduler_simple_Block(
    25   Thread_Control   *the_thread
     25  Scheduler_Control *scheduler,
     26  Thread_Control    *the_thread
    2627)
    2728{
    2829  _Scheduler_Generic_block(
     30    scheduler,
     31    the_thread,
    2932    _Scheduler_simple_Extract,
    30     _Scheduler_simple_Schedule_body,
    31     the_thread
     33    _Scheduler_simple_Schedule_body
    3234  );
    3335}
  • cpukit/score/src/schedulersimpleenqueue.c

    r439c494 r24934e36  
    2727
    2828void _Scheduler_simple_Enqueue(
    29   Thread_Control            *the_thread
     29  Scheduler_Control *scheduler,
     30  Thread_Control    *the_thread
    3031)
    3132{
    32   _Scheduler_simple_Ready_queue_enqueue( the_thread );
     33  _Scheduler_simple_Ready_queue_enqueue( scheduler, the_thread );
    3334}
  • cpukit/score/src/schedulersimpleenqueuefirst.c

    r439c494 r24934e36  
    2525
    2626void _Scheduler_simple_Enqueue_first(
    27   Thread_Control            *the_thread
     27  Scheduler_Control *scheduler,
     28  Thread_Control    *the_thread
    2829)
    2930{
    30   _Scheduler_simple_Ready_queue_enqueue_first( the_thread );
     31  _Scheduler_simple_Ready_queue_enqueue_first( scheduler, the_thread );
    3132}
  • cpukit/score/src/schedulersimpleextract.c

    r439c494 r24934e36  
    2525
    2626void _Scheduler_simple_Extract(
     27  Scheduler_Control *scheduler,
    2728  Thread_Control    *the_thread
    2829)
    2930{
     31  (void) scheduler;
     32
    3033  _Chain_Extract_unprotected( &the_thread->Object.Node );
    3134}
  • cpukit/score/src/schedulersimplereadyqueueenqueue.c

    r439c494 r24934e36  
    2222
    2323void _Scheduler_simple_Ready_queue_enqueue(
     24  Scheduler_Control *scheduler_base,
    2425  Thread_Control    *the_thread
    2526)
    2627{
    2728  Scheduler_simple_Control *scheduler =
    28     _Scheduler_simple_Instance();
     29    _Scheduler_simple_Self_from_base( scheduler_base );
    2930
    3031  _Scheduler_simple_Insert_priority_fifo( &scheduler->Ready, the_thread );
  • cpukit/score/src/schedulersimplereadyqueueenqueuefirst.c

    r439c494 r24934e36  
    2222
    2323void _Scheduler_simple_Ready_queue_enqueue_first(
     24  Scheduler_Control *scheduler_base,
    2425  Thread_Control    *the_thread
    2526)
    2627{
    2728  Scheduler_simple_Control *scheduler =
    28     _Scheduler_simple_Instance();
     29    _Scheduler_simple_Self_from_base( scheduler_base );
    2930
    3031  _Scheduler_simple_Insert_priority_lifo( &scheduler->Ready, the_thread );
  • cpukit/score/src/schedulersimpleschedule.c

    r439c494 r24934e36  
    2121#include <rtems/score/schedulersimpleimpl.h>
    2222
    23 void _Scheduler_simple_Schedule( Thread_Control *thread )
     23void _Scheduler_simple_Schedule(
     24  Scheduler_Control *scheduler,
     25  Thread_Control    *the_thread
     26)
    2427{
    25   _Scheduler_simple_Schedule_body( thread, false );
     28  _Scheduler_simple_Schedule_body( scheduler, the_thread, false );
    2629}
  • cpukit/score/src/schedulersimplesmp.c

    r439c494 r24934e36  
    2323#include <rtems/score/wkspace.h>
    2424
    25 static Scheduler_simple_SMP_Control *_Scheduler_simple_SMP_Instance( void )
    26 {
    27   return _Scheduler.information;
    28 }
    29 
    3025static Scheduler_simple_SMP_Control *
    31 _Scheduler_simple_SMP_Self_from_SMP_base( Scheduler_SMP_Control *base )
     26_Scheduler_simple_SMP_Self_from_base( Scheduler_Control *base )
     27{
     28  return (Scheduler_simple_SMP_Control *) base->information;
     29}
     30
     31static Scheduler_simple_SMP_Control *
     32_Scheduler_simple_SMP_Self_from_SMP_base( Scheduler_SMP_Control *smp_base )
    3233{
    3334  return (Scheduler_simple_SMP_Control *)
    34     ( (char *) base - offsetof( Scheduler_simple_SMP_Control, Base ) );
     35    ( (char *) smp_base - offsetof( Scheduler_simple_SMP_Control, Base ) );
    3536}
    3637
     
    4748
    4849static Thread_Control *_Scheduler_simple_smp_Get_highest_ready(
    49   Scheduler_SMP_Control *base
    50 )
    51 {
    52   Scheduler_simple_SMP_Control *self =
    53     _Scheduler_simple_SMP_Self_from_SMP_base( base );
     50  Scheduler_SMP_Control *smp_base
     51)
     52{
     53  Scheduler_simple_SMP_Control *self =
     54    _Scheduler_simple_SMP_Self_from_SMP_base( smp_base );
    5455  Thread_Control *highest_ready = NULL;
    5556  Chain_Control *ready = &self->Ready;
     
    6364
    6465static void _Scheduler_simple_smp_Move_from_scheduled_to_ready(
    65   Scheduler_SMP_Control *base,
     66  Scheduler_SMP_Control *smp_base,
    6667  Thread_Control *scheduled_to_ready
    6768)
    6869{
    6970  Scheduler_simple_SMP_Control *self =
    70     _Scheduler_simple_SMP_Self_from_SMP_base( base );
     71    _Scheduler_simple_SMP_Self_from_SMP_base( smp_base );
    7172
    7273  _Chain_Extract_unprotected( &scheduled_to_ready->Object.Node );
     
    7879
    7980static void _Scheduler_simple_smp_Move_from_ready_to_scheduled(
    80   Scheduler_SMP_Control *base,
     81  Scheduler_SMP_Control *smp_base,
    8182  Thread_Control *ready_to_scheduled
    8283)
     
    8485  _Chain_Extract_unprotected( &ready_to_scheduled->Object.Node );
    8586  _Scheduler_simple_Insert_priority_fifo(
    86     &base->Scheduled,
     87    &smp_base->Scheduled,
    8788    ready_to_scheduled
    8889  );
     
    9091
    9192static void _Scheduler_simple_smp_Insert_ready_lifo(
    92   Scheduler_SMP_Control *base,
    93   Thread_Control *thread
    94 )
    95 {
    96   Scheduler_simple_SMP_Control *self =
    97     _Scheduler_simple_SMP_Self_from_SMP_base( base );
     93  Scheduler_SMP_Control *smp_base,
     94  Thread_Control *thread
     95)
     96{
     97  Scheduler_simple_SMP_Control *self =
     98    _Scheduler_simple_SMP_Self_from_SMP_base( smp_base );
    9899
    99100  _Chain_Insert_ordered_unprotected(
     
    105106
    106107static void _Scheduler_simple_smp_Insert_ready_fifo(
    107   Scheduler_SMP_Control *base,
    108   Thread_Control *thread
    109 )
    110 {
    111   Scheduler_simple_SMP_Control *self =
    112     _Scheduler_simple_SMP_Self_from_SMP_base( base );
     108  Scheduler_SMP_Control *smp_base,
     109  Thread_Control *thread
     110)
     111{
     112  Scheduler_simple_SMP_Control *self =
     113    _Scheduler_simple_SMP_Self_from_SMP_base( smp_base );
    113114
    114115  _Chain_Insert_ordered_unprotected(
     
    120121
    121122static void _Scheduler_simple_smp_Do_extract(
    122   Scheduler_SMP_Control *base,
    123   Thread_Control *thread
    124 )
    125 {
    126   (void) base;
     123  Scheduler_SMP_Control *smp_base,
     124  Thread_Control *thread
     125)
     126{
     127  (void) smp_base;
    127128
    128129  thread->is_in_the_air = thread->is_scheduled;
     
    132133}
    133134
    134 void _Scheduler_simple_smp_Block( Thread_Control *thread )
    135 {
    136   Scheduler_simple_SMP_Control *self = _Scheduler_simple_SMP_Instance();
     135void _Scheduler_simple_smp_Block(
     136  Scheduler_Control *base,
     137  Thread_Control *thread
     138)
     139{
     140  Scheduler_simple_SMP_Control *self =
     141    _Scheduler_simple_SMP_Self_from_base( base );
    137142
    138143  _Scheduler_SMP_Block(
     
    146151
    147152static void _Scheduler_simple_smp_Enqueue_ordered(
    148   Scheduler_SMP_Control *base,
     153  Scheduler_SMP_Control *smp_base,
    149154  Thread_Control *thread,
    150155  Chain_Node_order order,
     
    154159{
    155160  _Scheduler_SMP_Enqueue_ordered(
    156     base,
     161    smp_base,
    157162    thread,
    158163    order,
     
    165170}
    166171
    167 void _Scheduler_simple_smp_Enqueue_priority_lifo( Thread_Control *thread )
    168 {
    169   Scheduler_simple_SMP_Control *self = _Scheduler_simple_SMP_Instance();
     172void _Scheduler_simple_smp_Enqueue_priority_lifo(
     173  Scheduler_Control *base,
     174  Thread_Control *thread
     175)
     176{
     177  Scheduler_simple_SMP_Control *self =
     178    _Scheduler_simple_SMP_Self_from_base( base );
    170179
    171180  _Scheduler_simple_smp_Enqueue_ordered(
     
    178187}
    179188
    180 void _Scheduler_simple_smp_Enqueue_priority_fifo( Thread_Control *thread )
    181 {
    182   Scheduler_simple_SMP_Control *self = _Scheduler_simple_SMP_Instance();
     189void _Scheduler_simple_smp_Enqueue_priority_fifo(
     190  Scheduler_Control *base,
     191  Thread_Control *thread
     192)
     193{
     194  Scheduler_simple_SMP_Control *self =
     195    _Scheduler_simple_SMP_Self_from_base( base );
    183196
    184197  _Scheduler_simple_smp_Enqueue_ordered(
     
    191204}
    192205
    193 void _Scheduler_simple_smp_Extract( Thread_Control *thread )
    194 {
    195   Scheduler_simple_SMP_Control *self = _Scheduler_simple_SMP_Instance();
     206void _Scheduler_simple_smp_Extract(
     207  Scheduler_Control *base,
     208  Thread_Control *thread
     209)
     210{
     211  Scheduler_simple_SMP_Control *self =
     212    _Scheduler_simple_SMP_Self_from_base( base );
    196213
    197214  _Scheduler_SMP_Extract(
     
    202219}
    203220
    204 void _Scheduler_simple_smp_Yield( Thread_Control *thread )
     221void _Scheduler_simple_smp_Yield(
     222  Scheduler_Control *base,
     223  Thread_Control *thread
     224)
    205225{
    206226  ISR_Level level;
     
    208228  _ISR_Disable( level );
    209229
    210   _Scheduler_simple_smp_Extract( thread );
    211   _Scheduler_simple_smp_Enqueue_priority_fifo( thread );
     230  _Scheduler_simple_smp_Extract( base, thread );
     231  _Scheduler_simple_smp_Enqueue_priority_fifo( base, thread );
    212232
    213233  _ISR_Enable( level );
    214234}
    215235
    216 void _Scheduler_simple_smp_Schedule( Thread_Control *thread )
    217 {
    218   Scheduler_simple_SMP_Control *self = _Scheduler_simple_SMP_Instance();
     236void _Scheduler_simple_smp_Schedule(
     237  Scheduler_Control *base,
     238  Thread_Control *thread
     239)
     240{
     241  Scheduler_simple_SMP_Control *self =
     242    _Scheduler_simple_SMP_Self_from_base( base );
    219243
    220244  _Scheduler_SMP_Schedule(
     
    227251
    228252void _Scheduler_simple_smp_Start_idle(
     253  Scheduler_Control *base,
    229254  Thread_Control *thread,
    230255  Per_CPU_Control *cpu
    231256)
    232257{
    233   Scheduler_simple_SMP_Control *self = _Scheduler_simple_SMP_Instance();
     258  Scheduler_simple_SMP_Control *self =
     259    _Scheduler_simple_SMP_Self_from_base( base );
    234260
    235261  _Scheduler_SMP_Start_idle( &self->Base, thread, cpu );
  • cpukit/score/src/schedulersimpleunblock.c

    r439c494 r24934e36  
    2525
    2626void _Scheduler_simple_Unblock(
     27  Scheduler_Control *scheduler,
    2728  Thread_Control    *the_thread
    2829)
    2930{
    30   _Scheduler_simple_Ready_queue_enqueue(the_thread);
     31  _Scheduler_simple_Ready_queue_enqueue( scheduler, the_thread );
    3132
    3233  /*
  • cpukit/score/src/schedulersimpleyield.c

    r439c494 r24934e36  
    2323#include <rtems/score/threadimpl.h>
    2424
    25 void _Scheduler_simple_Yield( Thread_Control *thread )
     25void _Scheduler_simple_Yield(
     26  Scheduler_Control *scheduler,
     27  Thread_Control    *the_thread
     28)
    2629{
    2730  ISR_Level       level;
     
    2932  _ISR_Disable( level );
    3033
    31     _Scheduler_simple_Ready_queue_requeue( &_Scheduler, thread );
     34    _Scheduler_simple_Ready_queue_requeue( scheduler, the_thread );
    3235
    3336    _ISR_Flash( level );
    3437
    35     _Scheduler_simple_Schedule_body( thread, false );
     38    _Scheduler_simple_Schedule_body( scheduler, the_thread, false );
    3639
    3740  _ISR_Enable( level );
  • cpukit/score/src/threadchangepriority.c

    r439c494 r24934e36  
    3030)
    3131{
    32   ISR_Level      level;
    33   States_Control state, original_state;
     32  Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
     33  ISR_Level          level;
     34  States_Control     state, original_state;
    3435
    3536  /*
     
    7071     * now.
    7172     */
    72     _Scheduler_Schedule( the_thread );
     73    _Scheduler_Schedule( scheduler, the_thread );
    7374
    7475    _ISR_Enable( level );
     
    9091
    9192    if ( prepend_it )
    92       _Scheduler_Enqueue_first( the_thread );
     93      _Scheduler_Enqueue_first( scheduler, the_thread );
    9394    else
    94       _Scheduler_Enqueue( the_thread );
     95      _Scheduler_Enqueue( scheduler, the_thread );
    9596  }
    9697
     
    101102   *  who is the heir and if we need to switch to them.
    102103   */
    103   _Scheduler_Schedule( the_thread );
     104  _Scheduler_Schedule( scheduler, the_thread );
    104105
    105106  _ISR_Enable( level );
  • cpukit/score/src/threadclearstate.c

    r439c494 r24934e36  
    3838
    3939      if ( _States_Is_ready( current_state ) ) {
    40         _Scheduler_Unblock( the_thread );
     40        _Scheduler_Unblock( _Scheduler_Get( the_thread ), the_thread );
    4141      }
    4242  }
  • cpukit/score/src/threadinitialize.c

    r439c494 r24934e36  
    216216  the_thread->real_priority           = priority;
    217217  the_thread->Start.initial_priority  = priority;
    218   sched =_Scheduler_Allocate( the_thread );
     218  sched =_Scheduler_Allocate( _Scheduler_Get( the_thread ), the_thread );
    219219  if ( !sched )
    220220    goto failed;
  • cpukit/score/src/threadready.c

    r439c494 r24934e36  
    3333  the_thread->current_state = STATES_READY;
    3434
    35   _Scheduler_Unblock( the_thread );
     35  _Scheduler_Unblock( _Scheduler_Get( the_thread ), the_thread );
    3636
    3737  _ISR_Enable( level );
  • cpukit/score/src/threadrestart.c

    r439c494 r24934e36  
    7272   * Free the per-thread scheduling information.
    7373   */
    74   _Scheduler_Free( the_thread );
     74  _Scheduler_Free( _Scheduler_Get( the_thread ), the_thread );
    7575
    7676  /*
     
    217217
    218218static void _Thread_Start_life_change(
    219   Thread_Control   *the_thread,
    220   Priority_Control  priority
     219  Thread_Control    *the_thread,
     220  Scheduler_Control *scheduler,
     221  Priority_Control   priority
    221222)
    222223{
     
    229230  _Thread_queue_Extract_with_proxy( the_thread );
    230231  _Watchdog_Remove( &the_thread->Timer );
    231   _Scheduler_Set_priority_if_higher( the_thread, priority );
     232  _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority );
    232233  _Thread_Add_post_switch_action( the_thread, &the_thread->Life.Action );
    233234  _Thread_Ready( the_thread );
     
    245246  Per_CPU_Control *cpu;
    246247  ISR_Level level;
     248  Scheduler_Control *scheduler;
    247249
    248250  cpu = _Thread_Action_ISR_disable_and_acquire( the_thread, &level );
     
    251253  _Thread_Action_release_and_ISR_enable( cpu, level );
    252254
     255  scheduler = _Scheduler_Get( the_thread );
    253256  if ( the_thread == executing ) {
    254257    executing->real_priority = priority;
    255258
    256     _Scheduler_Set_priority_if_higher( the_thread, priority );
     259    _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority );
    257260    _Thread_Start_life_change_for_executing( executing );
    258261  } else if ( previous_life_state == THREAD_LIFE_NORMAL ) {
    259     _Thread_Start_life_change( the_thread, priority );
     262    _Thread_Start_life_change( the_thread, scheduler, priority );
    260263  } else {
    261264    _Thread_Clear_state( the_thread, STATES_SUSPENDED );
     
    263266    if ( _Thread_Is_life_terminating( additional_life_state ) ) {
    264267      the_thread->real_priority = _Scheduler_Highest_priority_of_two(
     268        scheduler,
    265269        the_thread->real_priority,
    266270        priority
    267271      );
    268272
    269       _Scheduler_Change_priority_if_higher( the_thread, priority, false );
     273      _Scheduler_Change_priority_if_higher(
     274        scheduler,
     275        the_thread,
     276        priority,
     277        false
     278      );
    270279    }
    271280  }
  • cpukit/score/src/threadsetpriority.c

    r439c494 r24934e36  
    2929  the_thread->current_priority = new_priority;
    3030
    31   _Scheduler_Update( the_thread );
     31  _Scheduler_Update( _Scheduler_Get( the_thread ), the_thread );
    3232}
  • cpukit/score/src/threadsetstate.c

    r439c494 r24934e36  
    4040    the_thread->current_state = state;
    4141
    42     _Scheduler_Block( the_thread );
     42    _Scheduler_Block( _Scheduler_Get( the_thread ), the_thread );
    4343  } else {
    4444    the_thread->current_state = _States_Set( state, current_state);
  • cpukit/score/src/threadsettransient.c

    r439c494 r24934e36  
    3737
    3838  if ( _States_Is_ready( old_state ) ) {
    39     _Scheduler_Extract( the_thread );
     39    _Scheduler_Extract( _Scheduler_Get( the_thread ), the_thread );
    4040  }
    4141
  • cpukit/score/src/threadstart.c

    r439c494 r24934e36  
    3131  void                      *pointer_argument,
    3232  Thread_Entry_numeric_type  numeric_argument,
    33   Per_CPU_Control           *processor
     33  Per_CPU_Control           *cpu
    3434)
    3535{
     
    4444    _Thread_Load_environment( the_thread );
    4545
    46     if ( processor == NULL ) {
     46    if ( cpu == NULL ) {
    4747      _Thread_Ready( the_thread );
    4848    } else {
    4949      the_thread->current_state = STATES_READY;
    50       _Scheduler_Start_idle( the_thread, processor );
     50      _Scheduler_Start_idle( _Scheduler_Get( the_thread ), the_thread, cpu );
    5151    }
    5252
  • testsuites/tmtests/tm26/task1.c

    r439c494 r24934e36  
    372372)
    373373{
    374   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     374  Scheduler_priority_Control *scheduler =
     375    _Scheduler_priority_Self_from_base( _Scheduler_Get( NULL ) );
    375376
    376377  thread_dispatch_no_fp_time = benchmark_timer_read();
     
    404405)
    405406{
    406   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     407  Scheduler_priority_Control *scheduler =
     408    _Scheduler_priority_Self_from_base( _Scheduler_Get( NULL ) );
    407409  Thread_Control             *executing;
    408410
     
    446448)
    447449{
    448   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     450  Scheduler_priority_Control *scheduler =
     451    _Scheduler_priority_Self_from_base( _Scheduler_Get( NULL ) );
    449452  Thread_Control             *executing;
    450453  FP_DECLARE;
     
    501504)
    502505{
    503   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     506  Scheduler_priority_Control *scheduler =
     507    _Scheduler_priority_Self_from_base( _Scheduler_Get( NULL ) );
    504508  Thread_Control             *executing;
    505509  FP_DECLARE;
  • testsuites/tmtests/tm27/task1.c

    r439c494 r24934e36  
    103103)
    104104{
    105   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     105  Scheduler_priority_Control *scheduler =
     106    _Scheduler_priority_Self_from_base( _Scheduler_Get( NULL ) );
    106107#if defined(RTEMS_SMP)
    107108  rtems_interrupt_level level;
     
    220221)
    221222{
    222   Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
     223  Scheduler_priority_Control *scheduler =
     224    _Scheduler_priority_Self_from_base( _Scheduler_Get( NULL ) );
    223225#if defined(RTEMS_SMP)
    224226  rtems_interrupt_level level;
Note: See TracChangeset for help on using the changeset viewer.