summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulerprioritysmp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-10 16:13:37 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-23 09:53:59 +0200
commit8f0c7a46ed1edc5b2489bfd248942d6918836e3f (patch)
tree3ceb6d5a1c3133fc4412da974b13f2f92ff8e90d /cpukit/score/src/schedulerprioritysmp.c
parentscore: Use chain nodes for ready queue support (diff)
downloadrtems-8f0c7a46ed1edc5b2489bfd248942d6918836e3f.tar.bz2
score: Decouple thread and scheduler nodes on SMP
Add a chain node to the scheduler node to decouple the thread and scheduler nodes. It is now possible to enqueue a thread in a thread wait queue and use its scheduler node at the same for other threads, e.g. a resouce owner.
Diffstat (limited to 'cpukit/score/src/schedulerprioritysmp.c')
-rw-r--r--cpukit/score/src/schedulerprioritysmp.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c
index b6b5ff415e..f340b83b9d 100644
--- a/cpukit/score/src/schedulerprioritysmp.c
+++ b/cpukit/score/src/schedulerprioritysmp.c
@@ -25,7 +25,6 @@
#endif
#include <rtems/score/schedulerprioritysmpimpl.h>
-#include <rtems/score/schedulersmpimpl.h>
static Scheduler_priority_SMP_Context *
_Scheduler_priority_SMP_Get_context( const Scheduler_Control *scheduler )
@@ -50,7 +49,7 @@ void _Scheduler_priority_SMP_Node_initialize(
{
Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( thread );
- _Scheduler_SMP_Node_initialize( node );
+ _Scheduler_SMP_Node_initialize( node, thread );
}
void _Scheduler_priority_SMP_Update_priority(
@@ -65,17 +64,17 @@ void _Scheduler_priority_SMP_Update_priority(
_Scheduler_priority_SMP_Do_update( context, node, new_priority );
}
-static Thread_Control *_Scheduler_priority_SMP_Get_highest_ready(
+static Scheduler_Node *_Scheduler_priority_SMP_Get_highest_ready(
Scheduler_Context *context,
- Thread_Control *thread
+ Scheduler_Node *node
)
{
Scheduler_priority_SMP_Context *self =
_Scheduler_priority_SMP_Get_self( context );
- (void) thread;
+ (void) node;
- return (Thread_Control *) _Scheduler_priority_Ready_queue_first(
+ return (Scheduler_Node *) _Scheduler_priority_Ready_queue_first(
&self->Bit_map,
&self->Ready[ 0 ]
);
@@ -100,7 +99,7 @@ void _Scheduler_priority_SMP_Block(
static void _Scheduler_priority_SMP_Enqueue_ordered(
Scheduler_Context *context,
- Thread_Control *thread,
+ Scheduler_Node *node,
Chain_Node_order order,
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled
@@ -108,7 +107,7 @@ static void _Scheduler_priority_SMP_Enqueue_ordered(
{
_Scheduler_SMP_Enqueue_ordered(
context,
- thread,
+ node,
order,
insert_ready,
insert_scheduled,
@@ -120,13 +119,13 @@ static void _Scheduler_priority_SMP_Enqueue_ordered(
static void _Scheduler_priority_SMP_Enqueue_lifo(
Scheduler_Context *context,
- Thread_Control *thread
+ Scheduler_Node *node
)
{
_Scheduler_priority_SMP_Enqueue_ordered(
context,
- thread,
- _Scheduler_simple_Insert_priority_lifo_order,
+ node,
+ _Scheduler_SMP_Insert_priority_lifo_order,
_Scheduler_priority_SMP_Insert_ready_lifo,
_Scheduler_SMP_Insert_scheduled_lifo
);
@@ -134,13 +133,13 @@ static void _Scheduler_priority_SMP_Enqueue_lifo(
static void _Scheduler_priority_SMP_Enqueue_fifo(
Scheduler_Context *context,
- Thread_Control *thread
+ Scheduler_Node *node
)
{
_Scheduler_priority_SMP_Enqueue_ordered(
context,
- thread,
- _Scheduler_simple_Insert_priority_fifo_order,
+ node,
+ _Scheduler_SMP_Insert_priority_fifo_order,
_Scheduler_priority_SMP_Insert_ready_fifo,
_Scheduler_SMP_Insert_scheduled_fifo
);
@@ -148,7 +147,7 @@ static void _Scheduler_priority_SMP_Enqueue_fifo(
static void _Scheduler_priority_SMP_Enqueue_scheduled_ordered(
Scheduler_Context *context,
- Thread_Control *thread,
+ Scheduler_Node *node,
Chain_Node_order order,
Scheduler_SMP_Insert insert_ready,
Scheduler_SMP_Insert insert_scheduled
@@ -156,7 +155,7 @@ static void _Scheduler_priority_SMP_Enqueue_scheduled_ordered(
{
_Scheduler_SMP_Enqueue_scheduled_ordered(
context,
- thread,
+ node,
order,
_Scheduler_priority_SMP_Get_highest_ready,
insert_ready,
@@ -168,13 +167,13 @@ static void _Scheduler_priority_SMP_Enqueue_scheduled_ordered(
static void _Scheduler_priority_SMP_Enqueue_scheduled_lifo(
Scheduler_Context *context,
- Thread_Control *thread
+ Scheduler_Node *node
)
{
_Scheduler_priority_SMP_Enqueue_scheduled_ordered(
context,
- thread,
- _Scheduler_simple_Insert_priority_lifo_order,
+ node,
+ _Scheduler_SMP_Insert_priority_lifo_order,
_Scheduler_priority_SMP_Insert_ready_lifo,
_Scheduler_SMP_Insert_scheduled_lifo
);
@@ -182,13 +181,13 @@ static void _Scheduler_priority_SMP_Enqueue_scheduled_lifo(
static void _Scheduler_priority_SMP_Enqueue_scheduled_fifo(
Scheduler_Context *context,
- Thread_Control *thread
+ Scheduler_Node *node
)
{
_Scheduler_priority_SMP_Enqueue_scheduled_ordered(
context,
- thread,
- _Scheduler_simple_Insert_priority_fifo_order,
+ node,
+ _Scheduler_SMP_Insert_priority_fifo_order,
_Scheduler_priority_SMP_Insert_ready_fifo,
_Scheduler_SMP_Insert_scheduled_fifo
);