summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-10 14:50:19 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-02 10:05:41 +0100
commit72e0bdba4580072c33da09fcacbd3063dbc4f2c1 (patch)
treef2daa6386cdbef84266bb363bd6c26de610a146b /cpukit/score/include/rtems/score
parentscore: Pass scheduler node to block operation (diff)
downloadrtems-72e0bdba4580072c33da09fcacbd3063dbc4f2c1.tar.bz2
score: Pass scheduler node to unblock operation
Changed for consistency with other scheduler operations. Update #2556.
Diffstat (limited to 'cpukit/score/include/rtems/score')
-rw-r--r--cpukit/score/include/rtems/score/scheduler.h3
-rw-r--r--cpukit/score/include/rtems/score/schedulercbs.h17
-rw-r--r--cpukit/score/include/rtems/score/scheduleredf.h13
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h6
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriority.h13
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h11
-rw-r--r--cpukit/score/include/rtems/score/schedulerprioritysmp.h3
-rw-r--r--cpukit/score/include/rtems/score/schedulersimple.h13
-rw-r--r--cpukit/score/include/rtems/score/schedulersimplesmp.h3
-rw-r--r--cpukit/score/include/rtems/score/schedulersmpimpl.h40
-rw-r--r--cpukit/score/include/rtems/score/schedulerstrongapa.h3
11 files changed, 44 insertions, 81 deletions
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index eb8db7cbb3..ad04e7fa6e 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -79,7 +79,8 @@ typedef struct {
/** @see _Scheduler_Unblock() */
Scheduler_Void_or_thread ( *unblock )(
const Scheduler_Control *,
- Thread_Control *
+ Thread_Control *,
+ Scheduler_Node *
);
/** @see _Scheduler_Update_priority() */
diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h
index 02c7b53e12..ee8e40d399 100644
--- a/cpukit/score/include/rtems/score/schedulercbs.h
+++ b/cpukit/score/include/rtems/score/schedulercbs.h
@@ -146,23 +146,10 @@ typedef struct {
*/
extern Scheduler_CBS_Server _Scheduler_CBS_Server_list[];
-/**
- * @brief Unblocks a thread from the queue.
- *
- * This routine adds @a the_thread to the scheduling decision, that is,
- * adds it to the ready queue and updates any appropriate scheduling
- * variables, for example the heir thread. It is checked whether the
- * remaining budget is sufficient. If not, the thread continues as a
- * new job in order to protect concurrent threads.
- *
- * @param[in] scheduler The scheduler instance.
- * @param[in] the_thread will be unblocked.
- *
- * @note This has to be asessed as missed deadline of the current job.
- */
Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
);
void _Scheduler_CBS_Release_job(
diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h
index 2ecf1a4eb2..65218e785a 100644
--- a/cpukit/score/include/rtems/score/scheduleredf.h
+++ b/cpukit/score/include/rtems/score/scheduleredf.h
@@ -144,19 +144,10 @@ void _Scheduler_EDF_Node_initialize(
Priority_Control priority
);
-/**
- * @brief Adds @a the_thread to the scheduling decision.
- *
- * This routine adds @a the_thread to the scheduling decision, that is,
- * adds it to the ready queue and updates any appropriate scheduling
- * variables, for example the heir thread.
- *
- * @param[in] scheduler The scheduler instance.
- * @param[in] the_thread will be unblocked.
- */
Scheduler_Void_or_thread _Scheduler_EDF_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
);
Scheduler_Void_or_thread _Scheduler_EDF_Update_priority(
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index e630cc2e53..3108641365 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -363,7 +363,11 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
#if defined(RTEMS_SMP)
needs_help =
#endif
- ( *scheduler->Operations.unblock )( scheduler, the_thread );
+ ( *scheduler->Operations.unblock )(
+ scheduler,
+ the_thread,
+ _Thread_Scheduler_get_home_node( the_thread )
+ );
#if defined(RTEMS_SMP)
_Scheduler_Ask_for_help_if_necessary( needs_help );
diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h
index 89912aac55..57855aa643 100644
--- a/cpukit/score/include/rtems/score/schedulerpriority.h
+++ b/cpukit/score/include/rtems/score/schedulerpriority.h
@@ -128,19 +128,10 @@ void _Scheduler_priority_Schedule(
Thread_Control *the_thread
);
-/**
- * @brief Add @a the_thread to the scheduling decision.
- *
- * This routine adds @a the_thread to the scheduling decision,
- * that is, adds it to the ready queue and
- * updates any appropriate scheduling variables, for example the heir thread.
- *
- * @param[in] scheduler The scheduler instance.
- * @param[in] the_thread will be unblocked
- */
Scheduler_Void_or_thread _Scheduler_priority_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
);
Scheduler_Void_or_thread _Scheduler_priority_Update_priority(
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
index bc3ea49d69..359c369dd0 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -92,17 +92,10 @@ void _Scheduler_priority_affinity_SMP_Block(
Scheduler_Node *node
);
-/**
- * @brief SMP Priority Affinity Scheduler Unblock Operation
- *
- * This method is the unblock operation for this scheduler.
- *
- * @param[in] scheduler is the scheduler instance information
- * @param[in] thread is the thread to unblock
- */
Thread_Control *_Scheduler_priority_affinity_SMP_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
);
/**
diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
index de37d34d0e..9042243c09 100644
--- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
@@ -113,7 +113,8 @@ void _Scheduler_priority_SMP_Block(
Thread_Control *_Scheduler_priority_SMP_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
);
Thread_Control *_Scheduler_priority_SMP_Update_priority(
diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h
index 4ef0db8d6f..cd18650d68 100644
--- a/cpukit/score/include/rtems/score/schedulersimple.h
+++ b/cpukit/score/include/rtems/score/schedulersimple.h
@@ -104,19 +104,10 @@ void _Scheduler_simple_Block(
Scheduler_Node *node
);
-/**
- * @brief Unblock a simple-priority-based thread.
- *
- * This routine adds @a the_thread to the scheduling decision,
- * that is, adds it to the ready queue and
- * updates any appropriate scheduling variables, for example the heir thread.
- *
- * @param[in] scheduler The scheduler instance.
- * @param[in] the_thread is the thread that is to be unblocked
- */
Scheduler_Void_or_thread _Scheduler_simple_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
);
Scheduler_Void_or_thread _Scheduler_simple_Update_priority(
diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h
index db36b84857..2275237447 100644
--- a/cpukit/score/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h
@@ -96,7 +96,8 @@ void _Scheduler_simple_SMP_Block(
Thread_Control *_Scheduler_simple_SMP_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Scheduler_Node *node
);
Thread_Control *_Scheduler_simple_SMP_Update_priority(
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index f797735c76..0f82161993 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -924,22 +924,21 @@ static inline void _Scheduler_SMP_Block(
static inline Thread_Control *_Scheduler_SMP_Unblock(
Scheduler_Context *context,
Thread_Control *thread,
+ Scheduler_Node *node,
Scheduler_SMP_Update update,
Scheduler_SMP_Enqueue enqueue_fifo
)
{
- Scheduler_SMP_Node *node;
- bool is_scheduled;
- bool unblock;
- Thread_Control *needs_help;
+ Scheduler_SMP_Node_state node_state;
+ bool unblock;
+ Thread_Control *needs_help;
- node = _Scheduler_SMP_Thread_get_node( thread );
- is_scheduled = ( node->state == SCHEDULER_SMP_NODE_SCHEDULED );
+ node_state = _Scheduler_SMP_Node_state( node );
unblock = _Scheduler_Unblock_node(
context,
thread,
- &node->Base,
- is_scheduled,
+ node,
+ node_state == SCHEDULER_SMP_NODE_SCHEDULED,
_Scheduler_SMP_Release_idle_thread
);
@@ -947,26 +946,29 @@ static inline Thread_Control *_Scheduler_SMP_Unblock(
Priority_Control new_priority;
bool prepend_it;
- new_priority = _Scheduler_Node_get_priority( &node->Base, &prepend_it );
+ new_priority = _Scheduler_Node_get_priority( node, &prepend_it );
(void) prepend_it;
- if ( new_priority != node->priority ) {
- ( *update )( context, &node->Base, new_priority );
+ if ( new_priority != _Scheduler_SMP_Node_priority( node ) ) {
+ ( *update )( context, node, new_priority );
}
- if ( node->state == SCHEDULER_SMP_NODE_BLOCKED ) {
- _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
+ if ( node_state == SCHEDULER_SMP_NODE_BLOCKED ) {
+ _Scheduler_SMP_Node_change_state(
+ _Scheduler_SMP_Node_downcast( node ),
+ SCHEDULER_SMP_NODE_READY
+ );
- needs_help = ( *enqueue_fifo )( context, &node->Base, thread );
+ needs_help = ( *enqueue_fifo )( context, node, thread );
} else {
- _Assert( node->state == SCHEDULER_SMP_NODE_READY );
+ _Assert( node_state == SCHEDULER_SMP_NODE_READY );
_Assert(
- node->Base.help_state == SCHEDULER_HELP_ACTIVE_OWNER
- || node->Base.help_state == SCHEDULER_HELP_ACTIVE_RIVAL
+ node->help_state == SCHEDULER_HELP_ACTIVE_OWNER
+ || node->help_state == SCHEDULER_HELP_ACTIVE_RIVAL
);
- _Assert( node->Base.idle == NULL );
+ _Assert( node->idle == NULL );
- if ( node->Base.accepts_help == thread ) {
+ if ( node->accepts_help == thread ) {
needs_help = thread;
} else {
needs_help = NULL;
diff --git a/cpukit/score/include/rtems/score/schedulerstrongapa.h b/cpukit/score/include/rtems/score/schedulerstrongapa.h
index a83616cdfc..fd6d6ec247 100644
--- a/cpukit/score/include/rtems/score/schedulerstrongapa.h
+++ b/cpukit/score/include/rtems/score/schedulerstrongapa.h
@@ -113,7 +113,8 @@ void _Scheduler_strong_APA_Block(
Thread_Control *_Scheduler_strong_APA_Unblock(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Scheduler_Node *node
);
Thread_Control *_Scheduler_strong_APA_Update_priority(