<div dir="ltr">What architecture were those sizes on? Do the size changes hold on<div>other architectures? </div><div><br></div><div>Good spot if it is consistent.</div><div><br></div><div>--joel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 16, 2017 at 11:57 PM, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thread priority changes may append or prepend the thread to its priority<br>
group on the scheduler ready queue. Previously, a separate priority<br>
value and a prepend-it flag in the scheduler node were used to propagate<br>
a priority change to the scheduler.<br>
<br>
Now, use an append-it bit in the priority control and reduce the plain<br>
priority value to 63 bits.<br>
<br>
This change leads to a significant code size reduction (about 25%) of<br>
the SMP schedulers. The negligible increase of the standard priority<br>
scheduler is due to some additional shift operations<br>
(SCHEDULER_PRIORITY_MAP() and SCHEDULER_PRIORITY_UNMAP()).<br>
<br>
Before:<br>
<br>
text filename<br>
136 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleblock.o<br>
464 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimplechangepriority.<wbr>o<br>
24 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimple.o<br>
108 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleschedule.o<br>
292 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleunblock.o<br>
264 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleyield.o<br>
<br>
text filename<br>
280 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityblock.o<br>
488 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerprioritychangepriorit<wbr>y.o<br>
200 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriority.o<br>
164 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityschedule.o<br>
328 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityunblock.o<br>
200 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityyield.o<br>
<br>
text filename<br>
24112 arm-rtems5/c/imx7/cpukit/<wbr>score/src/libscore_a-<wbr>scheduleredfsmp.o<br>
<br>
text filename<br>
37204 sparc-rtems5/c/gr740/cpukit/<wbr>score/src/libscore_a-<wbr>scheduleredfsmp.o<br>
<br>
text filename<br>
42236 powerpc-rtems5/c/qoriq_e6500_<wbr>32/cpukit/score/src/libscore_<wbr>a-scheduleredfsmp.o<br>
<br>
After:<br>
<br>
text filename<br>
136 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleblock.o<br>
272 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimplechangepriority.<wbr>o<br>
24 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimple.o<br>
108 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleschedule.o<br>
292 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleunblock.o<br>
264 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulersimpleyield.o<br>
<br>
text filename<br>
280 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityblock.o<br>
488 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerprioritychangepriorit<wbr>y.o<br>
208 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriority.o<br>
164 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityschedule.o<br>
332 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityunblock.o<br>
200 sparc-rtems5/c/erc32/cpukit/<wbr>score/src/libscore_a-<wbr>schedulerpriorityyield.o<br>
<br>
text filename<br>
18860 arm-rtems5/c/imx7/cpukit/<wbr>score/src/libscore_a-<wbr>scheduleredfsmp.o<br>
<br>
text filename<br>
28520 sparc-rtems5/c/gr740/cpukit/<wbr>score/src/libscore_a-<wbr>scheduleredfsmp.o<br>
<br>
text filename<br>
32664 powerpc-rtems5/c/qoriq_e6500_<wbr>32/cpukit/score/src/libscore_<wbr>a-scheduleredfsmp.o<br>
---<br>
cpukit/score/include/rtems/<wbr>score/priority.h | 16 +-<br>
cpukit/score/include/rtems/<wbr>score/scheduler.h | 21 ++-<br>
.../score/include/rtems/score/<wbr>scheduleredfimpl.h | 22 +--<br>
cpukit/score/include/rtems/<wbr>score/schedulerimpl.h | 30 ++++<br>
cpukit/score/include/rtems/<wbr>score/schedulernode.h | 13 +-<br>
.../score/include/rtems/score/<wbr>schedulernodeimpl.h | 18 +-<br>
.../include/rtems/score/<wbr>schedulerpriorityimpl.h | 6 +-<br>
.../include/rtems/score/<wbr>schedulerprioritysmpimpl.h | 75 ++++----<br>
.../include/rtems/score/<wbr>schedulersimpleimpl.h | 52 +-----<br>
.../score/include/rtems/score/<wbr>schedulersmpimpl.h | 191 +++++++++------------<br>
cpukit/score/src/<wbr>schedulercbsunblock.c | 5 +-<br>
cpukit/score/src/<wbr>schedulerdefaultmappriority.c | 14 +-<br>
cpukit/score/src/<wbr>scheduleredfchangepriority.c | 13 +-<br>
cpukit/score/src/<wbr>scheduleredfreleasejob.c | 4 +-<br>
cpukit/score/src/<wbr>scheduleredfsmp.c | 184 +++++---------------<br>
cpukit/score/src/<wbr>scheduleredfunblock.c | 9 +-<br>
cpukit/score/src/<wbr>schedulerpriority.c | 3 +-<br>
cpukit/score/src/<wbr>schedulerpriorityaffinitysmp.c | 150 +++++-----------<br>
cpukit/score/src/<wbr>schedulerprioritychangepriorit<wbr>y.c | 19 +-<br>
cpukit/score/src/<wbr>schedulerprioritysmp.c | 116 +++----------<br>
cpukit/score/src/<wbr>schedulerpriorityunblock.c | 11 +-<br>
cpukit/score/src/<wbr>schedulersimplechangepriority.<wbr>c | 12 +-<br>
cpukit/score/src/<wbr>schedulersimplesmp.c | 161 +++++------------<br>
cpukit/score/src/<wbr>schedulersimpleunblock.c | 6 +-<br>
cpukit/score/src/<wbr>schedulersimpleyield.c | 10 +-<br>
cpukit/score/src/<wbr>schedulerstrongapa.c | 176 ++++++-------------<br>
.../smptests/smpscheduler01/<wbr>smpscheduler01.doc | 2 +-<br>
testsuites/sptests/<wbr>spintrcritical23/init.c | 15 +-<br>
28 files changed, 485 insertions(+), 869 deletions(-)<br>
<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/priority.h b/cpukit/score/include/rtems/<wbr>score/priority.h<br>
index 9cc6338288..7a8ddba763 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/priority.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/priority.h<br>
@@ -8,7 +8,7 @@<br>
* COPYRIGHT (c) 1989-2011.<br>
* On-Line Applications Research Corporation (OAR).<br>
*<br>
- * Copyright (c) 2016 embedded brains GmbH.<br>
+ * Copyright (c) 2016, 2017 embedded brains GmbH.<br>
*<br>
* The license and distribution terms for this file may be<br>
* found in the file LICENSE in this distribution or at<br>
@@ -45,11 +45,23 @@ extern "C" {<br>
*/<br>
<br>
/**<br>
- * @brief A plain thread priority value.<br>
+ * @brief The thread priority control.<br>
*<br>
* Lower values represent higher priorities. So, a priority value of zero<br>
* represents the highest priority thread. This value is reserved for internal<br>
* threads and the priority ceiling protocol.<br>
+ *<br>
+ * The format of the thread priority control depends on the context. A thread<br>
+ * priority control may contain a user visible priority for API import/export.<br>
+ * It may also contain a scheduler internal priority value. Values are<br>
+ * translated via the scheduler map/unmap priority operations. The format of<br>
+ * scheduler interal values depend on the particular scheduler implementation.<br>
+ * It may for example encode a deadline in case of the EDF scheduler.<br>
+ *<br>
+ * The thread priority control value contained in the scheduler node<br>
+ * (Scheduler_Node::Priority::<wbr>value) uses the least-significant bit to indicate<br>
+ * if the thread should be appended or prepended to its priority group, see<br>
+ * SCHEDULER_PRIORITY_APPEND().<br>
*/<br>
typedef uint64_t Priority_Control;<br>
<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/scheduler.h b/cpukit/score/include/rtems/<wbr>score/scheduler.h<br>
index 669f82c48c..a6066c8e4a 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/scheduler.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/scheduler.h<br>
@@ -334,19 +334,32 @@ extern const Scheduler_Control _Scheduler_Table[];<br>
#endif<br>
<br>
/**<br>
- * @brief Returns the thread priority.<br>
+ * @brief Returns the scheduler internal thread priority mapped by<br>
+ * SCHEDULER_PRIORITY_MAP().<br>
*<br>
* @param[in] scheduler Unused.<br>
- * @param[in] priority The thread priority.<br>
+ * @param[in] priority The user visible thread priority.<br>
*<br>
- * @return priority The thread priority.<br>
+ * @return priority The scheduler internal thread priority.<br>
*/<br>
Priority_Control _Scheduler_default_Map_<wbr>priority(<br>
const Scheduler_Control *scheduler,<br>
Priority_Control priority<br>
);<br>
<br>
-#define _Scheduler_default_Unmap_<wbr>priority _Scheduler_default_Map_<wbr>priority<br>
+/**<br>
+ * @brief Returns the user visible thread priority unmapped by<br>
+ * SCHEDULER_PRIORITY_UNMAP().<br>
+ *<br>
+ * @param[in] scheduler Unused.<br>
+ * @param[in] priority The scheduler internal thread priority.<br>
+ *<br>
+ * @return priority The user visible thread priority.<br>
+ */<br>
+Priority_Control _Scheduler_default_Unmap_<wbr>priority(<br>
+ const Scheduler_Control *scheduler,<br>
+ Priority_Control priority<br>
+);<br>
<br>
#if defined(RTEMS_SMP)<br>
/**<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/scheduleredfimpl.h b/cpukit/score/include/rtems/<wbr>score/scheduleredfimpl.h<br>
index 94a78fcff5..f6bd7d8384 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/scheduleredfimpl.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/scheduleredfimpl.h<br>
@@ -79,7 +79,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less(<br>
return prio_left < prio_right;<br>
}<br>
<br>
-RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less_or_equal(<br>
+RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Priority_less_<wbr>equal(<br>
const void *left,<br>
const RBTree_Node *right<br>
)<br>
@@ -101,28 +101,14 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less_or_equal(<br>
RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Enqueue(<br>
Scheduler_EDF_Context *context,<br>
Scheduler_EDF_Node *node,<br>
- Priority_Control priority<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
_RBTree_Insert_inline(<br>
&context->Ready,<br>
&node->Node,<br>
- &priority,<br>
- _Scheduler_EDF_Less<br>
- );<br>
-}<br>
-<br>
-RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Enqueue_first(<br>
- Scheduler_EDF_Context *context,<br>
- Scheduler_EDF_Node *node,<br>
- Priority_Control priority<br>
-)<br>
-{<br>
- _RBTree_Insert_inline(<br>
- &context->Ready,<br>
- &node->Node,<br>
- &priority,<br>
- _Scheduler_EDF_Less_or_equal<br>
+ &insert_priority,<br>
+ _Scheduler_EDF_Priority_less_<wbr>equal<br>
);<br>
}<br>
<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/schedulerimpl.h b/cpukit/score/include/rtems/<wbr>score/schedulerimpl.h<br>
index ba04ec9492..10c12242a9 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/schedulerimpl.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/schedulerimpl.h<br>
@@ -37,6 +37,36 @@ extern "C" {<br>
/**@{**/<br>
<br>
/**<br>
+ * @brief Maps a priority value to support the append indicator.<br>
+ */<br>
+#define SCHEDULER_PRIORITY_MAP( priority ) ( ( priority ) << 1 )<br>
+<br>
+/**<br>
+ * @brief Returns the plain priority value.<br>
+ */<br>
+#define SCHEDULER_PRIORITY_UNMAP( priority ) ( ( priority ) >> 1 )<br>
+<br>
+/**<br>
+ * @brief Clears the priority append indicator bit.<br>
+ */<br>
+#define SCHEDULER_PRIORITY_PURIFY( priority ) \<br>
+ ( ( priority ) & ~( (Priority_Control) SCHEDULER_PRIORITY_APPEND_FLAG ) )<br>
+<br>
+/**<br>
+ * @brief Returns the priority control with the append indicator bit set.<br>
+ */<br>
+#define SCHEDULER_PRIORITY_APPEND( priority ) \<br>
+ ( ( priority ) | SCHEDULER_PRIORITY_APPEND_FLAG )<br>
+<br>
+/**<br>
+ * @brief Returns true, if the item should be appended to its priority group,<br>
+ * otherwise returns false and the item should be prepended to its priority<br>
+ * group.<br>
+ */<br>
+#define SCHEDULER_PRIORITY_IS_APPEND( priority ) \<br>
+ ( ( ( priority ) & SCHEDULER_PRIORITY_APPEND_FLAG ) != 0 )<br>
+<br>
+/**<br>
* @brief Initializes the scheduler to the policy chosen by the user.<br>
*<br>
* This routine initializes the scheduler to the policy chosen by the user<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/schedulernode.h b/cpukit/score/include/rtems/<wbr>score/schedulernode.h<br>
index 1474b0c13c..d62e983853 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/schedulernode.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/schedulernode.h<br>
@@ -175,6 +175,12 @@ struct Scheduler_Node {<br>
*<br>
* The producer of this value is _Thread_Change_priority(). The consumer<br>
* is the scheduler via the unblock and update priority operations.<br>
+ *<br>
+ * This priority control consists of two parts. One part is the plain<br>
+ * priority value (most-significant 63 bits). The other part is the<br>
+ * least-significant bit which indicates if the thread should be appended<br>
+ * (bit set) or prepended (bit cleared) to its priority group, see<br>
+ * SCHEDULER_PRIORITY_APPEND().<br>
*/<br>
Priority_Control value;<br>
<br>
@@ -184,13 +190,6 @@ struct Scheduler_Node {<br>
*/<br>
SMP_sequence_lock_Control Lock;<br>
#endif<br>
-<br>
- /**<br>
- * @brief In case a priority update is necessary and this is true, then<br>
- * enqueue the thread as the first of its priority group, otherwise enqueue<br>
- * the thread as the last of its priority group.<br>
- */<br>
- bool prepend_it;<br>
} Priority;<br>
};<br>
<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/schedulernodeimpl.h b/cpukit/score/include/rtems/<wbr>score/schedulernodeimpl.h<br>
index 9ac0334979..8997b3f218 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/schedulernodeimpl.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/schedulernodeimpl.h<br>
@@ -1,5 +1,5 @@<br>
/*<br>
- * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved.<br>
+ * Copyright (c) 2014, 2017 embedded brains GmbH. All rights reserved.<br>
*<br>
* embedded brains GmbH<br>
* Dornierstr. 4<br>
@@ -30,6 +30,12 @@ extern "C" {<br>
#define SCHEDULER_NODE_OF_WAIT_<wbr>PRIORITY( node ) \<br>
RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority )<br>
<br>
+/**<br>
+ * @brief Priority append indicator for the priority control used for the<br>
+ * scheduler node priority.<br>
+ */<br>
+#define SCHEDULER_PRIORITY_APPEND_FLAG 1<br>
+<br>
RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(<br>
const struct _Scheduler_Control *scheduler,<br>
Scheduler_Node *node,<br>
@@ -40,7 +46,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(<br>
node->owner = the_thread;<br>
<br>
node->Priority.value = priority;<br>
- node->Priority.prepend_it = false;<br>
<br>
#if defined(RTEMS_SMP)<br>
_Chain_Initialize_node( &node->Thread.Wait_node );<br>
@@ -69,12 +74,10 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(<br>
}<br>
<br>
RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(<br>
- Scheduler_Node *node,<br>
- bool *prepend_it_p<br>
+ Scheduler_Node *node<br>
)<br>
{<br>
Priority_Control priority;<br>
- bool prepend_it;<br>
<br>
#if defined(RTEMS_SMP)<br>
unsigned int seq;<br>
@@ -84,14 +87,11 @@ RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(<br>
#endif<br>
<br>
priority = node->Priority.value;<br>
- prepend_it = node->Priority.prepend_it;<br>
<br>
#if defined(RTEMS_SMP)<br>
} while ( _SMP_sequence_lock_Read_retry( &node->Priority.Lock, seq ) );<br>
#endif<br>
<br>
- *prepend_it_p = prepend_it;<br>
-<br>
return priority;<br>
}<br>
<br>
@@ -107,8 +107,8 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(<br>
seq = _SMP_sequence_lock_Write_<wbr>begin( &node->Priority.Lock );<br>
#endif<br>
<br>
+ new_priority |= ( prepend_it ? 0 : SCHEDULER_PRIORITY_APPEND_FLAG );<br>
node->Priority.value = new_priority;<br>
- node->Priority.prepend_it = prepend_it;<br>
<br>
#if defined(RTEMS_SMP)<br>
_SMP_sequence_lock_Write_end( &node->Priority.Lock, seq );<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/schedulerpriorityimpl.h b/cpukit/score/include/rtems/<wbr>score/schedulerpriorityimpl.h<br>
index 68c61c16f3..354065fac4 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/schedulerpriorityimpl.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/schedulerpriorityimpl.h<br>
@@ -216,18 +216,18 @@ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_<wbr>body(<br>
*/<br>
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_<wbr>queue_update(<br>
Scheduler_priority_Ready_queue *ready_queue,<br>
- Priority_Control new_priority,<br>
+ unsigned int new_priority,<br>
Priority_bit_map_Control *bit_map,<br>
Chain_Control *ready_queues<br>
)<br>
{<br>
- ready_queue->current_priority = (unsigned int) new_priority;<br>
+ ready_queue->current_priority = new_priority;<br>
ready_queue->ready_chain = &ready_queues[ new_priority ];<br>
<br>
_Priority_bit_map_Initialize_<wbr>information(<br>
bit_map,<br>
&ready_queue->Priority_map,<br>
- (unsigned int) new_priority<br>
+ new_priority<br>
);<br>
}<br>
<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/<wbr>schedulerprioritysmpimpl.h b/cpukit/score/include/rtems/<wbr>score/<wbr>schedulerprioritysmpimpl.h<br>
index 073a7ade06..17d6e552f3 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/<wbr>schedulerprioritysmpimpl.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/<wbr>schedulerprioritysmpimpl.h<br>
@@ -7,7 +7,7 @@<br>
*/<br>
<br>
/*<br>
- * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved.<br>
+ * Copyright (c) 2013, 2017 embedded brains GmbH. All rights reserved.<br>
*<br>
* embedded brains GmbH<br>
* Dornierstr. 4<br>
@@ -90,7 +90,7 @@ static inline void _Scheduler_priority_SMP_Move_<wbr>from_ready_to_scheduled(<br>
{<br>
Scheduler_priority_SMP_Context *self;<br>
Scheduler_priority_SMP_Node *node;<br>
- Priority_Control priority;<br>
+ Priority_Control insert_priority;<br>
<br>
self = _Scheduler_priority_SMP_Get_<wbr>self( context );<br>
node = _Scheduler_priority_SMP_Node_<wbr>downcast( ready_to_scheduled );<br>
@@ -100,47 +100,41 @@ static inline void _Scheduler_priority_SMP_Move_<wbr>from_ready_to_scheduled(<br>
&node->Ready_queue,<br>
&self->Bit_map<br>
);<br>
- priority = node->Base.priority;<br>
+ insert_priority = _Scheduler_SMP_Node_priority( &node->Base.Base );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
_Chain_Insert_ordered_<wbr>unprotected(<br>
&self->Base.Scheduled,<br>
&node->Base.Base.Node.Chain,<br>
- &priority,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order<br>
+ &insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal<br>
);<br>
}<br>
<br>
-static inline void _Scheduler_priority_SMP_<wbr>Insert_ready_lifo(<br>
+static inline void _Scheduler_priority_SMP_<wbr>Insert_ready(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *thread<br>
-)<br>
-{<br>
- Scheduler_priority_SMP_Context *self =<br>
- _Scheduler_priority_SMP_Get_<wbr>self( context );<br>
- Scheduler_priority_SMP_Node *node =<br>
- _Scheduler_priority_SMP_Node_<wbr>downcast( thread );<br>
-<br>
- _Scheduler_priority_Ready_<wbr>queue_enqueue(<br>
- &node->Base.Base.Node.Chain,<br>
- &node->Ready_queue,<br>
- &self->Bit_map<br>
- );<br>
-}<br>
-<br>
-static inline void _Scheduler_priority_SMP_<wbr>Insert_ready_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *thread<br>
+ Scheduler_Node *node_base,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- Scheduler_priority_SMP_Context *self =<br>
- _Scheduler_priority_SMP_Get_<wbr>self( context );<br>
- Scheduler_priority_SMP_Node *node =<br>
- _Scheduler_priority_SMP_Node_<wbr>downcast( thread );<br>
+ Scheduler_priority_SMP_Context *self;<br>
+ Scheduler_priority_SMP_Node *node;<br>
<br>
- _Scheduler_priority_Ready_<wbr>queue_enqueue_first(<br>
- &node->Base.Base.Node.Chain,<br>
- &node->Ready_queue,<br>
- &self->Bit_map<br>
- );<br>
+ self = _Scheduler_priority_SMP_Get_<wbr>self( context );<br>
+ node = _Scheduler_priority_SMP_Node_<wbr>downcast( node_base );<br>
+<br>
+ if ( SCHEDULER_PRIORITY_IS_APPEND( insert_priority ) ) {<br>
+ _Scheduler_priority_Ready_<wbr>queue_enqueue(<br>
+ &node->Base.Base.Node.Chain,<br>
+ &node->Ready_queue,<br>
+ &self->Bit_map<br>
+ );<br>
+ } else {<br>
+ _Scheduler_priority_Ready_<wbr>queue_enqueue_first(<br>
+ &node->Base.Base.Node.Chain,<br>
+ &node->Ready_queue,<br>
+ &self->Bit_map<br>
+ );<br>
+ }<br>
}<br>
<br>
static inline void _Scheduler_priority_SMP_<wbr>Extract_from_ready(<br>
@@ -162,19 +156,20 @@ static inline void _Scheduler_priority_SMP_<wbr>Extract_from_ready(<br>
<br>
static inline void _Scheduler_priority_SMP_Do_<wbr>update(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node_to_update,<br>
- Priority_Control new_priority<br>
+ Scheduler_Node *node_to_update,<br>
+ Priority_Control new_priority<br>
)<br>
{<br>
- Scheduler_priority_SMP_Context *self =<br>
- _Scheduler_priority_SMP_Get_<wbr>self( context );<br>
- Scheduler_priority_SMP_Node *node =<br>
- _Scheduler_priority_SMP_Node_<wbr>downcast( node_to_update );<br>
+ Scheduler_priority_SMP_Context *self;<br>
+ Scheduler_priority_SMP_Node *node;<br>
+<br>
+ self = _Scheduler_priority_SMP_Get_<wbr>self( context );<br>
+ node = _Scheduler_priority_SMP_Node_<wbr>downcast( node_to_update );<br>
<br>
_Scheduler_SMP_Node_update_<wbr>priority( &node->Base, new_priority );<br>
_Scheduler_priority_Ready_<wbr>queue_update(<br>
&node->Ready_queue,<br>
- new_priority,<br>
+ SCHEDULER_PRIORITY_UNMAP( new_priority ),<br>
&self->Bit_map,<br>
&self->Ready[ 0 ]<br>
);<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/schedulersimpleimpl.h b/cpukit/score/include/rtems/<wbr>score/schedulersimpleimpl.h<br>
index ec74cdc586..3891839281 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/schedulersimpleimpl.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/schedulersimpleimpl.h<br>
@@ -38,65 +38,31 @@ RTEMS_INLINE_ROUTINE Scheduler_simple_Context *<br>
return (Scheduler_simple_Context *) _Scheduler_Get_context( scheduler );<br>
}<br>
<br>
-RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Insert_<wbr>priority_lifo_order(<br>
+RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Priority_<wbr>less_equal(<br>
const void *to_insert,<br>
const Chain_Node *next<br>
)<br>
{<br>
- const Priority_Control *priority_to_insert;<br>
- const Thread_Control *thread_next;<br>
+ const unsigned int *priority_to_insert;<br>
+ const Thread_Control *thread_next;<br>
<br>
- priority_to_insert = (const Priority_Control *) to_insert;<br>
+ priority_to_insert = (const unsigned int *) to_insert;<br>
thread_next = (const Thread_Control *) next;<br>
<br>
return *priority_to_insert <= _Thread_Get_priority( thread_next );<br>
}<br>
<br>
-RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Insert_<wbr>priority_fifo_order(<br>
- const void *to_insert,<br>
- const Chain_Node *next<br>
-)<br>
-{<br>
- const Priority_Control *priority_to_insert;<br>
- const Thread_Control *thread_next;<br>
-<br>
- priority_to_insert = (const Priority_Control *) to_insert;<br>
- thread_next = (const Thread_Control *) next;<br>
-<br>
- return *priority_to_insert < _Thread_Get_priority( thread_next );<br>
-}<br>
-<br>
-RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert_<wbr>priority_lifo(<br>
- Chain_Control *chain,<br>
- Thread_Control *to_insert<br>
-)<br>
-{<br>
- Priority_Control priority_to_insert;<br>
-<br>
- priority_to_insert = _Thread_Get_priority( to_insert );<br>
-<br>
- _Chain_Insert_ordered_<wbr>unprotected(<br>
- chain,<br>
- &to_insert->Object.Node,<br>
- &priority_to_insert,<br>
- _Scheduler_simple_Insert_<wbr>priority_lifo_order<br>
- );<br>
-}<br>
-<br>
-RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert_<wbr>priority_fifo(<br>
+RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert(<br>
Chain_Control *chain,<br>
- Thread_Control *to_insert<br>
+ Thread_Control *to_insert,<br>
+ unsigned int insert_priority<br>
)<br>
{<br>
- Priority_Control priority_to_insert;<br>
-<br>
- priority_to_insert = _Thread_Get_priority( to_insert );<br>
-<br>
_Chain_Insert_ordered_<wbr>unprotected(<br>
chain,<br>
&to_insert->Object.Node,<br>
- &priority_to_insert,<br>
- _Scheduler_simple_Insert_<wbr>priority_fifo_order<br>
+ &insert_priority,<br>
+ _Scheduler_simple_Priority_<wbr>less_equal<br>
);<br>
}<br>
<br>
diff --git a/cpukit/score/include/rtems/<wbr>score/schedulersmpimpl.h b/cpukit/score/include/rtems/<wbr>score/schedulersmpimpl.h<br>
index 896b1306ab..e152eb0878 100644<br>
--- a/cpukit/score/include/rtems/<wbr>score/schedulersmpimpl.h<br>
+++ b/cpukit/score/include/rtems/<wbr>score/schedulersmpimpl.h<br>
@@ -42,8 +42,8 @@ extern "C" {<br>
* - @ref SCHEDULER_SMP_NODE_READY.<br>
*<br>
* State transitions are triggered via basic operations<br>
- * - _Scheduler_SMP_Enqueue_<wbr>ordered(),<br>
- * - _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(), and<br>
+ * - _Scheduler_SMP_Enqueue(),<br>
+ * - _Scheduler_SMP_Enqueue_<wbr>scheduled(), and<br>
* - _Scheduler_SMP_Block().<br>
*<br>
* @dot<br>
@@ -296,7 +296,8 @@ typedef void ( *Scheduler_SMP_Extract )(<br>
<br>
typedef void ( *Scheduler_SMP_Insert )(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node_to_insert<br>
+ Scheduler_Node *node_to_insert,<br>
+ Priority_Control insert_priority<br>
);<br>
<br>
typedef void ( *Scheduler_SMP_Move )(<br>
@@ -324,7 +325,8 @@ typedef void ( *Scheduler_SMP_Set_affinity )(<br>
<br>
typedef bool ( *Scheduler_SMP_Enqueue )(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node_to_enqueue<br>
+ Scheduler_Node *node_to_enqueue,<br>
+ Priority_Control priority<br>
);<br>
<br>
typedef void ( *Scheduler_SMP_Allocate_<wbr>processor )(<br>
@@ -351,7 +353,7 @@ static inline void _Scheduler_SMP_Do_nothing_<wbr>register_idle(<br>
(void) cpu;<br>
}<br>
<br>
-static inline bool _Scheduler_SMP_Insert_<wbr>priority_lifo_order(<br>
+static inline bool _Scheduler_SMP_Priority_less_<wbr>equal(<br>
const void *to_insert,<br>
const Chain_Node *next<br>
)<br>
@@ -365,20 +367,6 @@ static inline bool _Scheduler_SMP_Insert_<wbr>priority_lifo_order(<br>
return *priority_to_insert <= node_next->priority;<br>
}<br>
<br>
-static inline bool _Scheduler_SMP_Insert_<wbr>priority_fifo_order(<br>
- const void *to_insert,<br>
- const Chain_Node *next<br>
-)<br>
-{<br>
- const Priority_Control *priority_to_insert;<br>
- const Scheduler_SMP_Node *node_next;<br>
-<br>
- priority_to_insert = (const Priority_Control *) to_insert;<br>
- node_next = (const Scheduler_SMP_Node *) next;<br>
-<br>
- return *priority_to_insert < node_next->priority;<br>
-}<br>
-<br>
static inline Scheduler_SMP_Context *_Scheduler_SMP_Get_self(<br>
Scheduler_Context *context<br>
)<br>
@@ -637,6 +625,7 @@ static inline Scheduler_Node *_Scheduler_SMP_Get_lowest_<wbr>scheduled(<br>
static inline void _Scheduler_SMP_Enqueue_to_<wbr>scheduled(<br>
Scheduler_Context *context,<br>
Scheduler_Node *node,<br>
+ Priority_Control priority,<br>
Scheduler_Node *lowest_scheduled,<br>
Scheduler_SMP_Insert insert_scheduled,<br>
Scheduler_SMP_Move move_from_scheduled_to_ready,<br>
@@ -660,7 +649,7 @@ static inline void _Scheduler_SMP_Enqueue_to_<wbr>scheduled(<br>
allocate_processor<br>
);<br>
<br>
- ( *insert_scheduled )( context, node );<br>
+ ( *insert_scheduled )( context, node, priority );<br>
( *move_from_scheduled_to_ready )( context, lowest_scheduled );<br>
<br>
_Scheduler_Release_idle_<wbr>thread(<br>
@@ -675,7 +664,7 @@ static inline void _Scheduler_SMP_Enqueue_to_<wbr>scheduled(<br>
);<br>
_Scheduler_SMP_Node_change_<wbr>state( node, SCHEDULER_SMP_NODE_SCHEDULED );<br>
<br>
- ( *insert_scheduled )( context, node );<br>
+ ( *insert_scheduled )( context, node, priority );<br>
( *move_from_scheduled_to_ready )( context, lowest_scheduled );<br>
<br>
_Scheduler_Exchange_idle_<wbr>thread(<br>
@@ -696,6 +685,7 @@ static inline void _Scheduler_SMP_Enqueue_to_<wbr>scheduled(<br>
*<br>
* @param[in] context The scheduler instance context.<br>
* @param[in] node The node to enqueue.<br>
+ * @param[in] priority The node insert priority.<br>
* @param[in] order The order function.<br>
* @param[in] insert_ready Function to insert a node into the set of ready<br>
* nodes.<br>
@@ -710,9 +700,10 @@ static inline void _Scheduler_SMP_Enqueue_to_<wbr>scheduled(<br>
* @param[in] allocate_processor Function to allocate a processor to a node<br>
* based on the rules of the scheduler.<br>
*/<br>
-static inline bool _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
+static inline bool _Scheduler_SMP_Enqueue(<br>
Scheduler_Context *context,<br>
Scheduler_Node *node,<br>
+ Priority_Control insert_priority,<br>
Chain_Node_order order,<br>
Scheduler_SMP_Insert insert_ready,<br>
Scheduler_SMP_Insert insert_scheduled,<br>
@@ -721,17 +712,16 @@ static inline bool _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
Scheduler_SMP_Allocate_<wbr>processor allocate_processor<br>
)<br>
{<br>
- bool needs_help;<br>
- Scheduler_Node *lowest_scheduled;<br>
- Priority_Control node_priority;<br>
+ bool needs_help;<br>
+ Scheduler_Node *lowest_scheduled;<br>
<br>
lowest_scheduled = ( *get_lowest_scheduled )( context, node );<br>
- node_priority = _Scheduler_SMP_Node_priority( node );<br>
<br>
- if ( ( *order )( &node_priority, &lowest_scheduled->Node.Chain ) ) {<br>
+ if ( ( *order )( &insert_priority, &lowest_scheduled->Node.Chain ) ) {<br>
_Scheduler_SMP_Enqueue_to_<wbr>scheduled(<br>
context,<br>
node,<br>
+ insert_priority,<br>
lowest_scheduled,<br>
insert_scheduled,<br>
move_from_scheduled_to_ready,<br>
@@ -739,7 +729,7 @@ static inline bool _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
);<br>
needs_help = false;<br>
} else {<br>
- ( *insert_ready )( context, node );<br>
+ ( *insert_ready )( context, node, insert_priority );<br>
needs_help = true;<br>
}<br>
<br>
@@ -765,9 +755,10 @@ static inline bool _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
* @param[in] allocate_processor Function to allocate a processor to a node<br>
* based on the rules of the scheduler.<br>
*/<br>
-static inline bool _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
+static inline bool _Scheduler_SMP_Enqueue_<wbr>scheduled(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
+ Scheduler_Node *const node,<br>
+ Priority_Control insert_priority,<br>
Chain_Node_order order,<br>
Scheduler_SMP_Extract extract_from_ready,<br>
Scheduler_SMP_Get_highest_<wbr>ready get_highest_ready,<br>
@@ -780,10 +771,8 @@ static inline bool _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
while ( true ) {<br>
Scheduler_Node *highest_ready;<br>
Scheduler_Try_to_schedule_<wbr>action action;<br>
- Priority_Control node_priority;<br>
<br>
highest_ready = ( *get_highest_ready )( context, node );<br>
- node_priority = _Scheduler_SMP_Node_priority( node );<br>
<br>
/*<br>
* The node has been extracted from the scheduled chain. We have to place<br>
@@ -791,9 +780,9 @@ static inline bool _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
*/<br>
if (<br>
node->sticky_level > 0<br>
- && ( *order )( &node_priority, &highest_ready->Node.Chain )<br>
+ && ( *order )( &insert_priority, &highest_ready->Node.Chain )<br>
) {<br>
- ( *insert_scheduled )( context, node );<br>
+ ( *insert_scheduled )( context, node, insert_priority );<br>
<br>
if ( _Scheduler_Node_get_idle( node ) != NULL ) {<br>
Thread_Control *owner;<br>
@@ -839,7 +828,7 @@ static inline bool _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
allocate_processor<br>
);<br>
<br>
- ( *insert_ready )( context, node );<br>
+ ( *insert_ready )( context, node, insert_priority );<br>
( *move_from_ready_to_scheduled )( context, highest_ready );<br>
<br>
idle = _Scheduler_Release_idle_<wbr>thread(<br>
@@ -855,7 +844,7 @@ static inline bool _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
SCHEDULER_SMP_NODE_SCHEDULED<br>
);<br>
<br>
- ( *insert_ready )( context, node );<br>
+ ( *insert_ready )( context, node, insert_priority );<br>
( *move_from_ready_to_scheduled )( context, highest_ready );<br>
<br>
_Scheduler_Exchange_idle_<wbr>thread(<br>
@@ -1033,7 +1022,7 @@ static inline void _Scheduler_SMP_Unblock(<br>
Thread_Control *thread,<br>
Scheduler_Node *node,<br>
Scheduler_SMP_Update update,<br>
- Scheduler_SMP_Enqueue enqueue_fifo<br>
+ Scheduler_SMP_Enqueue enqueue<br>
)<br>
{<br>
Scheduler_SMP_Node_state node_state;<br>
@@ -1049,21 +1038,22 @@ static inline void _Scheduler_SMP_Unblock(<br>
);<br>
<br>
if ( unblock ) {<br>
- Priority_Control new_priority;<br>
- bool prepend_it;<br>
+ Priority_Control priority;<br>
bool needs_help;<br>
<br>
- new_priority = _Scheduler_Node_get_priority( node, &prepend_it );<br>
- (void) prepend_it;<br>
+ priority = _Scheduler_Node_get_priority( node );<br>
+ priority = SCHEDULER_PRIORITY_PURIFY( priority );<br>
<br>
- if ( new_priority != _Scheduler_SMP_Node_priority( node ) ) {<br>
- ( *update )( context, node, new_priority );<br>
+ if ( priority != _Scheduler_SMP_Node_priority( node ) ) {<br>
+ ( *update )( context, node, priority );<br>
}<br>
<br>
if ( node_state == SCHEDULER_SMP_NODE_BLOCKED ) {<br>
- _Scheduler_SMP_Node_change_<wbr>state( node, SCHEDULER_SMP_NODE_READY );<br>
+ Priority_Control insert_priority;<br>
<br>
- needs_help = ( *enqueue_fifo )( context, node );<br>
+ _Scheduler_SMP_Node_change_<wbr>state( node, SCHEDULER_SMP_NODE_READY );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( priority );<br>
+ needs_help = ( *enqueue )( context, node, insert_priority );<br>
} else {<br>
_Assert( node_state == SCHEDULER_SMP_NODE_READY );<br>
_Assert( node->sticky_level > 0 );<br>
@@ -1083,20 +1073,19 @@ static inline void _Scheduler_SMP_Update_<wbr>priority(<br>
Scheduler_Node *node,<br>
Scheduler_SMP_Extract extract_from_ready,<br>
Scheduler_SMP_Update update,<br>
- Scheduler_SMP_Enqueue enqueue_fifo,<br>
- Scheduler_SMP_Enqueue enqueue_lifo,<br>
- Scheduler_SMP_Enqueue enqueue_scheduled_fifo,<br>
- Scheduler_SMP_Enqueue enqueue_scheduled_lifo,<br>
+ Scheduler_SMP_Enqueue enqueue,<br>
+ Scheduler_SMP_Enqueue enqueue_scheduled,<br>
Scheduler_SMP_Ask_for_help ask_for_help<br>
)<br>
{<br>
- Priority_Control new_priority;<br>
- bool prepend_it;<br>
+ Priority_Control priority;<br>
+ Priority_Control insert_priority;<br>
Scheduler_SMP_Node_state node_state;<br>
<br>
- new_priority = _Scheduler_Node_get_priority( node, &prepend_it );<br>
+ insert_priority = _Scheduler_Node_get_priority( node );<br>
+ priority = SCHEDULER_PRIORITY_PURIFY( insert_priority );<br>
<br>
- if ( new_priority == _Scheduler_SMP_Node_priority( node ) ) {<br>
+ if ( priority == _Scheduler_SMP_Node_priority( node ) ) {<br>
if ( _Thread_Is_ready( thread ) ) {<br>
( *ask_for_help )( context, thread, node );<br>
}<br>
@@ -1108,26 +1097,14 @@ static inline void _Scheduler_SMP_Update_<wbr>priority(<br>
<br>
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {<br>
_Scheduler_SMP_Extract_from_<wbr>scheduled( node );<br>
-<br>
- ( *update )( context, node, new_priority );<br>
-<br>
- if ( prepend_it ) {<br>
- ( *enqueue_scheduled_lifo )( context, node );<br>
- } else {<br>
- ( *enqueue_scheduled_fifo )( context, node );<br>
- }<br>
+ ( *update )( context, node, priority );<br>
+ ( *enqueue_scheduled )( context, node, insert_priority );<br>
} else if ( node_state == SCHEDULER_SMP_NODE_READY ) {<br>
( *extract_from_ready )( context, node );<br>
-<br>
- ( *update )( context, node, new_priority );<br>
-<br>
- if ( prepend_it ) {<br>
- ( *enqueue_lifo )( context, node );<br>
- } else {<br>
- ( *enqueue_fifo )( context, node );<br>
- }<br>
+ ( *update )( context, node, priority );<br>
+ ( *enqueue )( context, node, insert_priority );<br>
} else {<br>
- ( *update )( context, node, new_priority );<br>
+ ( *update )( context, node, priority );<br>
<br>
if ( _Thread_Is_ready( thread ) ) {<br>
( *ask_for_help )( context, thread, node );<br>
@@ -1140,23 +1117,26 @@ static inline void _Scheduler_SMP_Yield(<br>
Thread_Control *thread,<br>
Scheduler_Node *node,<br>
Scheduler_SMP_Extract extract_from_ready,<br>
- Scheduler_SMP_Enqueue enqueue_fifo,<br>
- Scheduler_SMP_Enqueue enqueue_scheduled_fifo<br>
+ Scheduler_SMP_Enqueue enqueue,<br>
+ Scheduler_SMP_Enqueue enqueue_scheduled<br>
)<br>
{<br>
bool needs_help;<br>
Scheduler_SMP_Node_state node_state;<br>
+ Priority_Control insert_priority;<br>
<br>
node_state = _Scheduler_SMP_Node_state( node );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( node );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
<br>
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {<br>
_Scheduler_SMP_Extract_from_<wbr>scheduled( node );<br>
- ( *enqueue_scheduled_fifo )( context, node );<br>
+ ( *enqueue_scheduled )( context, node, insert_priority );<br>
needs_help = false;<br>
} else if ( node_state == SCHEDULER_SMP_NODE_READY ) {<br>
( *extract_from_ready )( context, node );<br>
<br>
- needs_help = ( *enqueue_fifo )( context, node );<br>
+ needs_help = ( *enqueue )( context, node, insert_priority );<br>
} else {<br>
needs_help = true;<br>
}<br>
@@ -1166,41 +1146,21 @@ static inline void _Scheduler_SMP_Yield(<br>
}<br>
}<br>
<br>
-static inline void _Scheduler_SMP_Insert_<wbr>scheduled_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node_to_insert<br>
-)<br>
-{<br>
- Scheduler_SMP_Context *self;<br>
- Priority_Control priority_to_insert;<br>
-<br>
- self = _Scheduler_SMP_Get_self( context );<br>
- priority_to_insert = _Scheduler_SMP_Node_priority( node_to_insert );<br>
-<br>
- _Chain_Insert_ordered_<wbr>unprotected(<br>
- &self->Scheduled,<br>
- &node_to_insert->Node.Chain,<br>
- &priority_to_insert,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order<br>
- );<br>
-}<br>
-<br>
-static inline void _Scheduler_SMP_Insert_<wbr>scheduled_fifo(<br>
+static inline void _Scheduler_SMP_Insert_<wbr>scheduled(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node_to_insert<br>
+ Scheduler_Node *node_to_insert,<br>
+ Priority_Control priority_to_insert<br>
)<br>
{<br>
Scheduler_SMP_Context *self;<br>
- Priority_Control priority_to_insert;<br>
<br>
self = _Scheduler_SMP_Get_self( context );<br>
- priority_to_insert = _Scheduler_SMP_Node_priority( node_to_insert );<br>
<br>
_Chain_Insert_ordered_<wbr>unprotected(<br>
&self->Scheduled,<br>
&node_to_insert->Node.Chain,<br>
&priority_to_insert,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal<br>
);<br>
}<br>
<br>
@@ -1230,11 +1190,11 @@ static inline bool _Scheduler_SMP_Ask_for_help(<br>
node_state = _Scheduler_SMP_Node_state( node );<br>
<br>
if ( node_state == SCHEDULER_SMP_NODE_BLOCKED ) {<br>
- Priority_Control node_priority;<br>
+ Priority_Control insert_priority;<br>
<br>
- node_priority = _Scheduler_SMP_Node_priority( node );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( node );<br>
<br>
- if ( ( *order )( &node_priority, &lowest_scheduled->Node.Chain ) ) {<br>
+ if ( ( *order )( &insert_priority, &lowest_scheduled->Node.Chain ) ) {<br>
_Thread_Scheduler_cancel_need_<wbr>for_help(<br>
thread,<br>
_Thread_Get_CPU( thread )<br>
@@ -1249,7 +1209,7 @@ static inline bool _Scheduler_SMP_Ask_for_help(<br>
allocate_processor<br>
);<br>
<br>
- ( *insert_scheduled )( context, node );<br>
+ ( *insert_scheduled )( context, node, insert_priority );<br>
( *move_from_scheduled_to_ready )( context, lowest_scheduled );<br>
<br>
_Scheduler_Release_idle_<wbr>thread(<br>
@@ -1261,7 +1221,7 @@ static inline bool _Scheduler_SMP_Ask_for_help(<br>
} else {<br>
_Thread_Scheduler_release_<wbr>critical( thread, &lock_context );<br>
_Scheduler_SMP_Node_change_<wbr>state( node, SCHEDULER_SMP_NODE_READY );<br>
- ( *insert_ready )( context, node );<br>
+ ( *insert_ready )( context, node, insert_priority );<br>
success = false;<br>
}<br>
} else if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {<br>
@@ -1384,7 +1344,7 @@ static inline void _Scheduler_SMP_Add_processor(<br>
Scheduler_Context *context,<br>
Thread_Control *idle,<br>
Scheduler_SMP_Has_ready has_ready,<br>
- Scheduler_SMP_Enqueue enqueue_scheduled_fifo,<br>
+ Scheduler_SMP_Enqueue enqueue_scheduled,<br>
Scheduler_SMP_Register_idle register_idle<br>
)<br>
{<br>
@@ -1399,7 +1359,11 @@ static inline void _Scheduler_SMP_Add_processor(<br>
( *register_idle )( context, node, _Thread_Get_CPU( idle ) );<br>
<br>
if ( ( *has_ready )( &self->Base ) ) {<br>
- ( *enqueue_scheduled_fifo )( &self->Base, node );<br>
+ Priority_Control insert_priority;<br>
+<br>
+ insert_priority = _Scheduler_SMP_Node_priority( node );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
+ ( *enqueue_scheduled )( &self->Base, node, insert_priority );<br>
} else {<br>
_Chain_Append_unprotected( &self->Scheduled, &node->Node.Chain );<br>
}<br>
@@ -1409,7 +1373,7 @@ static inline Thread_Control *_Scheduler_SMP_Remove_<wbr>processor(<br>
Scheduler_Context *context,<br>
Per_CPU_Control *cpu,<br>
Scheduler_SMP_Extract extract_from_ready,<br>
- Scheduler_SMP_Enqueue enqueue_fifo<br>
+ Scheduler_SMP_Enqueue enqueue<br>
)<br>
{<br>
Scheduler_SMP_Context *self;<br>
@@ -1451,7 +1415,11 @@ static inline Thread_Control *_Scheduler_SMP_Remove_<wbr>processor(<br>
);<br>
<br>
if ( !_Chain_Is_empty( &self->Scheduled ) ) {<br>
- ( *enqueue_fifo )( context, victim_node );<br>
+ Priority_Control insert_priority;<br>
+<br>
+ insert_priority = _Scheduler_SMP_Node_priority( victim_node );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
+ ( *enqueue )( context, victim_node, insert_priority );<br>
}<br>
} else {<br>
_Assert( victim_owner == victim_user );<br>
@@ -1472,13 +1440,16 @@ static inline void _Scheduler_SMP_Set_affinity(<br>
Scheduler_SMP_Extract extract_from_ready,<br>
Scheduler_SMP_Get_highest_<wbr>ready get_highest_ready,<br>
Scheduler_SMP_Move move_from_ready_to_scheduled,<br>
- Scheduler_SMP_Enqueue enqueue_fifo,<br>
+ Scheduler_SMP_Enqueue enqueue,<br>
Scheduler_SMP_Allocate_<wbr>processor allocate_processor<br>
)<br>
{<br>
Scheduler_SMP_Node_state node_state;<br>
+ Priority_Control insert_priority;<br>
<br>
node_state = _Scheduler_SMP_Node_state( node );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( node );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
<br>
if ( node_state == SCHEDULER_SMP_NODE_SCHEDULED ) {<br>
_Scheduler_SMP_Extract_from_<wbr>scheduled( node );<br>
@@ -1492,11 +1463,11 @@ static inline void _Scheduler_SMP_Set_affinity(<br>
allocate_processor<br>
);<br>
( *set_affinity )( context, node, arg );<br>
- ( *enqueue_fifo )( context, node );<br>
+ ( *enqueue )( context, node, insert_priority );<br>
} else if ( node_state == SCHEDULER_SMP_NODE_READY ) {<br>
( *extract_from_ready )( context, node );<br>
( *set_affinity )( context, node, arg );<br>
- ( *enqueue_fifo )( context, node );<br>
+ ( *enqueue )( context, node, insert_priority );<br>
} else {<br>
( *set_affinity )( context, node, arg );<br>
}<br>
diff --git a/cpukit/score/src/<wbr>schedulercbsunblock.c b/cpukit/score/src/<wbr>schedulercbsunblock.c<br>
index 403435eeb1..9b7a0ca424 100644<br>
--- a/cpukit/score/src/<wbr>schedulercbsunblock.c<br>
+++ b/cpukit/score/src/<wbr>schedulercbsunblock.c<br>
@@ -34,12 +34,11 @@ void _Scheduler_CBS_Unblock(<br>
Scheduler_CBS_Node *the_node;<br>
Scheduler_CBS_Server *serv_info;<br>
Priority_Control priority;<br>
- bool prepend_it;<br>
<br>
the_node = _Scheduler_CBS_Node_downcast( node );<br>
serv_info = the_node->cbs_server;<br>
- priority = _Scheduler_Node_get_priority( &the_node->Base.Base, &prepend_it );<br>
- (void) prepend_it;<br>
+ priority = _Scheduler_Node_get_priority( &the_node->Base.Base );<br>
+ priority = SCHEDULER_PRIORITY_PURIFY( priority );<br>
<br>
/*<br>
* Late unblock rule for deadline-driven tasks. The remaining time to<br>
diff --git a/cpukit/score/src/<wbr>schedulerdefaultmappriority.c b/cpukit/score/src/<wbr>schedulerdefaultmappriority.c<br>
index 37a600011e..228549f20d 100644<br>
--- a/cpukit/score/src/<wbr>schedulerdefaultmappriority.c<br>
+++ b/cpukit/score/src/<wbr>schedulerdefaultmappriority.c<br>
@@ -1,5 +1,5 @@<br>
/*<br>
- * Copyright (c) 2016 embedded brains GmbH<br>
+ * Copyright (c) 2016, 2017 embedded brains GmbH<br>
*<br>
* The license and distribution terms for this file may be<br>
* found in the file LICENSE in this distribution or at<br>
@@ -10,12 +10,20 @@<br>
#include "config.h"<br>
#endif<br>
<br>
-#include <rtems/score/scheduler.h><br>
+#include <rtems/score/schedulerimpl.h><br>
<br>
Priority_Control _Scheduler_default_Map_<wbr>priority(<br>
const Scheduler_Control *scheduler,<br>
Priority_Control priority<br>
)<br>
{<br>
- return priority;<br>
+ return SCHEDULER_PRIORITY_MAP( priority );<br>
+}<br>
+<br>
+Priority_Control _Scheduler_default_Unmap_<wbr>priority(<br>
+ const Scheduler_Control *scheduler,<br>
+ Priority_Control priority<br>
+)<br>
+{<br>
+ return SCHEDULER_PRIORITY_UNMAP( priority );<br>
}<br>
diff --git a/cpukit/score/src/<wbr>scheduleredfchangepriority.c b/cpukit/score/src/<wbr>scheduleredfchangepriority.c<br>
index 23382973cc..d3d1f94cbf 100644<br>
--- a/cpukit/score/src/<wbr>scheduleredfchangepriority.c<br>
+++ b/cpukit/score/src/<wbr>scheduleredfchangepriority.c<br>
@@ -29,7 +29,7 @@ void _Scheduler_EDF_Update_<wbr>priority(<br>
Scheduler_EDF_Context *context;<br>
Scheduler_EDF_Node *the_node;<br>
Priority_Control priority;<br>
- bool prepend_it;<br>
+ Priority_Control insert_priority;<br>
<br>
if ( !_Thread_Is_ready( the_thread ) ) {<br>
/* Nothing to do */<br>
@@ -37,7 +37,8 @@ void _Scheduler_EDF_Update_<wbr>priority(<br>
}<br>
<br>
the_node = _Scheduler_EDF_Node_downcast( node );<br>
- priority = _Scheduler_Node_get_priority( &the_node->Base, &prepend_it );<br>
+ insert_priority = _Scheduler_Node_get_priority( &the_node->Base );<br>
+ priority = SCHEDULER_PRIORITY_PURIFY( insert_priority );<br>
<br>
if ( priority == the_node->priority ) {<br>
/* Nothing to do */<br>
@@ -48,12 +49,6 @@ void _Scheduler_EDF_Update_<wbr>priority(<br>
context = _Scheduler_EDF_Get_context( scheduler );<br>
<br>
_Scheduler_EDF_Extract( context, the_node );<br>
-<br>
- if ( prepend_it ) {<br>
- _Scheduler_EDF_Enqueue_first( context, the_node, priority );<br>
- } else {<br>
- _Scheduler_EDF_Enqueue( context, the_node, priority );<br>
- }<br>
-<br>
+ _Scheduler_EDF_Enqueue( context, the_node, insert_priority );<br>
_Scheduler_EDF_Schedule_body( scheduler, the_thread, false );<br>
}<br>
diff --git a/cpukit/score/src/<wbr>scheduleredfreleasejob.c b/cpukit/score/src/<wbr>scheduleredfreleasejob.c<br>
index 068a0db7a3..9c30821e9e 100644<br>
--- a/cpukit/score/src/<wbr>scheduleredfreleasejob.c<br>
+++ b/cpukit/score/src/<wbr>scheduleredfreleasejob.c<br>
@@ -25,7 +25,7 @@ Priority_Control _Scheduler_EDF_Map_priority(<br>
Priority_Control priority<br>
)<br>
{<br>
- return SCHEDULER_EDF_PRIO_MSB | priority;<br>
+ return SCHEDULER_EDF_PRIO_MSB | SCHEDULER_PRIORITY_MAP( priority );<br>
}<br>
<br>
Priority_Control _Scheduler_EDF_Unmap_priority(<br>
@@ -33,7 +33,7 @@ Priority_Control _Scheduler_EDF_Unmap_priority(<br>
Priority_Control priority<br>
)<br>
{<br>
- return priority & ~SCHEDULER_EDF_PRIO_MSB;<br>
+ return SCHEDULER_PRIORITY_UNMAP( priority & ~SCHEDULER_EDF_PRIO_MSB );<br>
}<br>
<br>
void _Scheduler_EDF_Release_job(<br>
diff --git a/cpukit/score/src/<wbr>scheduleredfsmp.c b/cpukit/score/src/<wbr>scheduleredfsmp.c<br>
index badee44e2e..102a33d4f7 100644<br>
--- a/cpukit/score/src/<wbr>scheduleredfsmp.c<br>
+++ b/cpukit/score/src/<wbr>scheduleredfsmp.c<br>
@@ -39,26 +39,7 @@ _Scheduler_EDF_SMP_Node_<wbr>downcast( Scheduler_Node *node )<br>
return (Scheduler_EDF_SMP_Node *) node;<br>
}<br>
<br>
-static inline bool _Scheduler_EDF_SMP_Less(<br>
- const void *left,<br>
- const RBTree_Node *right<br>
-)<br>
-{<br>
- const Priority_Control *the_left;<br>
- const Scheduler_SMP_Node *the_right;<br>
- Priority_Control prio_left;<br>
- Priority_Control prio_right;<br>
-<br>
- the_left = left;<br>
- the_right = RTEMS_CONTAINER_OF( right, Scheduler_SMP_Node, Base.Node.RBTree );<br>
-<br>
- prio_left = *the_left;<br>
- prio_right = the_right->priority;<br>
-<br>
- return prio_left < prio_right;<br>
-}<br>
-<br>
-static inline bool _Scheduler_EDF_SMP_Less_or_<wbr>equal(<br>
+static inline bool _Scheduler_EDF_SMP_Priority_<wbr>less_equal(<br>
const void *left,<br>
const RBTree_Node *right<br>
)<br>
@@ -254,20 +235,21 @@ static inline Scheduler_Node *_Scheduler_EDF_SMP_Get_<wbr>lowest_scheduled(<br>
static inline void _Scheduler_EDF_SMP_Insert_<wbr>ready(<br>
Scheduler_Context *context,<br>
Scheduler_Node *node_base,<br>
- int generation_index,<br>
- bool ( *less )( const void *, const RBTree_Node * )<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
Scheduler_EDF_SMP_Context *self;<br>
Scheduler_EDF_SMP_Node *node;<br>
uint32_t rqi;<br>
Scheduler_EDF_SMP_Ready_queue *ready_queue;<br>
+ int generation_index;<br>
int increment;<br>
int64_t generation;<br>
<br>
self = _Scheduler_EDF_SMP_Get_self( context );<br>
node = _Scheduler_EDF_SMP_Node_<wbr>downcast( node_base );<br>
rqi = node->ready_queue_index;<br>
+ generation_index = SCHEDULER_PRIORITY_IS_APPEND( insert_priority );<br>
increment = ( generation_index << 1 ) - 1;<br>
ready_queue = &self->Ready[ rqi ];<br>
<br>
@@ -279,8 +261,8 @@ static inline void _Scheduler_EDF_SMP_Insert_<wbr>ready(<br>
_RBTree_Insert_inline(<br>
&ready_queue->Queue,<br>
&node->Base.Base.Node.RBTree,<br>
- &node->Base.priority,<br>
- less<br>
+ &insert_priority,<br>
+ _Scheduler_EDF_SMP_Priority_<wbr>less_equal<br>
);<br>
<br>
if ( rqi != 0 && _Chain_Is_node_off_chain( &ready_queue->Node ) ) {<br>
@@ -327,12 +309,14 @@ static inline void _Scheduler_EDF_SMP_Move_from_<wbr>scheduled_to_ready(<br>
Scheduler_Node *scheduled_to_ready<br>
)<br>
{<br>
+ Priority_Control insert_priority;<br>
+<br>
_Chain_Extract_unprotected( &scheduled_to_ready->Node.<wbr>Chain );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( scheduled_to_ready );<br>
_Scheduler_EDF_SMP_Insert_<wbr>ready(<br>
context,<br>
scheduled_to_ready,<br>
- 1,<br>
- _Scheduler_EDF_SMP_Less<br>
+ insert_priority<br>
);<br>
}<br>
<br>
@@ -341,33 +325,15 @@ static inline void _Scheduler_EDF_SMP_Move_from_<wbr>ready_to_scheduled(<br>
Scheduler_Node *ready_to_scheduled<br>
)<br>
{<br>
- _Scheduler_EDF_SMP_Extract_<wbr>from_ready( context, ready_to_scheduled );<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo( context, ready_to_scheduled );<br>
-}<br>
+ Priority_Control insert_priority;<br>
<br>
-static inline void _Scheduler_EDF_SMP_Insert_<wbr>ready_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node_to_insert<br>
-)<br>
-{<br>
- _Scheduler_EDF_SMP_Insert_<wbr>ready(<br>
- context,<br>
- node_to_insert,<br>
- 0,<br>
- _Scheduler_EDF_SMP_Less_or_<wbr>equal<br>
- );<br>
-}<br>
-<br>
-static inline void _Scheduler_EDF_SMP_Insert_<wbr>ready_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node_to_insert<br>
-)<br>
-{<br>
- _Scheduler_EDF_SMP_Insert_<wbr>ready(<br>
+ _Scheduler_EDF_SMP_Extract_<wbr>from_ready( context, ready_to_scheduled );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( ready_to_scheduled );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled(<br>
context,<br>
- node_to_insert,<br>
- 1,<br>
- _Scheduler_EDF_SMP_Less<br>
+ ready_to_scheduled,<br>
+ insert_priority<br>
);<br>
}<br>
<br>
@@ -444,103 +410,45 @@ void _Scheduler_EDF_SMP_Block(<br>
);<br>
}<br>
<br>
-static inline bool _Scheduler_EDF_SMP_Enqueue_<wbr>ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+static inline bool _Scheduler_EDF_SMP_Enqueue(<br>
+ Scheduler_Context *context,<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
+ return _Scheduler_SMP_Enqueue(<br>
context,<br>
node,<br>
- order,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_EDF_SMP_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_EDF_SMP_Move_from_<wbr>scheduled_to_ready,<br>
_Scheduler_EDF_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_EDF_SMP_Allocate_<wbr>processor<br>
);<br>
}<br>
<br>
-static inline bool _Scheduler_EDF_SMP_Enqueue_<wbr>lifo(<br>
+static inline bool _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_EDF_SMP_Enqueue_<wbr>ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_EDF_SMP_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static inline bool _Scheduler_EDF_SMP_Enqueue_<wbr>fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_EDF_SMP_Enqueue_<wbr>ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_EDF_SMP_Insert_<wbr>ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
-static inline bool _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
+ return _Scheduler_SMP_Enqueue_<wbr>scheduled(<br>
context,<br>
node,<br>
- order,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
_Scheduler_EDF_SMP_Extract_<wbr>from_ready,<br>
_Scheduler_EDF_SMP_Get_<wbr>highest_ready,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ _Scheduler_EDF_SMP_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_EDF_SMP_Move_from_<wbr>ready_to_scheduled,<br>
_Scheduler_EDF_SMP_Allocate_<wbr>processor<br>
);<br>
}<br>
<br>
-static inline bool _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_EDF_SMP_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static inline bool _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_EDF_SMP_Insert_<wbr>ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
void _Scheduler_EDF_SMP_Unblock(<br>
const Scheduler_Control *scheduler,<br>
Thread_Control *thread,<br>
@@ -554,7 +462,7 @@ void _Scheduler_EDF_SMP_Unblock(<br>
thread,<br>
node,<br>
_Scheduler_EDF_SMP_Do_update,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>fifo<br>
+ _Scheduler_EDF_SMP_Enqueue<br>
);<br>
}<br>
<br>
@@ -568,9 +476,9 @@ static inline bool _Scheduler_EDF_SMP_Do_ask_for_<wbr>help(<br>
context,<br>
the_thread,<br>
node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_EDF_SMP_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_EDF_SMP_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_EDF_SMP_Move_from_<wbr>scheduled_to_ready,<br>
_Scheduler_EDF_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_EDF_SMP_Allocate_<wbr>processor<br>
@@ -591,10 +499,8 @@ void _Scheduler_EDF_SMP_Update_<wbr>priority(<br>
node,<br>
_Scheduler_EDF_SMP_Extract_<wbr>from_ready,<br>
_Scheduler_EDF_SMP_Do_update,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>fifo,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>lifo,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_fifo,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_lifo,<br>
+ _Scheduler_EDF_SMP_Enqueue,<br>
+ _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled,<br>
_Scheduler_EDF_SMP_Do_ask_for_<wbr>help<br>
);<br>
}<br>
@@ -672,7 +578,7 @@ void _Scheduler_EDF_SMP_Add_<wbr>processor(<br>
context,<br>
idle,<br>
_Scheduler_EDF_SMP_Has_ready,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_fifo,<br>
+ _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled,<br>
_Scheduler_EDF_SMP_Register_<wbr>idle<br>
);<br>
}<br>
@@ -688,7 +594,7 @@ Thread_Control *_Scheduler_EDF_SMP_Remove_<wbr>processor(<br>
context,<br>
cpu,<br>
_Scheduler_EDF_SMP_Extract_<wbr>from_ready,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>fifo<br>
+ _Scheduler_EDF_SMP_Enqueue<br>
);<br>
}<br>
<br>
@@ -705,8 +611,8 @@ void _Scheduler_EDF_SMP_Yield(<br>
thread,<br>
node,<br>
_Scheduler_EDF_SMP_Extract_<wbr>from_ready,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>fifo,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled_fifo<br>
+ _Scheduler_EDF_SMP_Enqueue,<br>
+ _Scheduler_EDF_SMP_Enqueue_<wbr>scheduled<br>
);<br>
}<br>
<br>
@@ -777,7 +683,7 @@ bool _Scheduler_EDF_SMP_Set_<wbr>affinity(<br>
_Scheduler_EDF_SMP_Extract_<wbr>from_ready,<br>
_Scheduler_EDF_SMP_Get_<wbr>highest_ready,<br>
_Scheduler_EDF_SMP_Move_from_<wbr>ready_to_scheduled,<br>
- _Scheduler_EDF_SMP_Enqueue_<wbr>fifo,<br>
+ _Scheduler_EDF_SMP_Enqueue,<br>
_Scheduler_EDF_SMP_Allocate_<wbr>processor<br>
);<br>
<br>
diff --git a/cpukit/score/src/<wbr>scheduleredfunblock.c b/cpukit/score/src/<wbr>scheduleredfunblock.c<br>
index 29355d04fa..91295f511c 100644<br>
--- a/cpukit/score/src/<wbr>scheduleredfunblock.c<br>
+++ b/cpukit/score/src/<wbr>scheduleredfunblock.c<br>
@@ -31,15 +31,16 @@ void _Scheduler_EDF_Unblock(<br>
Scheduler_EDF_Context *context;<br>
Scheduler_EDF_Node *the_node;<br>
Priority_Control priority;<br>
- bool prepend_it;<br>
+ Priority_Control insert_priority;<br>
<br>
context = _Scheduler_EDF_Get_context( scheduler );<br>
the_node = _Scheduler_EDF_Node_downcast( node );<br>
- priority = _Scheduler_Node_get_priority( &the_node->Base, &prepend_it );<br>
- (void) prepend_it;<br>
+ priority = _Scheduler_Node_get_priority( &the_node->Base );<br>
+ priority = SCHEDULER_PRIORITY_PURIFY( priority );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( priority );<br>
<br>
the_node->priority = priority;<br>
- _Scheduler_EDF_Enqueue( context, the_node, priority );<br>
+ _Scheduler_EDF_Enqueue( context, the_node, insert_priority );<br>
<br>
/*<br>
* If the thread that was unblocked is more important than the heir,<br>
diff --git a/cpukit/score/src/<wbr>schedulerpriority.c b/cpukit/score/src/<wbr>schedulerpriority.c<br>
index ddfd973e0a..5ac16a49a1 100644<br>
--- a/cpukit/score/src/<wbr>schedulerpriority.c<br>
+++ b/cpukit/score/src/<wbr>schedulerpriority.c<br>
@@ -19,7 +19,6 @@<br>
#endif<br>
<br>
#include <rtems/score/<wbr>schedulerpriorityimpl.h><br>
-#include <rtems/score/wkspace.h><br>
<br>
void _Scheduler_priority_<wbr>Initialize( const Scheduler_Control *scheduler )<br>
{<br>
@@ -49,7 +48,7 @@ void _Scheduler_priority_Node_<wbr>initialize(<br>
the_node = _Scheduler_priority_Node_<wbr>downcast( node );<br>
_Scheduler_priority_Ready_<wbr>queue_update(<br>
&the_node->Ready_queue,<br>
- priority,<br>
+ SCHEDULER_PRIORITY_UNMAP( priority ),<br>
&context->Bit_map,<br>
&context->Ready[ 0 ]<br>
);<br>
diff --git a/cpukit/score/src/<wbr>schedulerpriorityaffinitysmp.c b/cpukit/score/src/<wbr>schedulerpriorityaffinitysmp.c<br>
index 72b4ffb600..4808c84c3f 100644<br>
--- a/cpukit/score/src/<wbr>schedulerpriorityaffinitysmp.c<br>
+++ b/cpukit/score/src/<wbr>schedulerpriorityaffinitysmp.c<br>
@@ -39,22 +39,13 @@<br>
* + _Scheduler_priority_SMP_Do_<wbr>update<br>
*/<br>
<br>
-static bool _Scheduler_priority_affinity_<wbr>SMP_Insert_priority_lifo_<wbr>order(<br>
+static bool _Scheduler_priority_affinity_<wbr>SMP_Priority_less_equal(<br>
const void *to_insert,<br>
const Chain_Node *next<br>
)<br>
{<br>
return next != NULL<br>
- && _Scheduler_SMP_Insert_<wbr>priority_lifo_order( to_insert, next );<br>
-}<br>
-<br>
-static bool _Scheduler_priority_affinity_<wbr>SMP_Insert_priority_fifo_<wbr>order(<br>
- const void *to_insert,<br>
- const Chain_Node *next<br>
-)<br>
-{<br>
- return next != NULL<br>
- && _Scheduler_SMP_Insert_<wbr>priority_fifo_order( to_insert, next );<br>
+ && _Scheduler_SMP_Priority_less_<wbr>equal( to_insert, next );<br>
}<br>
<br>
static Scheduler_priority_affinity_<wbr>SMP_Node *<br>
@@ -242,19 +233,21 @@ static Scheduler_Node * _Scheduler_priority_affinity_<wbr>SMP_Get_lowest_scheduled(<br>
/*<br>
* This method is unique to this scheduler because it must pass<br>
* _Scheduler_priority_affinity_<wbr>SMP_Get_lowest_scheduled into<br>
- * _Scheduler_SMP_Enqueue_<wbr>ordered.<br>
+ * _Scheduler_SMP_Enqueue.<br>
*/<br>
static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_fifo(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
+ return _Scheduler_SMP_Enqueue(<br>
context,<br>
node,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Insert_priority_fifo_<wbr>order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo,<br>
+ insert_priority,<br>
+ _Scheduler_priority_affinity_<wbr>SMP_Priority_less_equal,<br>
+ _Scheduler_priority_SMP_<wbr>Insert_ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_priority_affinity_<wbr>SMP_Get_lowest_scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_exact<br>
@@ -280,6 +273,7 @@ static void _Scheduler_priority_affinity_<wbr>SMP_Check_for_migrations(<br>
<br>
while (1) {<br>
Priority_Control lowest_scheduled_priority;<br>
+ Priority_Control insert_priority;<br>
<br>
if ( _Priority_bit_map_Is_empty( &self->Bit_map ) ) {<br>
/* Nothing to do */<br>
@@ -312,7 +306,7 @@ static void _Scheduler_priority_affinity_<wbr>SMP_Check_for_migrations(<br>
_Scheduler_SMP_Node_priority( lowest_scheduled );<br>
<br>
if (<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order(<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal(<br>
&lowest_scheduled_priority,<br>
&highest_ready->Node.Chain<br>
)<br>
@@ -326,11 +320,14 @@ static void _Scheduler_priority_affinity_<wbr>SMP_Check_for_migrations(<br>
*/<br>
<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready( context, highest_ready );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( highest_ready );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
_Scheduler_SMP_Enqueue_to_<wbr>scheduled(<br>
context,<br>
highest_ready,<br>
+ insert_priority,<br>
lowest_scheduled,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Allocate_<wbr>processor_exact<br>
);<br>
@@ -364,22 +361,21 @@ void _Scheduler_priority_affinity_<wbr>SMP_Unblock(<br>
<br>
/*<br>
* This is unique to this scheduler because it passes scheduler specific<br>
- * get_lowest_scheduled helper to _Scheduler_SMP_Enqueue_<wbr>ordered.<br>
+ * get_lowest_scheduled helper to _Scheduler_SMP_Enqueue.<br>
*/<br>
-static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue(<br>
+ Scheduler_Context *context,<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
+ return _Scheduler_SMP_Enqueue(<br>
context,<br>
node,<br>
- order,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ insert_priority,<br>
+ _Scheduler_priority_affinity_<wbr>SMP_Priority_less_equal,<br>
+ _Scheduler_priority_SMP_<wbr>Insert_ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_priority_affinity_<wbr>SMP_Get_lowest_scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_exact<br>
@@ -387,88 +383,30 @@ static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_ordered(<br>
}<br>
<br>
/*<br>
- * This is unique to this scheduler because it is on the path<br>
- * to _Scheduler_priority_affinity_<wbr>SMP_Enqueue_ordered() which<br>
- * invokes a scheduler unique get_lowest_scheduled helper.<br>
- */<br>
-static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_priority_affinity_<wbr>SMP_Enqueue_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Insert_priority_lifo_<wbr>order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-/*<br>
* This method is unique to this scheduler because it must<br>
- * invoke _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered() with<br>
+ * invoke _Scheduler_SMP_Enqueue_<wbr>scheduled() with<br>
* this scheduler's get_highest_ready() helper.<br>
*/<br>
-static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled(<br>
+ Scheduler_Context *context,<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
+ return _Scheduler_SMP_Enqueue_<wbr>scheduled(<br>
context,<br>
node,<br>
- order,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready,<br>
_Scheduler_priority_affinity_<wbr>SMP_Get_highest_ready,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ _Scheduler_priority_SMP_<wbr>Insert_ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_ready_to_scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_exact<br>
);<br>
}<br>
<br>
-/*<br>
- * This is unique to this scheduler because it is on the path<br>
- * to _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled__<wbr>ordered() which<br>
- * invokes a scheduler unique get_lowest_scheduled helper.<br>
- */<br>
-static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-/*<br>
- * This is unique to this scheduler because it is on the path<br>
- * to _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled__<wbr>ordered() which<br>
- * invokes a scheduler unique get_lowest_scheduled helper.<br>
- */<br>
-static bool _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
static bool _Scheduler_priority_affinity_<wbr>SMP_Do_ask_for_help(<br>
Scheduler_Context *context,<br>
Thread_Control *the_thread,<br>
@@ -479,9 +417,9 @@ static bool _Scheduler_priority_affinity_<wbr>SMP_Do_ask_for_help(<br>
context,<br>
the_thread,<br>
node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_priority_SMP_<wbr>Insert_ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
@@ -502,10 +440,8 @@ void _Scheduler_priority_affinity_<wbr>SMP_Update_priority(<br>
node,<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready,<br>
_Scheduler_priority_SMP_Do_<wbr>update,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Enqueue_fifo,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Enqueue_lifo,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_fifo,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_lifo,<br>
+ _Scheduler_priority_affinity_<wbr>SMP_Enqueue,<br>
+ _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled,<br>
_Scheduler_priority_affinity_<wbr>SMP_Do_ask_for_help<br>
);<br>
<br>
@@ -574,7 +510,7 @@ void _Scheduler_priority_affinity_<wbr>SMP_Add_processor(<br>
context,<br>
idle,<br>
_Scheduler_priority_SMP_Has_<wbr>ready,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled_fifo,<br>
+ _Scheduler_priority_affinity_<wbr>SMP_Enqueue_scheduled,<br>
_Scheduler_SMP_Do_nothing_<wbr>register_idle<br>
);<br>
}<br>
@@ -590,7 +526,7 @@ Thread_Control *_Scheduler_priority_affinity_<wbr>SMP_Remove_processor(<br>
context,<br>
cpu,<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready,<br>
- _Scheduler_priority_affinity_<wbr>SMP_Enqueue_fifo<br>
+ _Scheduler_priority_affinity_<wbr>SMP_Enqueue<br>
);<br>
}<br>
<br>
diff --git a/cpukit/score/src/<wbr>schedulerprioritychangepriorit<wbr>y.c b/cpukit/score/src/<wbr>schedulerprioritychangepriorit<wbr>y.c<br>
index eb640fe683..6af475a8d6 100644<br>
--- a/cpukit/score/src/<wbr>schedulerprioritychangepriorit<wbr>y.c<br>
+++ b/cpukit/score/src/<wbr>schedulerprioritychangepriorit<wbr>y.c<br>
@@ -29,8 +29,8 @@ void _Scheduler_priority_Update_<wbr>priority(<br>
{<br>
Scheduler_priority_Context *context;<br>
Scheduler_priority_Node *the_node;<br>
- unsigned int priority;<br>
- bool prepend_it;<br>
+ unsigned int new_priority;<br>
+ unsigned int unmapped_priority;<br>
<br>
if ( !_Thread_Is_ready( the_thread ) ) {<br>
/* Nothing to do */<br>
@@ -38,10 +38,11 @@ void _Scheduler_priority_Update_<wbr>priority(<br>
}<br>
<br>
the_node = _Scheduler_priority_Node_<wbr>downcast( node );<br>
- priority = (unsigned int )<br>
- _Scheduler_Node_get_priority( &the_node->Base, &prepend_it );<br>
+ new_priority = (unsigned int)<br>
+ _Scheduler_Node_get_priority( &the_node->Base );<br>
+ unmapped_priority = SCHEDULER_PRIORITY_UNMAP( new_priority );<br>
<br>
- if ( priority == the_node->Ready_queue.current_<wbr>priority ) {<br>
+ if ( unmapped_priority == the_node->Ready_queue.current_<wbr>priority ) {<br>
/* Nothing to do */<br>
return;<br>
}<br>
@@ -56,19 +57,19 @@ void _Scheduler_priority_Update_<wbr>priority(<br>
<br>
_Scheduler_priority_Ready_<wbr>queue_update(<br>
&the_node->Ready_queue,<br>
- priority,<br>
+ unmapped_priority,<br>
&context->Bit_map,<br>
&context->Ready[ 0 ]<br>
);<br>
<br>
- if ( prepend_it ) {<br>
- _Scheduler_priority_Ready_<wbr>queue_enqueue_first(<br>
+ if ( SCHEDULER_PRIORITY_IS_APPEND( new_priority ) ) {<br>
+ _Scheduler_priority_Ready_<wbr>queue_enqueue(<br>
&the_thread->Object.Node,<br>
&the_node->Ready_queue,<br>
&context->Bit_map<br>
);<br>
} else {<br>
- _Scheduler_priority_Ready_<wbr>queue_enqueue(<br>
+ _Scheduler_priority_Ready_<wbr>queue_enqueue_first(<br>
&the_thread->Object.Node,<br>
&the_node->Ready_queue,<br>
&context->Bit_map<br>
diff --git a/cpukit/score/src/<wbr>schedulerprioritysmp.c b/cpukit/score/src/<wbr>schedulerprioritysmp.c<br>
index 071a4218f3..205d3257ca 100644<br>
--- a/cpukit/score/src/<wbr>schedulerprioritysmp.c<br>
+++ b/cpukit/score/src/<wbr>schedulerprioritysmp.c<br>
@@ -68,7 +68,7 @@ void _Scheduler_priority_SMP_Node_<wbr>initialize(<br>
self = _Scheduler_priority_SMP_Get_<wbr>self( context );<br>
_Scheduler_priority_Ready_<wbr>queue_update(<br>
&the_node->Ready_queue,<br>
- priority,<br>
+ SCHEDULER_PRIORITY_UNMAP( priority ),<br>
&self->Bit_map,<br>
&self->Ready[ 0 ]<br>
);<br>
@@ -109,103 +109,45 @@ void _Scheduler_priority_SMP_Block(<br>
);<br>
}<br>
<br>
-static bool _Scheduler_priority_SMP_<wbr>Enqueue_ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+static bool _Scheduler_priority_SMP_<wbr>Enqueue(<br>
+ Scheduler_Context *context,<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
+ return _Scheduler_SMP_Enqueue(<br>
context,<br>
node,<br>
- order,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_priority_SMP_<wbr>Insert_ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
);<br>
}<br>
<br>
-static bool _Scheduler_priority_SMP_<wbr>Enqueue_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_priority_SMP_<wbr>Enqueue_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_priority_SMP_<wbr>Enqueue_fifo(<br>
+static bool _Scheduler_priority_SMP_<wbr>Enqueue_scheduled(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_priority_SMP_<wbr>Enqueue_ordered(<br>
+ return _Scheduler_SMP_Enqueue_<wbr>scheduled(<br>
context,<br>
node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
-)<br>
-{<br>
- return _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
- context,<br>
- node,<br>
- order,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready,<br>
_Scheduler_priority_SMP_Get_<wbr>highest_ready,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ _Scheduler_priority_SMP_<wbr>Insert_ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_ready_to_scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
);<br>
}<br>
<br>
-static bool _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
void _Scheduler_priority_SMP_<wbr>Unblock(<br>
const Scheduler_Control *scheduler,<br>
Thread_Control *thread,<br>
@@ -219,7 +161,7 @@ void _Scheduler_priority_SMP_<wbr>Unblock(<br>
thread,<br>
node,<br>
_Scheduler_priority_SMP_Do_<wbr>update,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_fifo<br>
+ _Scheduler_priority_SMP_<wbr>Enqueue<br>
);<br>
}<br>
<br>
@@ -233,9 +175,9 @@ static bool _Scheduler_priority_SMP_Do_<wbr>ask_for_help(<br>
context,<br>
the_thread,<br>
node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_priority_SMP_<wbr>Insert_ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_priority_SMP_<wbr>Insert_ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_priority_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
@@ -256,10 +198,8 @@ void _Scheduler_priority_SMP_<wbr>Update_priority(<br>
node,<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready,<br>
_Scheduler_priority_SMP_Do_<wbr>update,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_fifo,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_lifo,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_fifo,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_lifo,<br>
+ _Scheduler_priority_SMP_<wbr>Enqueue,<br>
+ _Scheduler_priority_SMP_<wbr>Enqueue_scheduled,<br>
_Scheduler_priority_SMP_Do_<wbr>ask_for_help<br>
);<br>
}<br>
@@ -323,7 +263,7 @@ void _Scheduler_priority_SMP_Add_<wbr>processor(<br>
context,<br>
idle,<br>
_Scheduler_priority_SMP_Has_<wbr>ready,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_fifo,<br>
+ _Scheduler_priority_SMP_<wbr>Enqueue_scheduled,<br>
_Scheduler_SMP_Do_nothing_<wbr>register_idle<br>
);<br>
}<br>
@@ -339,7 +279,7 @@ Thread_Control *_Scheduler_priority_SMP_<wbr>Remove_processor(<br>
context,<br>
cpu,<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_fifo<br>
+ _Scheduler_priority_SMP_<wbr>Enqueue<br>
);<br>
}<br>
<br>
@@ -356,7 +296,7 @@ void _Scheduler_priority_SMP_Yield(<br>
thread,<br>
node,<br>
_Scheduler_priority_SMP_<wbr>Extract_from_ready,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_fifo,<br>
- _Scheduler_priority_SMP_<wbr>Enqueue_scheduled_fifo<br>
+ _Scheduler_priority_SMP_<wbr>Enqueue,<br>
+ _Scheduler_priority_SMP_<wbr>Enqueue_scheduled<br>
);<br>
}<br>
diff --git a/cpukit/score/src/<wbr>schedulerpriorityunblock.c b/cpukit/score/src/<wbr>schedulerpriorityunblock.c<br>
index 42ba4de98f..784bc58611 100644<br>
--- a/cpukit/score/src/<wbr>schedulerpriorityunblock.c<br>
+++ b/cpukit/score/src/<wbr>schedulerpriorityunblock.c<br>
@@ -31,18 +31,17 @@ void _Scheduler_priority_Unblock (<br>
Scheduler_priority_Context *context;<br>
Scheduler_priority_Node *the_node;<br>
unsigned int priority;<br>
- bool prepend_it;<br>
+ unsigned int unmapped_priority;<br>
<br>
context = _Scheduler_priority_Get_<wbr>context( scheduler );<br>
the_node = _Scheduler_priority_Node_<wbr>downcast( node );<br>
- priority = (unsigned int )<br>
- _Scheduler_Node_get_priority( &the_node->Base, &prepend_it );<br>
- (void) prepend_it;<br>
+ priority = (unsigned int ) _Scheduler_Node_get_priority( &the_node->Base );<br>
+ unmapped_priority = SCHEDULER_PRIORITY_UNMAP( priority );<br>
<br>
- if ( priority != the_node->Ready_queue.current_<wbr>priority ) {<br>
+ if ( unmapped_priority != the_node->Ready_queue.current_<wbr>priority ) {<br>
_Scheduler_priority_Ready_<wbr>queue_update(<br>
&the_node->Ready_queue,<br>
- priority,<br>
+ unmapped_priority,<br>
&context->Bit_map,<br>
&context->Ready[ 0 ]<br>
);<br>
diff --git a/cpukit/score/src/<wbr>schedulersimplechangepriority.<wbr>c b/cpukit/score/src/<wbr>schedulersimplechangepriority.<wbr>c<br>
index 8253a01421..c2c60a5f01 100644<br>
--- a/cpukit/score/src/<wbr>schedulersimplechangepriority.<wbr>c<br>
+++ b/cpukit/score/src/<wbr>schedulersimplechangepriority.<wbr>c<br>
@@ -28,7 +28,7 @@ void _Scheduler_simple_Update_<wbr>priority(<br>
)<br>
{<br>
Scheduler_simple_Context *context;<br>
- bool prepend_it;<br>
+ unsigned int new_priority;<br>
<br>
if ( !_Thread_Is_ready( the_thread ) ) {<br>
/* Nothing to do */<br>
@@ -36,15 +36,9 @@ void _Scheduler_simple_Update_<wbr>priority(<br>
}<br>
<br>
context = _Scheduler_simple_Get_context( scheduler );<br>
- _Scheduler_Node_get_priority( node, &prepend_it );<br>
+ new_priority = (unsigned int ) _Scheduler_Node_get_priority( node );<br>
<br>
_Scheduler_simple_Extract( scheduler, the_thread, node );<br>
-<br>
- if ( prepend_it ) {<br>
- _Scheduler_simple_Insert_<wbr>priority_lifo( &context->Ready, the_thread );<br>
- } else {<br>
- _Scheduler_simple_Insert_<wbr>priority_fifo( &context->Ready, the_thread );<br>
- }<br>
-<br>
+ _Scheduler_simple_Insert( &context->Ready, the_thread, new_priority );<br>
_Scheduler_simple_Schedule_<wbr>body( scheduler, the_thread, false );<br>
}<br>
diff --git a/cpukit/score/src/<wbr>schedulersimplesmp.c b/cpukit/score/src/<wbr>schedulersimplesmp.c<br>
index df08a19eab..4ab4987c3a 100644<br>
--- a/cpukit/score/src/<wbr>schedulersimplesmp.c<br>
+++ b/cpukit/score/src/<wbr>schedulersimplesmp.c<br>
@@ -99,17 +99,17 @@ static void _Scheduler_simple_SMP_Move_<wbr>from_scheduled_to_ready(<br>
)<br>
{<br>
Scheduler_simple_SMP_Context *self;<br>
- Priority_Control priority_to_insert;<br>
+ Priority_Control insert_priority;<br>
<br>
self = _Scheduler_simple_SMP_Get_<wbr>self( context );<br>
- priority_to_insert = _Scheduler_SMP_Node_priority( scheduled_to_ready );<br>
<br>
_Chain_Extract_unprotected( &scheduled_to_ready->Node.<wbr>Chain );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( scheduled_to_ready );<br>
_Chain_Insert_ordered_<wbr>unprotected(<br>
&self->Ready,<br>
&scheduled_to_ready->Node.<wbr>Chain,<br>
- &priority_to_insert,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order<br>
+ &insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal<br>
);<br>
}<br>
<br>
@@ -119,55 +119,36 @@ static void _Scheduler_simple_SMP_Move_<wbr>from_ready_to_scheduled(<br>
)<br>
{<br>
Scheduler_simple_SMP_Context *self;<br>
- Priority_Control priority_to_insert;<br>
+ Priority_Control insert_priority;<br>
<br>
self = _Scheduler_simple_SMP_Get_<wbr>self( context );<br>
- priority_to_insert = _Scheduler_SMP_Node_priority( ready_to_scheduled );<br>
<br>
_Chain_Extract_unprotected( &ready_to_scheduled->Node.<wbr>Chain );<br>
+ insert_priority = _Scheduler_SMP_Node_priority( ready_to_scheduled );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
_Chain_Insert_ordered_<wbr>unprotected(<br>
&self->Base.Scheduled,<br>
&ready_to_scheduled->Node.<wbr>Chain,<br>
- &priority_to_insert,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order<br>
+ &insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal<br>
);<br>
}<br>
<br>
-static void _Scheduler_simple_SMP_Insert_<wbr>ready_lifo(<br>
+static void _Scheduler_simple_SMP_Insert_<wbr>ready(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node_to_insert<br>
+ Scheduler_Node *node_to_insert,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
Scheduler_simple_SMP_Context *self;<br>
- Priority_Control priority_to_insert;<br>
<br>
self = _Scheduler_simple_SMP_Get_<wbr>self( context );<br>
- priority_to_insert = _Scheduler_SMP_Node_priority( node_to_insert );<br>
<br>
_Chain_Insert_ordered_<wbr>unprotected(<br>
&self->Ready,<br>
&node_to_insert->Node.Chain,<br>
- &priority_to_insert,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order<br>
- );<br>
-}<br>
-<br>
-static void _Scheduler_simple_SMP_Insert_<wbr>ready_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node_to_insert<br>
-)<br>
-{<br>
- Scheduler_simple_SMP_Context *self;<br>
- Priority_Control priority_to_insert;<br>
-<br>
- self = _Scheduler_simple_SMP_Get_<wbr>self( context );<br>
- priority_to_insert = _Scheduler_SMP_Node_priority( node_to_insert );<br>
-<br>
- _Chain_Insert_ordered_<wbr>unprotected(<br>
- &self->Ready,<br>
- &node_to_insert->Node.Chain,<br>
- &priority_to_insert,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order<br>
+ &insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal<br>
);<br>
}<br>
<br>
@@ -200,103 +181,45 @@ void _Scheduler_simple_SMP_Block(<br>
);<br>
}<br>
<br>
-static bool _Scheduler_simple_SMP_Enqueue_<wbr>ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+static bool _Scheduler_simple_SMP_Enqueue(<br>
+ Scheduler_Context *context,<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
+ return _Scheduler_SMP_Enqueue(<br>
context,<br>
node,<br>
- order,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_simple_SMP_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_simple_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
);<br>
}<br>
<br>
-static bool _Scheduler_simple_SMP_Enqueue_<wbr>lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_simple_SMP_Enqueue_<wbr>ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_simple_SMP_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_simple_SMP_Enqueue_<wbr>fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_simple_SMP_Enqueue_<wbr>ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_simple_SMP_Insert_<wbr>ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_ordered(<br>
+static bool _Scheduler_simple_SMP_Enqueue_<wbr>scheduled(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
+ return _Scheduler_SMP_Enqueue_<wbr>scheduled(<br>
context,<br>
node,<br>
- order,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
_Scheduler_simple_SMP_Extract_<wbr>from_ready,<br>
_Scheduler_simple_SMP_Get_<wbr>highest_ready,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ _Scheduler_simple_SMP_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_simple_SMP_Move_<wbr>from_ready_to_scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
);<br>
}<br>
<br>
-static bool _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_simple_SMP_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_simple_SMP_Insert_<wbr>ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
void _Scheduler_simple_SMP_Unblock(<br>
const Scheduler_Control *scheduler,<br>
Thread_Control *thread,<br>
@@ -310,7 +233,7 @@ void _Scheduler_simple_SMP_Unblock(<br>
thread,<br>
node,<br>
_Scheduler_simple_SMP_Do_<wbr>update,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>fifo<br>
+ _Scheduler_simple_SMP_Enqueue<br>
);<br>
}<br>
<br>
@@ -324,9 +247,9 @@ static bool _Scheduler_simple_SMP_Do_ask_<wbr>for_help(<br>
context,<br>
the_thread,<br>
node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_simple_SMP_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_simple_SMP_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_simple_SMP_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
@@ -347,10 +270,8 @@ void _Scheduler_simple_SMP_Update_<wbr>priority(<br>
node,<br>
_Scheduler_simple_SMP_Extract_<wbr>from_ready,<br>
_Scheduler_simple_SMP_Do_<wbr>update,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>fifo,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>lifo,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_fifo,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_lifo,<br>
+ _Scheduler_simple_SMP_Enqueue,<br>
+ _Scheduler_simple_SMP_Enqueue_<wbr>scheduled,<br>
_Scheduler_simple_SMP_Do_ask_<wbr>for_help<br>
);<br>
}<br>
@@ -414,7 +335,7 @@ void _Scheduler_simple_SMP_Add_<wbr>processor(<br>
context,<br>
idle,<br>
_Scheduler_simple_SMP_Has_<wbr>ready,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_fifo,<br>
+ _Scheduler_simple_SMP_Enqueue_<wbr>scheduled,<br>
_Scheduler_SMP_Do_nothing_<wbr>register_idle<br>
);<br>
}<br>
@@ -430,7 +351,7 @@ Thread_Control *_Scheduler_simple_SMP_Remove_<wbr>processor(<br>
context,<br>
cpu,<br>
_Scheduler_simple_SMP_Extract_<wbr>from_ready,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>fifo<br>
+ _Scheduler_simple_SMP_Enqueue<br>
);<br>
}<br>
<br>
@@ -447,7 +368,7 @@ void _Scheduler_simple_SMP_Yield(<br>
thread,<br>
node,<br>
_Scheduler_simple_SMP_Extract_<wbr>from_ready,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>fifo,<br>
- _Scheduler_simple_SMP_Enqueue_<wbr>scheduled_fifo<br>
+ _Scheduler_simple_SMP_Enqueue,<br>
+ _Scheduler_simple_SMP_Enqueue_<wbr>scheduled<br>
);<br>
}<br>
diff --git a/cpukit/score/src/<wbr>schedulersimpleunblock.c b/cpukit/score/src/<wbr>schedulersimpleunblock.c<br>
index 5540e20e87..2f5c8636f5 100644<br>
--- a/cpukit/score/src/<wbr>schedulersimpleunblock.c<br>
+++ b/cpukit/score/src/<wbr>schedulersimpleunblock.c<br>
@@ -28,13 +28,15 @@ void _Scheduler_simple_Unblock(<br>
)<br>
{<br>
Scheduler_simple_Context *context;<br>
- Priority_Control priority;<br>
+ unsigned int priority;<br>
+ unsigned int insert_priority;<br>
<br>
(void) node;<br>
<br>
context = _Scheduler_simple_Get_context( scheduler );<br>
- _Scheduler_simple_Insert_<wbr>priority_fifo( &context->Ready, the_thread );<br>
priority = _Thread_Get_priority( the_thread );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( priority );<br>
+ _Scheduler_simple_Insert( &context->Ready, the_thread, insert_priority );<br>
<br>
/*<br>
* If the thread that was unblocked is more important than the heir,<br>
diff --git a/cpukit/score/src/<wbr>schedulersimpleyield.c b/cpukit/score/src/<wbr>schedulersimpleyield.c<br>
index 0c150d8b1f..95f9cd3540 100644<br>
--- a/cpukit/score/src/<wbr>schedulersimpleyield.c<br>
+++ b/cpukit/score/src/<wbr>schedulersimpleyield.c<br>
@@ -26,12 +26,16 @@ void _Scheduler_simple_Yield(<br>
Scheduler_Node *node<br>
)<br>
{<br>
- Scheduler_simple_Context *context =<br>
- _Scheduler_simple_Get_context( scheduler );<br>
+ Scheduler_simple_Context *context;<br>
+ unsigned int insert_priority;<br>
+<br>
+ context = _Scheduler_simple_Get_context( scheduler );<br>
<br>
(void) node;<br>
<br>
_Chain_Extract_unprotected( &the_thread->Object.Node );<br>
- _Scheduler_simple_Insert_<wbr>priority_fifo( &context->Ready, the_thread );<br>
+ insert_priority = (unsigned int) _Thread_Get_priority( the_thread );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
+ _Scheduler_simple_Insert( &context->Ready, the_thread, insert_priority );<br>
_Scheduler_simple_Schedule_<wbr>body( scheduler, the_thread, false );<br>
}<br>
diff --git a/cpukit/score/src/<wbr>schedulerstrongapa.c b/cpukit/score/src/<wbr>schedulerstrongapa.c<br>
index 57ffb61367..19d4ebe348 100644<br>
--- a/cpukit/score/src/<wbr>schedulerstrongapa.c<br>
+++ b/cpukit/score/src/<wbr>schedulerstrongapa.c<br>
@@ -66,7 +66,7 @@ static void _Scheduler_strong_APA_Move_<wbr>from_ready_to_scheduled(<br>
{<br>
Scheduler_strong_APA_Context *self;<br>
Scheduler_strong_APA_Node *node;<br>
- Priority_Control priority;<br>
+ Priority_Control insert_priority;<br>
<br>
self = _Scheduler_strong_APA_Get_<wbr>self( context );<br>
node = _Scheduler_strong_APA_Node_<wbr>downcast( ready_to_scheduled );<br>
@@ -76,47 +76,41 @@ static void _Scheduler_strong_APA_Move_<wbr>from_ready_to_scheduled(<br>
&node->Ready_queue,<br>
&self->Bit_map<br>
);<br>
- priority = node->Base.priority;<br>
+ insert_priority = _Scheduler_SMP_Node_priority( &node->Base.Base );<br>
+ insert_priority = SCHEDULER_PRIORITY_APPEND( insert_priority );<br>
_Chain_Insert_ordered_<wbr>unprotected(<br>
&self->Base.Scheduled,<br>
&node->Base.Base.Node.Chain,<br>
- &priority,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order<br>
+ &insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal<br>
);<br>
}<br>
<br>
-static void _Scheduler_strong_APA_Insert_<wbr>ready_lifo(<br>
+static void _Scheduler_strong_APA_Insert_<wbr>ready(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *the_thread<br>
-)<br>
-{<br>
- Scheduler_strong_APA_Context *self =<br>
- _Scheduler_strong_APA_Get_<wbr>self( context );<br>
- Scheduler_strong_APA_Node *node =<br>
- _Scheduler_strong_APA_Node_<wbr>downcast( the_thread );<br>
-<br>
- _Scheduler_priority_Ready_<wbr>queue_enqueue(<br>
- &node->Base.Base.Node.Chain,<br>
- &node->Ready_queue,<br>
- &self->Bit_map<br>
- );<br>
-}<br>
-<br>
-static void _Scheduler_strong_APA_Insert_<wbr>ready_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *the_thread<br>
+ Scheduler_Node *node_base,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- Scheduler_strong_APA_Context *self =<br>
- _Scheduler_strong_APA_Get_<wbr>self( context );<br>
- Scheduler_strong_APA_Node *node =<br>
- _Scheduler_strong_APA_Node_<wbr>downcast( the_thread );<br>
+ Scheduler_strong_APA_Context *self;<br>
+ Scheduler_strong_APA_Node *node;<br>
<br>
- _Scheduler_priority_Ready_<wbr>queue_enqueue_first(<br>
- &node->Base.Base.Node.Chain,<br>
- &node->Ready_queue,<br>
- &self->Bit_map<br>
- );<br>
+ self = _Scheduler_strong_APA_Get_<wbr>self( context );<br>
+ node = _Scheduler_strong_APA_Node_<wbr>downcast( node_base );<br>
+<br>
+ if ( SCHEDULER_PRIORITY_IS_APPEND( insert_priority ) ) {<br>
+ _Scheduler_priority_Ready_<wbr>queue_enqueue(<br>
+ &node->Base.Base.Node.Chain,<br>
+ &node->Ready_queue,<br>
+ &self->Bit_map<br>
+ );<br>
+ } else {<br>
+ _Scheduler_priority_Ready_<wbr>queue_enqueue_first(<br>
+ &node->Base.Base.Node.Chain,<br>
+ &node->Ready_queue,<br>
+ &self->Bit_map<br>
+ );<br>
+ }<br>
}<br>
<br>
static void _Scheduler_strong_APA_Extract_<wbr>from_ready(<br>
@@ -150,7 +144,7 @@ static void _Scheduler_strong_APA_Do_<wbr>update(<br>
_Scheduler_SMP_Node_update_<wbr>priority( &node->Base, new_priority );<br>
_Scheduler_priority_Ready_<wbr>queue_update(<br>
&node->Ready_queue,<br>
- new_priority,<br>
+ SCHEDULER_PRIORITY_UNMAP( new_priority ),<br>
&self->Bit_map,<br>
&self->Ready[ 0 ]<br>
);<br>
@@ -198,7 +192,7 @@ void _Scheduler_strong_APA_Node_<wbr>initialize(<br>
self = _Scheduler_strong_APA_Get_<wbr>self( context );<br>
_Scheduler_priority_Ready_<wbr>queue_update(<br>
&the_node->Ready_queue,<br>
- priority,<br>
+ SCHEDULER_PRIORITY_UNMAP( priority ),<br>
&self->Bit_map,<br>
&self->Ready[ 0 ]<br>
);<br>
@@ -247,103 +241,45 @@ void _Scheduler_strong_APA_Block(<br>
);<br>
}<br>
<br>
-static bool _Scheduler_strong_APA_Enqueue_<wbr>ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+static bool _Scheduler_strong_APA_Enqueue(<br>
+ Scheduler_Context *context,<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>ordered(<br>
+ return _Scheduler_SMP_Enqueue(<br>
context,<br>
node,<br>
- order,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_strong_APA_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_strong_APA_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_exact<br>
);<br>
}<br>
<br>
-static bool _Scheduler_strong_APA_Enqueue_<wbr>lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_strong_APA_Enqueue_<wbr>ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_strong_APA_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_strong_APA_Enqueue_<wbr>fifo(<br>
+static bool _Scheduler_strong_APA_Enqueue_<wbr>scheduled(<br>
Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_strong_APA_Enqueue_<wbr>ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_strong_APA_Insert_<wbr>ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_strong_APA_Enqueue_<wbr>scheduled_ordered(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node,<br>
- Chain_Node_order order,<br>
- Scheduler_SMP_Insert insert_ready,<br>
- Scheduler_SMP_Insert insert_scheduled<br>
+ Scheduler_Node *node,<br>
+ Priority_Control insert_priority<br>
)<br>
{<br>
- return _Scheduler_SMP_Enqueue_<wbr>scheduled_ordered(<br>
+ return _Scheduler_SMP_Enqueue_<wbr>scheduled(<br>
context,<br>
node,<br>
- order,<br>
+ insert_priority,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
_Scheduler_strong_APA_Extract_<wbr>from_ready,<br>
_Scheduler_strong_APA_Get_<wbr>highest_ready,<br>
- insert_ready,<br>
- insert_scheduled,<br>
+ _Scheduler_strong_APA_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_strong_APA_Move_<wbr>from_ready_to_scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_exact<br>
);<br>
}<br>
<br>
-static bool _Scheduler_strong_APA_Enqueue_<wbr>scheduled_lifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_strong_APA_Enqueue_<wbr>scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_strong_APA_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo<br>
- );<br>
-}<br>
-<br>
-static bool _Scheduler_strong_APA_Enqueue_<wbr>scheduled_fifo(<br>
- Scheduler_Context *context,<br>
- Scheduler_Node *node<br>
-)<br>
-{<br>
- return _Scheduler_strong_APA_Enqueue_<wbr>scheduled_ordered(<br>
- context,<br>
- node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_fifo_order,<br>
- _Scheduler_strong_APA_Insert_<wbr>ready_fifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_fifo<br>
- );<br>
-}<br>
-<br>
void _Scheduler_strong_APA_Unblock(<br>
const Scheduler_Control *scheduler,<br>
Thread_Control *the_thread,<br>
@@ -357,7 +293,7 @@ void _Scheduler_strong_APA_Unblock(<br>
the_thread,<br>
node,<br>
_Scheduler_strong_APA_Do_<wbr>update,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>fifo<br>
+ _Scheduler_strong_APA_Enqueue<br>
);<br>
}<br>
<br>
@@ -371,9 +307,9 @@ static bool _Scheduler_strong_APA_Do_ask_<wbr>for_help(<br>
context,<br>
the_thread,<br>
node,<br>
- _Scheduler_SMP_Insert_<wbr>priority_lifo_order,<br>
- _Scheduler_strong_APA_Insert_<wbr>ready_lifo,<br>
- _Scheduler_SMP_Insert_<wbr>scheduled_lifo,<br>
+ _Scheduler_SMP_Priority_less_<wbr>equal,<br>
+ _Scheduler_strong_APA_Insert_<wbr>ready,<br>
+ _Scheduler_SMP_Insert_<wbr>scheduled,<br>
_Scheduler_strong_APA_Move_<wbr>from_scheduled_to_ready,<br>
_Scheduler_SMP_Get_lowest_<wbr>scheduled,<br>
_Scheduler_SMP_Allocate_<wbr>processor_lazy<br>
@@ -394,10 +330,8 @@ void _Scheduler_strong_APA_Update_<wbr>priority(<br>
node,<br>
_Scheduler_strong_APA_Extract_<wbr>from_ready,<br>
_Scheduler_strong_APA_Do_<wbr>update,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>fifo,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>lifo,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>scheduled_fifo,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>scheduled_lifo,<br>
+ _Scheduler_strong_APA_Enqueue,<br>
+ _Scheduler_strong_APA_Enqueue_<wbr>scheduled,<br>
_Scheduler_strong_APA_Do_ask_<wbr>for_help<br>
);<br>
}<br>
@@ -461,7 +395,7 @@ void _Scheduler_strong_APA_Add_<wbr>processor(<br>
context,<br>
idle,<br>
_Scheduler_strong_APA_Has_<wbr>ready,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>scheduled_fifo,<br>
+ _Scheduler_strong_APA_Enqueue_<wbr>scheduled,<br>
_Scheduler_SMP_Do_nothing_<wbr>register_idle<br>
);<br>
}<br>
@@ -477,7 +411,7 @@ Thread_Control *_Scheduler_strong_APA_Remove_<wbr>processor(<br>
context,<br>
cpu,<br>
_Scheduler_strong_APA_Extract_<wbr>from_ready,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>fifo<br>
+ _Scheduler_strong_APA_Enqueue<br>
);<br>
}<br>
<br>
@@ -494,7 +428,7 @@ void _Scheduler_strong_APA_Yield(<br>
the_thread,<br>
node,<br>
_Scheduler_strong_APA_Extract_<wbr>from_ready,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>fifo,<br>
- _Scheduler_strong_APA_Enqueue_<wbr>scheduled_fifo<br>
+ _Scheduler_strong_APA_Enqueue,<br>
+ _Scheduler_strong_APA_Enqueue_<wbr>scheduled<br>
);<br>
}<br>
diff --git a/testsuites/smptests/<wbr>smpscheduler01/smpscheduler01.<wbr>doc b/testsuites/smptests/<wbr>smpscheduler01/smpscheduler01.<wbr>doc<br>
index def7dac128..a881fc0fc4 100644<br>
--- a/testsuites/smptests/<wbr>smpscheduler01/smpscheduler01.<wbr>doc<br>
+++ b/testsuites/smptests/<wbr>smpscheduler01/smpscheduler01.<wbr>doc<br>
@@ -4,7 +4,7 @@ test set name: smpscheduler01<br>
<br>
directives:<br>
<br>
- - _Scheduler_SMP_Enqueue_<wbr>ordered()<br>
+ - _Scheduler_SMP_Enqueue()<br>
- _Scheduler_SMP_Block()<br>
<br>
concepts:<br>
diff --git a/testsuites/sptests/<wbr>spintrcritical23/init.c b/testsuites/sptests/<wbr>spintrcritical23/init.c<br>
index c0a159471c..02c8a7ef37 100644<br>
--- a/testsuites/sptests/<wbr>spintrcritical23/init.c<br>
+++ b/testsuites/sptests/<wbr>spintrcritical23/init.c<br>
@@ -1,5 +1,5 @@<br>
/*<br>
- * Copyright (c) 2015, 2016 embedded brains GmbH. All rights reserved.<br>
+ * Copyright (c) 2015, 2017 embedded brains GmbH. All rights reserved.<br>
*<br>
* embedded brains GmbH<br>
* Dornierstr. 4<br>
@@ -43,12 +43,15 @@ static void change_priority(rtems_id timer, void *arg)<br>
/* The arg is NULL */<br>
test_context *ctx = &ctx_instance;<br>
rtems_interrupt_lock_context lock_context;<br>
+ unsigned int next_priority;<br>
<br>
rtems_interrupt_lock_acquire(&<wbr>ctx->lock, &lock_context);<br>
- if (<br>
- ctx->scheduler_node->Ready_<wbr>queue.current_priority<br>
- != ctx->scheduler_node->Base.<wbr>Priority.value<br>
- ) {<br>
+<br>
+ next_priority = SCHEDULER_PRIORITY_UNMAP(<br>
+ (unsigned int) ctx->scheduler_node->Base.<wbr>Priority.value<br>
+ );<br>
+<br>
+ if ( ctx->scheduler_node->Ready_<wbr>queue.current_priority != next_priority ) {<br>
rtems_task_priority priority_interrupt;<br>
rtems_task_priority priority_task;<br>
rtems_task_priority previous;<br>
@@ -84,11 +87,13 @@ static bool test_body(void *arg)<br>
rtems_task_priority previous;<br>
<br>
rtems_interrupt_lock_acquire(&<wbr>ctx->lock, &lock_context);<br>
+<br>
priority_last = ctx->priority_task;<br>
priority_task = 1 + (priority_last + 1) % 3;<br>
priority_interrupt = 1 + (priority_task + 1) % 3;<br>
ctx->priority_task = priority_task;<br>
ctx->priority_interrupt = priority_interrupt;<br>
+<br>
rtems_interrupt_lock_release(&<wbr>ctx->lock, &lock_context);<br>
<br>
sc = rtems_task_set_priority(<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.3<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</font></span></blockquote></div><br></div>