summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-24 07:44:00 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:42 +0200
commit298d0fda9df75d2b7c4b9329a78845cb1398342b (patch)
treebf3a234ad224779cdea22fa5209d87511ca1408d
parentscore: PR2151: _Thread_queue_Extract_with_proxy() (diff)
downloadrtems-298d0fda9df75d2b7c4b9329a78845cb1398342b.tar.bz2
score: Add _Scheduler_Highest_priority_of_two()
Use inline functions instead of macros for _Scheduler_Is_priority_lower_than() and _Scheduler_Is_priority_higher_than().
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 7fbaf54eb3..e70e466426 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -269,18 +269,40 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block(
}
/**
- * Macro testing whether @a p1 has lower priority than @a p2
- * in the intuitive sense of priority.
+ * @brief Returns true if @p1 encodes a lower priority than @a p2 in the
+ * intuitive sense of priority.
*/
-#define _Scheduler_Is_priority_lower_than( _p1, _p2 ) \
- (_Scheduler_Priority_compare(_p1,_p2) < 0)
+RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_lower_than(
+ Priority_Control p1,
+ Priority_Control p2
+)
+{
+ return _Scheduler_Priority_compare( p1, p2 ) < 0;
+}
/**
- * Macro testing whether @a p1 has higher priority than @a p2
+ * @brief Returns true if @p1 encodes a higher priority than @a p2 in the
+ * intuitive sense of priority.
+ */
+RTEMS_INLINE_ROUTINE bool _Scheduler_Is_priority_higher_than(
+ Priority_Control p1,
+ Priority_Control p2
+)
+{
+ return _Scheduler_Priority_compare( p1, p2 ) > 0;
+}
+
+/**
+ * @brief Returns the priority encoding @a p1 or @a p2 with the higher priority
* in the intuitive sense of priority.
*/
-#define _Scheduler_Is_priority_higher_than( _p1, _p2 ) \
- (_Scheduler_Priority_compare(_p1,_p2) > 0)
+RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Highest_priority_of_two(
+ Priority_Control p1,
+ Priority_Control p2
+)
+{
+ return _Scheduler_Is_priority_higher_than( p1, p2 ) ? p1 : p2;
+}
/** @} */