Changeset 63e2ca1b in rtems


Ignore:
Timestamp:
Oct 31, 2016, 8:13:35 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
86d3a2e
Parents:
2dd098a
git-author:
Sebastian Huber <sebastian.huber@…> (10/31/16 08:13:35)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/16 09:05:45)
Message:

score: Simplify yield and unblock scheduler ops

Update #2556.

Files:
23 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/scheduler.h

    r2dd098a r63e2ca1b  
    4444
    4545#if defined(RTEMS_SMP)
    46   typedef Thread_Control * Scheduler_Void_or_thread;
    47 
    48   #define SCHEDULER_RETURN_VOID_OR_NULL return NULL
     46  typedef bool Scheduler_Void_or_bool;
     47
     48  #define SCHEDULER_RETURN_VOID_OR_BOOL return false
    4949#else
    50   typedef void Scheduler_Void_or_thread;
    51 
    52   #define SCHEDULER_RETURN_VOID_OR_NULL return
     50  typedef void Scheduler_Void_or_bool;
     51
     52  #define SCHEDULER_RETURN_VOID_OR_BOOL return
    5353#endif
    5454
     
    6464
    6565  /** @see _Scheduler_Yield() */
    66   Scheduler_Void_or_thread ( *yield )(
     66  Scheduler_Void_or_bool ( *yield )(
    6767    const Scheduler_Control *,
    6868    Thread_Control *,
     
    7878
    7979  /** @see _Scheduler_Unblock() */
    80   Scheduler_Void_or_thread ( *unblock )(
     80  Scheduler_Void_or_bool ( *unblock )(
    8181    const Scheduler_Control *,
    8282    Thread_Control *,
  • cpukit/score/include/rtems/score/schedulercbs.h

    r2dd098a r63e2ca1b  
    147147extern Scheduler_CBS_Server _Scheduler_CBS_Server_list[];
    148148
    149 Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
     149Scheduler_Void_or_bool _Scheduler_CBS_Unblock(
    150150  const Scheduler_Control *scheduler,
    151151  Thread_Control          *the_thread,
  • cpukit/score/include/rtems/score/scheduleredf.h

    r2dd098a r63e2ca1b  
    145145);
    146146
    147 Scheduler_Void_or_thread _Scheduler_EDF_Unblock(
     147Scheduler_Void_or_bool _Scheduler_EDF_Unblock(
    148148  const Scheduler_Control *scheduler,
    149149  Thread_Control          *the_thread,
     
    167167);
    168168
    169 Scheduler_Void_or_thread _Scheduler_EDF_Yield(
     169Scheduler_Void_or_bool _Scheduler_EDF_Yield(
    170170  const Scheduler_Control *scheduler,
    171171  Thread_Control          *the_thread,
  • cpukit/score/include/rtems/score/schedulerimpl.h

    r2dd098a r63e2ca1b  
    176176  const Scheduler_Control *scheduler;
    177177  ISR_lock_Context         lock_context;
    178   Thread_Control          *needs_help;
     178  bool                     needs_help;
    179179
    180180  node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
     
    192192  _Scheduler_Release_critical( scheduler, &lock_context );
    193193
    194   if ( needs_help != the_thread ) {
     194  if ( !needs_help ) {
    195195    return;
    196196  }
     
    310310  const Scheduler_Control *scheduler;
    311311  ISR_lock_Context         lock_context;
    312   Thread_Control          *needs_help;
     312  bool                     needs_help;
    313313
    314314  node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
     
    326326  _Scheduler_Release_critical( scheduler, &lock_context );
    327327
    328   if ( needs_help != the_thread ) {
     328  if ( !needs_help ) {
    329329    return;
    330330  }
  • cpukit/score/include/rtems/score/schedulerpriority.h

    r2dd098a r63e2ca1b  
    129129);
    130130
    131 Scheduler_Void_or_thread _Scheduler_priority_Unblock(
     131Scheduler_Void_or_bool _Scheduler_priority_Unblock(
    132132  const Scheduler_Control *scheduler,
    133133  Thread_Control          *the_thread,
     
    148148);
    149149
    150 Scheduler_Void_or_thread _Scheduler_priority_Yield(
     150Scheduler_Void_or_bool _Scheduler_priority_Yield(
    151151  const Scheduler_Control *scheduler,
    152152  Thread_Control          *the_thread,
  • cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h

    r2dd098a r63e2ca1b  
    9595);
    9696
    97 Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
     97bool _Scheduler_priority_affinity_SMP_Unblock(
    9898  const Scheduler_Control *scheduler,
    9999  Thread_Control          *thread,
  • cpukit/score/include/rtems/score/schedulerprioritysmp.h

    r2dd098a r63e2ca1b  
    114114);
    115115
    116 Thread_Control *_Scheduler_priority_SMP_Unblock(
     116bool _Scheduler_priority_SMP_Unblock(
    117117  const Scheduler_Control *scheduler,
    118118  Thread_Control          *thread,
     
    145145);
    146146
    147 Thread_Control *_Scheduler_priority_SMP_Yield(
     147bool _Scheduler_priority_SMP_Yield(
    148148  const Scheduler_Control *scheduler,
    149149  Thread_Control          *thread,
  • cpukit/score/include/rtems/score/schedulersimple.h

    r2dd098a r63e2ca1b  
    9393);
    9494
    95 Scheduler_Void_or_thread _Scheduler_simple_Yield(
     95Scheduler_Void_or_bool _Scheduler_simple_Yield(
    9696  const Scheduler_Control *scheduler,
    9797  Thread_Control          *the_thread,
     
    105105);
    106106
    107 Scheduler_Void_or_thread _Scheduler_simple_Unblock(
     107Scheduler_Void_or_bool _Scheduler_simple_Unblock(
    108108  const Scheduler_Control *scheduler,
    109109  Thread_Control          *the_thread,
  • cpukit/score/include/rtems/score/schedulersimplesmp.h

    r2dd098a r63e2ca1b  
    9797);
    9898
    99 Thread_Control *_Scheduler_simple_SMP_Unblock(
     99bool _Scheduler_simple_SMP_Unblock(
    100100  const Scheduler_Control *scheduler,
    101101  Thread_Control          *thread,
     
    128128);
    129129
    130 Thread_Control *_Scheduler_simple_SMP_Yield(
     130bool _Scheduler_simple_SMP_Yield(
    131131  const Scheduler_Control *scheduler,
    132132  Thread_Control          *thread,
  • cpukit/score/include/rtems/score/schedulersmpimpl.h

    r2dd098a r63e2ca1b  
    314314);
    315315
    316 typedef Thread_Control *( *Scheduler_SMP_Enqueue )(
    317   Scheduler_Context *context,
    318   Scheduler_Node    *node_to_enqueue,
    319   Thread_Control    *needs_help
    320 );
    321 
    322 typedef Thread_Control *( *Scheduler_SMP_Enqueue_scheduled )(
     316typedef bool ( *Scheduler_SMP_Enqueue )(
    323317  Scheduler_Context *context,
    324318  Scheduler_Node    *node_to_enqueue
     
    618612}
    619613
    620 static inline Thread_Control *_Scheduler_SMP_Enqueue_to_scheduled(
     614static inline void _Scheduler_SMP_Enqueue_to_scheduled(
    621615  Scheduler_Context                *context,
    622616  Scheduler_Node                   *node,
     
    627621)
    628622{
    629   Thread_Control *needs_help;
    630623  Scheduler_Try_to_schedule_action action;
    631624
     
    638631
    639632  if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
    640     Thread_Control *lowest_scheduled_user;
    641     Thread_Control *idle;
    642 
    643     lowest_scheduled_user = _Scheduler_SMP_Preempt(
     633    _Scheduler_SMP_Preempt(
    644634      context,
    645635      node,
     
    651641    ( *move_from_scheduled_to_ready )( context, lowest_scheduled );
    652642
    653     idle = _Scheduler_Release_idle_thread(
     643    _Scheduler_Release_idle_thread(
    654644      context,
    655645      lowest_scheduled,
    656646      _Scheduler_SMP_Release_idle_thread
    657647    );
    658     if ( idle == NULL ) {
    659       needs_help = lowest_scheduled_user;
    660     } else {
    661       needs_help = NULL;
    662     }
    663648  } else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
    664649    _Scheduler_SMP_Node_change_state(
     
    676661      _Scheduler_Node_get_idle( lowest_scheduled )
    677662    );
    678 
    679     needs_help = NULL;
    680663  } else {
    681664    _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
    682665    _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_BLOCKED );
    683     needs_help = NULL;
    684   }
    685 
    686   return needs_help;
     666  }
    687667}
    688668
     
    694674 * @param[in] context The scheduler instance context.
    695675 * @param[in] node The node to enqueue.
    696  * @param[in] needs_help The thread needing help in case the node cannot be
    697  *   scheduled.
    698676 * @param[in] order The order function.
    699677 * @param[in] insert_ready Function to insert a node into the set of ready
     
    710688 *   based on the rules of the scheduler.
    711689 */
    712 static inline Thread_Control *_Scheduler_SMP_Enqueue_ordered(
     690static inline bool _Scheduler_SMP_Enqueue_ordered(
    713691  Scheduler_Context                  *context,
    714692  Scheduler_Node                     *node,
    715   Thread_Control                     *needs_help,
    716693  Chain_Node_order                    order,
    717694  Scheduler_SMP_Insert                insert_ready,
     
    722699)
    723700{
    724   Scheduler_Node *lowest_scheduled =
    725     ( *get_lowest_scheduled )( context, node, order );
     701  bool            needs_help;
     702  Scheduler_Node *lowest_scheduled;
     703
     704  lowest_scheduled = ( *get_lowest_scheduled )( context, node, order );
    726705
    727706  if ( ( *order )( &node->Node, &lowest_scheduled->Node ) ) {
    728     needs_help = _Scheduler_SMP_Enqueue_to_scheduled(
     707    _Scheduler_SMP_Enqueue_to_scheduled(
    729708      context,
    730709      node,
     
    734713      allocate_processor
    735714    );
     715    needs_help = false;
    736716  } else {
    737717    ( *insert_ready )( context, node );
     718    needs_help = true;
    738719  }
    739720
     
    760741 *   based on the rules of the scheduler.
    761742 */
    762 static inline Thread_Control *_Scheduler_SMP_Enqueue_scheduled_ordered(
     743static inline bool _Scheduler_SMP_Enqueue_scheduled_ordered(
    763744  Scheduler_Context                *context,
    764745  Scheduler_Node                   *node,
     
    812793      }
    813794
    814       return NULL;
     795      return false;
    815796    }
    816797
     
    823804
    824805    if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
    825       Thread_Control *user;
    826806      Thread_Control *idle;
    827807
    828       user = _Scheduler_SMP_Preempt(
     808      _Scheduler_SMP_Preempt(
    829809        context,
    830810        highest_ready,
     
    841821        _Scheduler_SMP_Release_idle_thread
    842822      );
    843 
    844       if ( idle == NULL ) {
    845         return user;
    846       } else {
    847         return NULL;
    848       }
     823      return ( idle == NULL );
    849824    } else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
    850825      _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
     
    862837        _Scheduler_Node_get_idle( node )
    863838      );
    864       return NULL;
     839      return false;
    865840    } else {
    866841      _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
     
    983958}
    984959
    985 static inline Thread_Control *_Scheduler_SMP_Unblock(
     960static inline bool _Scheduler_SMP_Unblock(
    986961  Scheduler_Context     *context,
    987962  Thread_Control        *thread,
     
    993968  Scheduler_SMP_Node_state  node_state;
    994969  bool                      unblock;
    995   Thread_Control           *needs_help;
     970  bool                      needs_help;
    996971
    997972  node_state = _Scheduler_SMP_Node_state( node );
     
    1018993      _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
    1019994
    1020       needs_help = ( *enqueue_fifo )( context, node, thread );
     995      needs_help = ( *enqueue_fifo )( context, node );
    1021996    } else {
    1022997      _Assert( node_state == SCHEDULER_SMP_NODE_READY );
    1023998      _Assert( node->sticky_level > 0 );
    1024999      _Assert( node->idle == NULL );
    1025       needs_help = thread;
     1000      needs_help = true;
    10261001    }
    10271002  } else {
    1028     needs_help = NULL;
     1003    needs_help = false;
    10291004  }
    10301005
     
    10331008
    10341009static inline void _Scheduler_SMP_Update_priority(
    1035   Scheduler_Context               *context,
    1036   Thread_Control                  *thread,
    1037   Scheduler_Node                  *node,
    1038   Scheduler_SMP_Extract            extract_from_ready,
    1039   Scheduler_SMP_Update             update,
    1040   Scheduler_SMP_Enqueue            enqueue_fifo,
    1041   Scheduler_SMP_Enqueue            enqueue_lifo,
    1042   Scheduler_SMP_Enqueue_scheduled  enqueue_scheduled_fifo,
    1043   Scheduler_SMP_Enqueue_scheduled  enqueue_scheduled_lifo,
    1044   Scheduler_SMP_Ask_for_help       ask_for_help
     1010  Scheduler_Context          *context,
     1011  Thread_Control             *thread,
     1012  Scheduler_Node             *node,
     1013  Scheduler_SMP_Extract       extract_from_ready,
     1014  Scheduler_SMP_Update        update,
     1015  Scheduler_SMP_Enqueue       enqueue_fifo,
     1016  Scheduler_SMP_Enqueue       enqueue_lifo,
     1017  Scheduler_SMP_Enqueue       enqueue_scheduled_fifo,
     1018  Scheduler_SMP_Enqueue       enqueue_scheduled_lifo,
     1019  Scheduler_SMP_Ask_for_help  ask_for_help
    10451020)
    10461021{
     
    10771052
    10781053    if ( prepend_it ) {
    1079       ( *enqueue_lifo )( context, node, NULL );
     1054      ( *enqueue_lifo )( context, node );
    10801055    } else {
    1081       ( *enqueue_fifo )( context, node, NULL );
     1056      ( *enqueue_fifo )( context, node );
    10821057    }
    10831058  } else {
     
    10901065}
    10911066
    1092 static inline Thread_Control *_Scheduler_SMP_Yield(
    1093   Scheduler_Context               *context,
    1094   Thread_Control                  *thread,
    1095   Scheduler_Node                  *node,
    1096   Scheduler_SMP_Extract            extract_from_ready,
    1097   Scheduler_SMP_Enqueue            enqueue_fifo,
    1098   Scheduler_SMP_Enqueue_scheduled  enqueue_scheduled_fifo
    1099 )
    1100 {
    1101   Thread_Control           *needs_help;
    1102   Scheduler_SMP_Node_state  node_state;
     1067static inline bool _Scheduler_SMP_Yield(
     1068  Scheduler_Context     *context,
     1069  Thread_Control        *thread,
     1070  Scheduler_Node        *node,
     1071  Scheduler_SMP_Extract  extract_from_ready,
     1072  Scheduler_SMP_Enqueue  enqueue_fifo,
     1073  Scheduler_SMP_Enqueue  enqueue_scheduled_fifo
     1074)
     1075{
     1076  bool                     needs_help;
     1077  Scheduler_SMP_Node_state node_state;
    11031078
    11041079  node_state = _Scheduler_SMP_Node_state( node );
     
    11111086    ( *extract_from_ready )( context, node );
    11121087
    1113     needs_help = ( *enqueue_fifo )( context, node, NULL );
     1088    needs_help = ( *enqueue_fifo )( context, node );
    11141089  } else {
    1115     needs_help = thread;
     1090    needs_help = true;
    11161091  }
    11171092
  • cpukit/score/include/rtems/score/schedulerstrongapa.h

    r2dd098a r63e2ca1b  
    114114);
    115115
    116 Thread_Control *_Scheduler_strong_APA_Unblock(
     116bool _Scheduler_strong_APA_Unblock(
    117117  const Scheduler_Control *scheduler,
    118118  Thread_Control          *the_thread,
     
    145145);
    146146
    147 Thread_Control *_Scheduler_strong_APA_Yield(
     147bool _Scheduler_strong_APA_Yield(
    148148  const Scheduler_Control *scheduler,
    149149  Thread_Control          *the_thread,
  • cpukit/score/src/schedulercbsunblock.c

    r2dd098a r63e2ca1b  
    2626#include <rtems/score/watchdogimpl.h>
    2727
    28 Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
     28Scheduler_Void_or_bool _Scheduler_CBS_Unblock(
    2929  const Scheduler_Control *scheduler,
    3030  Thread_Control          *the_thread,
     
    6969
    7070  _Scheduler_EDF_Unblock( scheduler, the_thread, &the_node->Base.Base );
    71   SCHEDULER_RETURN_VOID_OR_NULL;
     71  SCHEDULER_RETURN_VOID_OR_BOOL;
    7272}
  • cpukit/score/src/scheduleredfunblock.c

    r2dd098a r63e2ca1b  
    2323#include <rtems/score/thread.h>
    2424
    25 Scheduler_Void_or_thread _Scheduler_EDF_Unblock(
     25Scheduler_Void_or_bool _Scheduler_EDF_Unblock(
    2626  const Scheduler_Control *scheduler,
    2727  Thread_Control          *the_thread,
     
    6161  }
    6262
    63   SCHEDULER_RETURN_VOID_OR_NULL;
     63  SCHEDULER_RETURN_VOID_OR_BOOL;
    6464}
  • cpukit/score/src/scheduleredfyield.c

    r2dd098a r63e2ca1b  
    2222#include <rtems/score/scheduleredfimpl.h>
    2323
    24 Scheduler_Void_or_thread _Scheduler_EDF_Yield(
     24Scheduler_Void_or_bool _Scheduler_EDF_Yield(
    2525  const Scheduler_Control *scheduler,
    2626  Thread_Control          *the_thread,
     
    3838  _Scheduler_EDF_Schedule_body( scheduler, the_thread, true );
    3939
    40   SCHEDULER_RETURN_VOID_OR_NULL;
     40  SCHEDULER_RETURN_VOID_OR_BOOL;
    4141}
  • cpukit/score/src/schedulerpriorityaffinitysmp.c

    r2dd098a r63e2ca1b  
    271271 * _Scheduler_SMP_Enqueue_ordered.
    272272 */
    273 static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_fifo(
     273static bool _Scheduler_priority_affinity_SMP_Enqueue_fifo(
    274274  Scheduler_Context *context,
    275   Scheduler_Node    *node,
    276   Thread_Control    *needs_help
     275  Scheduler_Node    *node
    277276)
    278277{
     
    280279    context,
    281280    node,
    282     needs_help,
    283281    _Scheduler_priority_affinity_SMP_Insert_priority_fifo_order,
    284282    _Scheduler_priority_SMP_Insert_ready_fifo,
     
    355353 * This is the public scheduler specific Unblock operation.
    356354 */
    357 Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
     355bool _Scheduler_priority_affinity_SMP_Unblock(
    358356  const Scheduler_Control *scheduler,
    359357  Thread_Control          *thread,
     
    362360{
    363361  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
    364   Thread_Control    *needs_help;
     362  bool               needs_help;
    365363
    366364  needs_help = _Scheduler_SMP_Unblock(
     
    384382 *  get_lowest_scheduled helper to _Scheduler_SMP_Enqueue_ordered.
    385383 */
    386 static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_ordered(
     384static bool _Scheduler_priority_affinity_SMP_Enqueue_ordered(
    387385  Scheduler_Context     *context,
    388386  Scheduler_Node        *node,
    389   Thread_Control        *needs_help,
    390387  Chain_Node_order       order,
    391388  Scheduler_SMP_Insert   insert_ready,
     
    396393    context,
    397394    node,
    398     needs_help,
    399395    order,
    400396    insert_ready,
     
    411407 *  invokes a scheduler unique get_lowest_scheduled helper.
    412408 */
    413 static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_lifo(
     409static bool _Scheduler_priority_affinity_SMP_Enqueue_lifo(
    414410  Scheduler_Context *context,
    415   Scheduler_Node    *node,
    416   Thread_Control    *needs_help
     411  Scheduler_Node    *node
    417412)
    418413{
     
    420415    context,
    421416    node,
    422     needs_help,
    423417    _Scheduler_priority_affinity_SMP_Insert_priority_lifo_order,
    424418    _Scheduler_priority_SMP_Insert_ready_lifo,
     
    432426 * this scheduler's get_highest_ready() helper.
    433427 */
    434 static Thread_Control *
    435 _Scheduler_priority_affinity_SMP_Enqueue_scheduled_ordered(
     428static bool _Scheduler_priority_affinity_SMP_Enqueue_scheduled_ordered(
    436429  Scheduler_Context    *context,
    437430  Scheduler_Node       *node,
     
    459452 *  invokes a scheduler unique get_lowest_scheduled helper.
    460453 */
    461 static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_scheduled_lifo(
     454static bool _Scheduler_priority_affinity_SMP_Enqueue_scheduled_lifo(
    462455  Scheduler_Context *context,
    463456  Scheduler_Node    *node
     
    478471 *  invokes a scheduler unique get_lowest_scheduled helper.
    479472 */
    480 static Thread_Control *_Scheduler_priority_affinity_SMP_Enqueue_scheduled_fifo(
     473static bool _Scheduler_priority_affinity_SMP_Enqueue_scheduled_fifo(
    481474  Scheduler_Context *context,
    482475  Scheduler_Node    *node
  • cpukit/score/src/schedulerprioritysmp.c

    r2dd098a r63e2ca1b  
    110110}
    111111
    112 static Thread_Control *_Scheduler_priority_SMP_Enqueue_ordered(
     112static bool _Scheduler_priority_SMP_Enqueue_ordered(
    113113  Scheduler_Context    *context,
    114114  Scheduler_Node       *node,
    115   Thread_Control       *needs_help,
    116115  Chain_Node_order      order,
    117116  Scheduler_SMP_Insert  insert_ready,
     
    122121    context,
    123122    node,
    124     needs_help,
    125123    order,
    126124    insert_ready,
     
    132130}
    133131
    134 static Thread_Control *_Scheduler_priority_SMP_Enqueue_lifo(
    135   Scheduler_Context *context,
    136   Scheduler_Node    *node,
    137   Thread_Control    *needs_help
     132static bool _Scheduler_priority_SMP_Enqueue_lifo(
     133  Scheduler_Context *context,
     134  Scheduler_Node    *node
    138135)
    139136{
     
    141138    context,
    142139    node,
    143     needs_help,
    144140    _Scheduler_SMP_Insert_priority_lifo_order,
    145141    _Scheduler_priority_SMP_Insert_ready_lifo,
     
    148144}
    149145
    150 static Thread_Control *_Scheduler_priority_SMP_Enqueue_fifo(
    151   Scheduler_Context *context,
    152   Scheduler_Node    *node,
    153   Thread_Control    *needs_help
     146static bool _Scheduler_priority_SMP_Enqueue_fifo(
     147  Scheduler_Context *context,
     148  Scheduler_Node    *node
    154149)
    155150{
     
    157152    context,
    158153    node,
    159     needs_help,
    160154    _Scheduler_SMP_Insert_priority_fifo_order,
    161155    _Scheduler_priority_SMP_Insert_ready_fifo,
     
    164158}
    165159
    166 static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_ordered(
     160static bool _Scheduler_priority_SMP_Enqueue_scheduled_ordered(
    167161  Scheduler_Context *context,
    168162  Scheduler_Node *node,
     
    185179}
    186180
    187 static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_lifo(
     181static bool _Scheduler_priority_SMP_Enqueue_scheduled_lifo(
    188182  Scheduler_Context *context,
    189183  Scheduler_Node *node
     
    199193}
    200194
    201 static Thread_Control *_Scheduler_priority_SMP_Enqueue_scheduled_fifo(
     195static bool _Scheduler_priority_SMP_Enqueue_scheduled_fifo(
    202196  Scheduler_Context *context,
    203197  Scheduler_Node *node
     
    213207}
    214208
    215 Thread_Control *_Scheduler_priority_SMP_Unblock(
     209bool _Scheduler_priority_SMP_Unblock(
    216210  const Scheduler_Control *scheduler,
    217211  Thread_Control          *thread,
     
    319313}
    320314
    321 Thread_Control *_Scheduler_priority_SMP_Yield(
     315bool _Scheduler_priority_SMP_Yield(
    322316  const Scheduler_Control *scheduler,
    323317  Thread_Control          *thread,
  • cpukit/score/src/schedulerpriorityunblock.c

    r2dd098a r63e2ca1b  
    2323#include <rtems/score/schedulerpriorityimpl.h>
    2424
    25 Scheduler_Void_or_thread _Scheduler_priority_Unblock (
     25Scheduler_Void_or_bool _Scheduler_priority_Unblock (
    2626  const Scheduler_Control *scheduler,
    2727  Thread_Control          *the_thread,
     
    7373  }
    7474
    75   SCHEDULER_RETURN_VOID_OR_NULL;
     75  SCHEDULER_RETURN_VOID_OR_BOOL;
    7676}
  • cpukit/score/src/schedulerpriorityyield.c

    r2dd098a r63e2ca1b  
    2222#include <rtems/score/threadimpl.h>
    2323
    24 Scheduler_Void_or_thread _Scheduler_priority_Yield(
     24Scheduler_Void_or_bool _Scheduler_priority_Yield(
    2525  const Scheduler_Control *scheduler,
    2626  Thread_Control          *the_thread,
     
    4141  _Scheduler_priority_Schedule_body( scheduler, the_thread, true );
    4242
    43   SCHEDULER_RETURN_VOID_OR_NULL;
     43  SCHEDULER_RETURN_VOID_OR_BOOL;
    4444}
  • cpukit/score/src/schedulersimplesmp.c

    r2dd098a r63e2ca1b  
    177177}
    178178
    179 static Thread_Control *_Scheduler_simple_SMP_Enqueue_ordered(
     179static bool _Scheduler_simple_SMP_Enqueue_ordered(
    180180  Scheduler_Context    *context,
    181181  Scheduler_Node       *node,
    182   Thread_Control       *needs_help,
    183182  Chain_Node_order      order,
    184183  Scheduler_SMP_Insert  insert_ready,
     
    189188    context,
    190189    node,
    191     needs_help,
    192190    order,
    193191    insert_ready,
     
    199197}
    200198
    201 static Thread_Control *_Scheduler_simple_SMP_Enqueue_lifo(
    202   Scheduler_Context *context,
    203   Scheduler_Node    *node,
    204   Thread_Control    *needs_help
     199static bool _Scheduler_simple_SMP_Enqueue_lifo(
     200  Scheduler_Context *context,
     201  Scheduler_Node    *node
    205202)
    206203{
     
    208205    context,
    209206    node,
    210     needs_help,
    211207    _Scheduler_SMP_Insert_priority_lifo_order,
    212208    _Scheduler_simple_SMP_Insert_ready_lifo,
     
    215211}
    216212
    217 static Thread_Control *_Scheduler_simple_SMP_Enqueue_fifo(
    218   Scheduler_Context *context,
    219   Scheduler_Node    *node,
    220   Thread_Control    *needs_help
     213static bool _Scheduler_simple_SMP_Enqueue_fifo(
     214  Scheduler_Context *context,
     215  Scheduler_Node    *node
    221216)
    222217{
     
    224219    context,
    225220    node,
    226     needs_help,
    227221    _Scheduler_SMP_Insert_priority_fifo_order,
    228222    _Scheduler_simple_SMP_Insert_ready_fifo,
     
    231225}
    232226
    233 static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_ordered(
     227static bool _Scheduler_simple_SMP_Enqueue_scheduled_ordered(
    234228  Scheduler_Context *context,
    235229  Scheduler_Node *node,
     
    252246}
    253247
    254 static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_lifo(
     248static bool _Scheduler_simple_SMP_Enqueue_scheduled_lifo(
    255249  Scheduler_Context *context,
    256250  Scheduler_Node *node
     
    266260}
    267261
    268 static Thread_Control *_Scheduler_simple_SMP_Enqueue_scheduled_fifo(
     262static bool _Scheduler_simple_SMP_Enqueue_scheduled_fifo(
    269263  Scheduler_Context *context,
    270264  Scheduler_Node *node
     
    280274}
    281275
    282 Thread_Control *_Scheduler_simple_SMP_Unblock(
     276bool _Scheduler_simple_SMP_Unblock(
    283277  const Scheduler_Control *scheduler,
    284278  Thread_Control          *thread,
     
    386380}
    387381
    388 Thread_Control *_Scheduler_simple_SMP_Yield(
     382bool _Scheduler_simple_SMP_Yield(
    389383  const Scheduler_Control *scheduler,
    390384  Thread_Control          *thread,
  • cpukit/score/src/schedulersimpleunblock.c

    r2dd098a r63e2ca1b  
    2222#include <rtems/score/thread.h>
    2323
    24 Scheduler_Void_or_thread _Scheduler_simple_Unblock(
     24Scheduler_Void_or_bool _Scheduler_simple_Unblock(
    2525  const Scheduler_Control *scheduler,
    2626  Thread_Control          *the_thread,
     
    5656  }
    5757
    58   SCHEDULER_RETURN_VOID_OR_NULL;
     58  SCHEDULER_RETURN_VOID_OR_BOOL;
    5959}
  • cpukit/score/src/schedulersimpleyield.c

    r2dd098a r63e2ca1b  
    2121#include <rtems/score/schedulersimpleimpl.h>
    2222
    23 Scheduler_Void_or_thread _Scheduler_simple_Yield(
     23Scheduler_Void_or_bool _Scheduler_simple_Yield(
    2424  const Scheduler_Control *scheduler,
    2525  Thread_Control          *the_thread,
     
    3636  _Scheduler_simple_Schedule_body( scheduler, the_thread, false );
    3737
    38   SCHEDULER_RETURN_VOID_OR_NULL;
     38  SCHEDULER_RETURN_VOID_OR_BOOL;
    3939}
  • cpukit/score/src/schedulerstrongapa.c

    r2dd098a r63e2ca1b  
    236236}
    237237
    238 static Thread_Control *_Scheduler_strong_APA_Enqueue_ordered(
     238static bool _Scheduler_strong_APA_Enqueue_ordered(
    239239  Scheduler_Context    *context,
    240240  Scheduler_Node       *node,
    241   Thread_Control       *needs_help,
    242241  Chain_Node_order      order,
    243242  Scheduler_SMP_Insert  insert_ready,
     
    248247    context,
    249248    node,
    250     needs_help,
    251249    order,
    252250    insert_ready,
     
    258256}
    259257
    260 static Thread_Control *_Scheduler_strong_APA_Enqueue_lifo(
    261   Scheduler_Context *context,
    262   Scheduler_Node    *node,
    263   Thread_Control    *needs_help
     258static bool _Scheduler_strong_APA_Enqueue_lifo(
     259  Scheduler_Context *context,
     260  Scheduler_Node    *node
    264261)
    265262{
     
    267264    context,
    268265    node,
    269     needs_help,
    270266    _Scheduler_SMP_Insert_priority_lifo_order,
    271267    _Scheduler_strong_APA_Insert_ready_lifo,
     
    274270}
    275271
    276 static Thread_Control *_Scheduler_strong_APA_Enqueue_fifo(
    277   Scheduler_Context *context,
    278   Scheduler_Node    *node,
    279   Thread_Control    *needs_help
     272static bool _Scheduler_strong_APA_Enqueue_fifo(
     273  Scheduler_Context *context,
     274  Scheduler_Node    *node
    280275)
    281276{
     
    283278    context,
    284279    node,
    285     needs_help,
    286280    _Scheduler_SMP_Insert_priority_fifo_order,
    287281    _Scheduler_strong_APA_Insert_ready_fifo,
     
    290284}
    291285
    292 static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_ordered(
     286static bool _Scheduler_strong_APA_Enqueue_scheduled_ordered(
    293287  Scheduler_Context    *context,
    294288  Scheduler_Node       *node,
     
    311305}
    312306
    313 static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_lifo(
     307static bool _Scheduler_strong_APA_Enqueue_scheduled_lifo(
    314308  Scheduler_Context *context,
    315309  Scheduler_Node    *node
     
    325319}
    326320
    327 static Thread_Control *_Scheduler_strong_APA_Enqueue_scheduled_fifo(
     321static bool _Scheduler_strong_APA_Enqueue_scheduled_fifo(
    328322  Scheduler_Context *context,
    329323  Scheduler_Node    *node
     
    339333}
    340334
    341 Thread_Control *_Scheduler_strong_APA_Unblock(
     335bool _Scheduler_strong_APA_Unblock(
    342336  const Scheduler_Control *scheduler,
    343337  Thread_Control          *the_thread,
     
    445439}
    446440
    447 Thread_Control *_Scheduler_strong_APA_Yield(
     441bool _Scheduler_strong_APA_Yield(
    448442  const Scheduler_Control *scheduler,
    449443  Thread_Control          *the_thread,
  • testsuites/smptests/smpscheduler03/init.c

    r2dd098a r63e2ca1b  
    315315}
    316316
    317 static Thread_Control *yield_op(
     317static bool yield_op(
    318318  Thread_Control *thread,
    319319  Scheduler_SMP_Node *scheduler_node
     
    323323  ISR_lock_Context state_lock_context;
    324324  ISR_lock_Context scheduler_lock_context;
    325   Thread_Control *needs_help;
     325  bool needs_help;
    326326
    327327  _Thread_State_acquire( thread, &state_lock_context );
     
    349349)
    350350{
    351   Thread_Control *needs_help;
     351  bool needs_help;
    352352  Per_CPU_Control *cpu_self;
    353353
     
    396396  rtems_test_assert(executing_node->state == new_state);
    397397
    398   if (start_state != new_state) {
    399     switch (start_state) {
    400       case SCHEDULER_SMP_NODE_SCHEDULED:
    401         rtems_test_assert(needs_help == executing);
    402         break;
    403       case SCHEDULER_SMP_NODE_READY:
    404         rtems_test_assert(needs_help == other);
    405         break;
    406       default:
    407         rtems_test_assert(0);
    408         break;
    409     }
    410   } else {
    411     rtems_test_assert(needs_help == NULL);
     398  switch (new_state) {
     399    case SCHEDULER_SMP_NODE_SCHEDULED:
     400      rtems_test_assert(!needs_help);
     401      break;
     402    case SCHEDULER_SMP_NODE_READY:
     403      rtems_test_assert(needs_help);
     404      break;
     405    default:
     406      rtems_test_assert(0);
     407      break;
    412408  }
    413409
     
    474470}
    475471
    476 static Thread_Control *unblock_op(
     472static bool unblock_op(
    477473  Thread_Control *thread,
    478474  Scheduler_SMP_Node *scheduler_node
     
    482478  ISR_lock_Context state_lock_context;
    483479  ISR_lock_Context scheduler_lock_context;
    484   Thread_Control *needs_help;
     480  bool needs_help;
    485481
    486482  _Thread_State_acquire( thread, &state_lock_context );
     
    507503)
    508504{
    509   Thread_Control *needs_help;
     505  bool needs_help;
    510506  Per_CPU_Control *cpu_self;
    511507
     
    534530  switch (new_state) {
    535531    case SCHEDULER_SMP_NODE_SCHEDULED:
    536       rtems_test_assert(needs_help == other);
     532      rtems_test_assert(!needs_help);
    537533      break;
    538534    case SCHEDULER_SMP_NODE_READY:
    539       rtems_test_assert(needs_help == executing);
     535      rtems_test_assert(needs_help);
    540536      break;
    541537    default:
Note: See TracChangeset for help on using the changeset viewer.