[PATCH 08/30] score: Add _Scheduler_Node_get_scheduler()

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Oct 31 08:51:39 UTC 2016


Update #2556.
---
 cpukit/score/include/rtems/score/schedulernodeimpl.h | 8 ++++++++
 cpukit/score/src/threadqops.c                        | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/cpukit/score/include/rtems/score/schedulernodeimpl.h b/cpukit/score/include/rtems/score/schedulernodeimpl.h
index cf096aa..f590131 100644
--- a/cpukit/score/include/rtems/score/schedulernodeimpl.h
+++ b/cpukit/score/include/rtems/score/schedulernodeimpl.h
@@ -16,6 +16,7 @@
 #define _RTEMS_SCORE_SCHEDULERNODEIMPL_H
 
 #include <rtems/score/schedulernode.h>
+#include <rtems/score/priorityimpl.h>
 
 struct Scheduler_Control;
 
@@ -55,6 +56,13 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
 #endif
 }
 
+RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Node_get_scheduler(
+  const Scheduler_Node *node
+)
+{
+  return _Priority_Get_scheduler( &node->Wait.Priority );
+}
+
 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
   const Scheduler_Node *node
 )
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c
index 8652025..c0e0f67 100644
--- a/cpukit/score/src/threadqops.c
+++ b/cpukit/score/src/threadqops.c
@@ -263,7 +263,7 @@ static size_t _Thread_queue_Scheduler_index(
 #if defined(RTEMS_SMP)
   const Scheduler_Control *scheduler;
 
-  scheduler = _Priority_Get_scheduler( &scheduler_node->Wait.Priority );
+  scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
   return _Scheduler_Get_index( scheduler );
 #else
   (void) scheduler_node;
-- 
1.8.4.5




More information about the devel mailing list