Changeset b8f76fa in rtems


Ignore:
Timestamp:
Jun 9, 2016, 2:55:50 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
77ff5599
Parents:
c82835a
git-author:
Sebastian Huber <sebastian.huber@…> (06/09/16 14:55:50)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/22/16 12:00:29)
Message:

score: Delete unused _Scheduler_Priority_compare()

By convention, thread priorities must be integers in RTEMS. Smaller
values represent more important threads.

Location:
cpukit/score
Files:
2 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/Makefile.am

    rc82835a rb8f76fa  
    240240    src/schedulerpriorityblock.c \
    241241    src/schedulerprioritychangepriority.c \
    242     src/schedulerpriorityprioritycompare.c \
    243242    src/schedulerpriorityschedule.c \
    244243    src/schedulerpriorityunblock.c \
     
    259258    src/scheduleredfblock.c \
    260259    src/scheduleredfchangepriority.c \
    261     src/scheduleredfprioritycompare.c \
    262260    src/scheduleredfreleasejob.c \
    263261    src/scheduleredfschedule.c \
  • cpukit/score/include/rtems/score/scheduler.h

    rc82835a rb8f76fa  
    127127    const Scheduler_Control *,
    128128    Thread_Control *,
    129     Priority_Control
    130   );
    131 
    132   /** @see _Scheduler_Priority_compare() */
    133   int ( *priority_compare )(
    134     Priority_Control,
    135129    Priority_Control
    136130  );
  • cpukit/score/include/rtems/score/schedulercbs.h

    rc82835a rb8f76fa  
    6060    _Scheduler_default_Node_destroy, /* node destroy entry point */ \
    6161    _Scheduler_EDF_Update_priority,  /* update priority entry point */ \
    62     _Scheduler_EDF_Priority_compare, /* compares two priorities */ \
    6362    _Scheduler_CBS_Release_job,      /* new period of task */ \
    6463    _Scheduler_default_Tick,         /* tick entry point */ \
  • cpukit/score/include/rtems/score/scheduleredf.h

    rc82835a rb8f76fa  
    5353    _Scheduler_default_Node_destroy, /* node destroy entry point */ \
    5454    _Scheduler_EDF_Update_priority,  /* update priority entry point */ \
    55     _Scheduler_EDF_Priority_compare, /* compares two priorities */ \
    5655    _Scheduler_EDF_Release_job,      /* new period of task */ \
    5756    _Scheduler_default_Tick,         /* tick entry point */ \
     
    227226
    228227/**
    229  *  @brief Explicitly compare absolute dedlines (priorities) of threads.
    230  *
    231  * This routine explicitly compares absolute dedlines (priorities) of threads.
    232  * In case of EDF scheduling time overflow is taken into account.
    233  *
    234  * @retval >0 for p1 > p2; 0 for p1 == p2; <0 for p1 < p2.
    235  */
    236 int _Scheduler_EDF_Priority_compare (
    237   Priority_Control p1,
    238   Priority_Control p2
    239 );
    240 
    241 /**
    242228 *  @brief Called when a new job of task is released.
    243229 *
  • cpukit/score/include/rtems/score/scheduleredfimpl.h

    rc82835a rb8f76fa  
    4444  return (Scheduler_EDF_Node *) _Scheduler_Thread_get_node( the_thread );
    4545}
     46
     47int _Scheduler_EDF_Priority_compare (
     48  Priority_Control p1,
     49  Priority_Control p2
     50);
    4651
    4752RBTree_Compare_result _Scheduler_EDF_Compare(
  • cpukit/score/include/rtems/score/schedulerimpl.h

    rc82835a rb8f76fa  
    480480
    481481  _Scheduler_Release_critical( scheduler, &lock_context );
    482 }
    483 
    484 /**
    485  * @brief Compares two priority values.
    486  *
    487  * @param[in] scheduler The scheduler instance.
    488  * @param[in] p1 The first priority value.
    489  * @param[in] p2 The second priority value.
    490  *
    491  * @retval negative The value @a p1 encodes a lower priority than @a p2 in the
    492  * intuitive sense of priority.
    493  * @retval 0 The priorities @a p1 and @a p2 are equal.
    494  * @retval positive The value @a p1 encodes a higher priority than @a p2 in the
    495  * intuitive sense of priority.
    496  *
    497  * @see _Scheduler_Is_priority_lower_than() and
    498  * _Scheduler_Is_priority_higher_than().
    499  */
    500 RTEMS_INLINE_ROUTINE int _Scheduler_Priority_compare(
    501   const Scheduler_Control *scheduler,
    502   Priority_Control         p1,
    503   Priority_Control         p2
    504 )
    505 {
    506   return ( *scheduler->Operations.priority_compare )( p1, p2 );
    507482}
    508483
     
    745720    ( *schedule )( scheduler, the_thread, true );
    746721  }
    747 }
    748 
    749 /**
    750  * @brief Returns true if @a p1 encodes a lower priority than @a p2 in the
    751  * intuitive sense of priority.
    752  */
    753 RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_lower_than(
    754   const Scheduler_Control *scheduler,
    755   Priority_Control         p1,
    756   Priority_Control         p2
    757 )
    758 {
    759   return _Scheduler_Priority_compare( scheduler, p1,  p2 ) < 0;
    760 }
    761 
    762 /**
    763  * @brief Returns true if @a p1 encodes a higher priority than @a p2 in the
    764  * intuitive sense of priority.
    765  */
    766 RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_higher_than(
    767   const Scheduler_Control *scheduler,
    768   Priority_Control         p1,
    769   Priority_Control         p2
    770 )
    771 {
    772   return _Scheduler_Priority_compare( scheduler, p1,  p2 ) > 0;
    773722}
    774723
  • cpukit/score/include/rtems/score/schedulerpriority.h

    rc82835a rb8f76fa  
    5050    _Scheduler_default_Node_destroy,      /* node destroy entry point */ \
    5151    _Scheduler_priority_Update_priority,  /* update priority entry point */ \
    52     _Scheduler_priority_Priority_compare, /* compares two priorities */ \
    5352    _Scheduler_default_Release_job,       /* new period of task */ \
    5453    _Scheduler_default_Tick,              /* tick entry point */ \
     
    190189);
    191190
    192 /**
    193  *  @brief Compare two priorities.
    194  *
    195  *  This routine compares two priorities.
    196  *
    197  * @retval >0 for p1 > p2; 0 for p1 == p2; <0 for p1 < p2.
    198  */
    199 int _Scheduler_priority_Priority_compare(
    200   Priority_Control   p1,
    201   Priority_Control   p2
    202 );
    203 
    204191/**@}*/
    205192
  • cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h

    rc82835a rb8f76fa  
    6060    _Scheduler_default_Node_destroy, \
    6161    _Scheduler_priority_SMP_Update_priority, \
    62     _Scheduler_priority_Priority_compare, \
    6362    _Scheduler_default_Release_job, \
    6463    _Scheduler_default_Tick, \
  • cpukit/score/include/rtems/score/schedulerpriorityimpl.h

    rc82835a rb8f76fa  
    220220}
    221221
    222 /**
    223  * @brief Priority comparison.
    224  *
    225  * This routine implements priority comparison for priority-based
    226  * scheduling.
    227  *
    228  * @return >0 for higher priority, 0 for equal and <0 for lower priority.
    229  */
    230 RTEMS_INLINE_ROUTINE int _Scheduler_priority_Priority_compare_body(
    231   Priority_Control      p1,
    232   Priority_Control      p2
    233 )
    234 {
    235   /* High priority in priority scheduler is represented by low numbers. */
    236   return ( p2 - p1 );
    237 }
    238 
    239222/** @} */
    240223
  • cpukit/score/include/rtems/score/schedulerprioritysmp.h

    rc82835a rb8f76fa  
    8989    _Scheduler_default_Node_destroy, \
    9090    _Scheduler_priority_SMP_Update_priority, \
    91     _Scheduler_priority_Priority_compare, \
    9291    _Scheduler_default_Release_job, \
    9392    _Scheduler_default_Tick, \
  • cpukit/score/include/rtems/score/schedulersimple.h

    rc82835a rb8f76fa  
    5050    _Scheduler_default_Node_destroy,      /* node destroy entry point */ \
    5151    _Scheduler_default_Update_priority,   /* update priority entry point */ \
    52     _Scheduler_priority_Priority_compare, /* compares two priorities */ \
    5352    _Scheduler_default_Release_job,       /* new period of task */ \
    5453    _Scheduler_default_Tick,              /* tick entry point */ \
  • cpukit/score/include/rtems/score/schedulersimplesmp.h

    rc82835a rb8f76fa  
    7272    _Scheduler_default_Node_destroy, \
    7373    _Scheduler_simple_SMP_Update_priority, \
    74     _Scheduler_priority_Priority_compare, \
    7574    _Scheduler_default_Release_job, \
    7675    _Scheduler_default_Tick, \
  • cpukit/score/include/rtems/score/schedulerstrongapa.h

    rc82835a rb8f76fa  
    8989    _Scheduler_default_Node_destroy, \
    9090    _Scheduler_strong_APA_Update_priority, \
    91     _Scheduler_priority_Priority_compare, \
    9291    _Scheduler_default_Release_job, \
    9392    _Scheduler_default_Tick, \
  • cpukit/score/src/schedulercbsunblock.c

    rc82835a rb8f76fa  
    8080   */
    8181  if (
    82     _Scheduler_Is_priority_higher_than(
    83        scheduler,
    84        the_thread->current_priority,
    85        _Thread_Heir->current_priority
    86     )
     82    _Scheduler_EDF_Priority_compare(
     83      the_thread->current_priority,
     84      _Thread_Heir->current_priority
     85    ) == 1
    8786  ) {
    8887    _Scheduler_Update_heir(
  • cpukit/score/src/scheduleredf.c

    rc82835a rb8f76fa  
    2020
    2121#include <rtems/score/scheduleredfimpl.h>
     22
     23int _Scheduler_EDF_Priority_compare (
     24  Priority_Control p1,
     25  Priority_Control p2
     26)
     27{
     28  Watchdog_Interval time = _Watchdog_Ticks_since_boot;
     29
     30  /*
     31   * Reorder priorities to separate deadline driven and background tasks.
     32   *
     33   * The background tasks have p1 or p2 > SCHEDULER_EDF_PRIO_MSB.
     34   * The deadline driven tasks need to have subtracted current time in order
     35   * to see which deadline is closer wrt. current time.
     36   */
     37  if (!(p1 & SCHEDULER_EDF_PRIO_MSB))
     38    p1 = (p1 - time) & ~SCHEDULER_EDF_PRIO_MSB;
     39  if (!(p2 & SCHEDULER_EDF_PRIO_MSB))
     40    p2 = (p2 - time) & ~SCHEDULER_EDF_PRIO_MSB;
     41
     42  return ((p1<p2) - (p1>p2));
     43}
    2244
    2345RBTree_Compare_result _Scheduler_EDF_Compare(
  • cpukit/score/src/scheduleredfunblock.c

    rc82835a rb8f76fa  
    4343   *    a pseudo-ISR system task, we need to do a context switch.
    4444   */
    45   if ( _Scheduler_Is_priority_lower_than(
    46          scheduler,
    47          _Thread_Heir->current_priority,
    48          the_thread->current_priority )) {
     45  if (
     46    _Scheduler_EDF_Priority_compare(
     47      the_thread->current_priority,
     48      _Thread_Heir->current_priority
     49    ) == 1
     50  ) {
    4951    _Scheduler_Update_heir(
    5052      the_thread,
Note: See TracChangeset for help on using the changeset viewer.