Add and use _Scheduler_simple_Insert_as_first_order(),
_Scheduler_simple_Insert_as_last_order(),
_Scheduler_simple_Insert_as_first() and
_Scheduler_simple_Insert_as_last().
---
.../score/inline/rtems/score/schedulersimple.inl | 46
++++++++++++++++++++
.../score/src/schedulersimplereadyqueueenqueue.c | 21 +--------
.../src/schedulersimplereadyqueueenqueuefirst.c | 26
+----------
3 files changed, 50 insertions(+), 43 deletions(-)
diff --git a/cpukit/score/inline/rtems/score/schedulersimple.inl
b/cpukit/score/inline/rtems/score/schedulersimple.inl
index e67fc3c..1b58c85 100644
--- a/cpukit/score/inline/rtems/score/schedulersimple.inl
+++ b/cpukit/score/inline/rtems/score/schedulersimple.inl
@@ -48,6 +48,52 @@ RTEMS_INLINE_ROUTINE void
_Scheduler_simple_Ready_queue_requeue(
_Scheduler_simple_Ready_queue_enqueue( the_thread );
}
+RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Insert_as_first_order(
+ const Chain_Node *to_insert,
+ const Chain_Node *next
+)
+{
+ const Thread_Control *thread_to_insert = (const Thread_Control
*) to_insert;
+ const Thread_Control *thread_next = (const Thread_Control *) next;
+
+ return thread_to_insert->current_priority <=
thread_next->current_priority;
+}
+
+RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Insert_as_last_order(
+ const Chain_Node *to_insert,
+ const Chain_Node *next
+)
+{
+ const Thread_Control *thread_to_insert = (const Thread_Control
*) to_insert;
+ const Thread_Control *thread_next = (const Thread_Control *) next;
+
+ return thread_to_insert->current_priority <
thread_next->current_priority;
+}
+
+RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert_as_first(
+ Chain_Control *chain,
+ Thread_Control *to_insert
+)
+{
+ _Chain_Insert_ordered_unprotected(
+ chain,
+ &to_insert->Object.Node,
+ _Scheduler_simple_Insert_as_first_order
+ );
+}
+
+RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert_as_last(
+ Chain_Control *chain,
+ Thread_Control *to_insert
+)
+{
+ _Chain_Insert_ordered_unprotected(
+ chain,
+ &to_insert->Object.Node,
+ _Scheduler_simple_Insert_as_last_order
+ );
+}