summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/scheduler.h12
-rw-r--r--cpukit/score/include/rtems/score/schedulercbs.h15
-rw-r--r--cpukit/score/include/rtems/score/scheduleredf.h17
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h16
-rw-r--r--cpukit/score/src/schedulercbsreleasejob.c6
-rw-r--r--cpukit/score/src/schedulerdefaultreleasejob.c8
-rw-r--r--cpukit/score/src/scheduleredfreleasejob.c8
7 files changed, 36 insertions, 46 deletions
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index c8a7f87541..0a6d68208a 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -139,14 +139,14 @@ typedef struct {
void ( *node_destroy )( const Scheduler_Control *, Scheduler_Node * );
/** @see _Scheduler_Release_job() */
- void ( *release_job ) (
+ Thread_Control *( *release_job ) (
const Scheduler_Control *,
Thread_Control *,
uint64_t
);
/** @see _Scheduler_Cancel_job() */
- void ( *cancel_job ) (
+ Thread_Control *( *cancel_job ) (
const Scheduler_Control *,
Thread_Control *
);
@@ -533,8 +533,10 @@ void _Scheduler_default_Node_destroy(
* @param[in] scheduler Unused.
* @param[in] the_thread Unused.
* @param[in] deadline Unused.
+ *
+ * @retval NULL Always.
*/
-void _Scheduler_default_Release_job(
+Thread_Control *_Scheduler_default_Release_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
uint64_t deadline
@@ -545,8 +547,10 @@ void _Scheduler_default_Release_job(
*
* @param[in] scheduler Unused.
* @param[in] the_thread Unused.
+ *
+ * @retval NULL Always.
*/
-void _Scheduler_default_Cancel_job(
+Thread_Control *_Scheduler_default_Cancel_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
);
diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h
index bfad633987..c230e08d24 100644
--- a/cpukit/score/include/rtems/score/schedulercbs.h
+++ b/cpukit/score/include/rtems/score/schedulercbs.h
@@ -163,20 +163,7 @@ Scheduler_Void_or_thread _Scheduler_CBS_Unblock(
Thread_Control *the_thread
);
-/**
- * @brief Called when a new job of task is released.
- *
- * This routine is called when a new job of task is released.
- * It is called only from Rate Monotonic manager in the beginning
- * of new period. Deadline has to be shifted and budget replenished.
- *
- * @param[in] scheduler The scheduler instance.
- * @param[in] the_thread is the owner of the job.
- * @param[in] length of the new job from now. If equal to 0,
- * the job was cancelled or deleted.
- */
-
-void _Scheduler_CBS_Release_job (
+Thread_Control *_Scheduler_CBS_Release_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
uint64_t length
diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h
index 5d9b4359c4..81b245e391 100644
--- a/cpukit/score/include/rtems/score/scheduleredf.h
+++ b/cpukit/score/include/rtems/score/scheduleredf.h
@@ -215,26 +215,13 @@ Scheduler_Void_or_thread _Scheduler_EDF_Yield(
Thread_Control *the_thread
);
-/**
- * @brief Called when a new job of task is released.
- *
- * This routine is called when a new job of task is released.
- * It is called only from Rate Monotonic manager in the beginning
- * of new period.
- *
- * @param[in] scheduler The scheduler instance.
- * @param[in] the_thread is the owner of the job.
- * @param[in] deadline of the new job from now. If equal to 0,
- * the job was cancelled or deleted, thus a running task
- * has to be suspended.
- */
-void _Scheduler_EDF_Release_job(
+Thread_Control *_Scheduler_EDF_Release_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
uint64_t deadline
);
-void _Scheduler_EDF_Cancel_job(
+Thread_Control *_Scheduler_EDF_Cancel_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
);
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 91fa178d20..1c5a697619 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -496,29 +496,37 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_destroy(
*
* @param[in] the_thread The thread.
* @param[in] deadline The deadline in watchdog ticks since boot.
+ *
+ * @return The thread to hand over to _Thread_Update_priority().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Release_job(
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Release_job(
Thread_Control *the_thread,
uint64_t deadline
)
{
const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
- ( *scheduler->Operations.release_job )( scheduler, the_thread, deadline );
+ return ( *scheduler->Operations.release_job )(
+ scheduler,
+ the_thread,
+ deadline
+ );
}
/**
* @brief Cancels a job of a thread with respect to the scheduler.
*
* @param[in] the_thread The thread.
+ *
+ * @return The thread to hand over to _Thread_Update_priority().
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Cancel_job(
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Cancel_job(
Thread_Control *the_thread
)
{
const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
- ( *scheduler->Operations.cancel_job )( scheduler, the_thread );
+ return ( *scheduler->Operations.cancel_job )( scheduler, the_thread );
}
/**
diff --git a/cpukit/score/src/schedulercbsreleasejob.c b/cpukit/score/src/schedulercbsreleasejob.c
index 124c02bac0..d2169af899 100644
--- a/cpukit/score/src/schedulercbsreleasejob.c
+++ b/cpukit/score/src/schedulercbsreleasejob.c
@@ -21,7 +21,7 @@
#include <rtems/score/schedulercbsimpl.h>
-void _Scheduler_CBS_Release_job(
+Thread_Control *_Scheduler_CBS_Release_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
uint64_t deadline
@@ -30,8 +30,6 @@ void _Scheduler_CBS_Release_job(
Scheduler_CBS_Node *node;
Scheduler_CBS_Server *serv_info;
- _Scheduler_EDF_Release_job( scheduler, the_thread, deadline );
-
node = _Scheduler_CBS_Thread_get_node( the_thread );
serv_info = node->cbs_server;
@@ -39,4 +37,6 @@ void _Scheduler_CBS_Release_job(
if ( serv_info != NULL ) {
the_thread->cpu_time_budget = serv_info->parameters.budget;
}
+
+ return _Scheduler_EDF_Release_job( scheduler, the_thread, deadline );
}
diff --git a/cpukit/score/src/schedulerdefaultreleasejob.c b/cpukit/score/src/schedulerdefaultreleasejob.c
index 439f6b2649..7272fc1946 100644
--- a/cpukit/score/src/schedulerdefaultreleasejob.c
+++ b/cpukit/score/src/schedulerdefaultreleasejob.c
@@ -21,7 +21,7 @@
#include <rtems/score/scheduler.h>
-void _Scheduler_default_Release_job(
+Thread_Control *_Scheduler_default_Release_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
uint64_t deadline
@@ -30,13 +30,17 @@ void _Scheduler_default_Release_job(
(void) scheduler;
(void) the_thread;
(void) deadline;
+
+ return NULL;
}
-void _Scheduler_default_Cancel_job(
+Thread_Control *_Scheduler_default_Cancel_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
)
{
(void) scheduler;
(void) the_thread;
+
+ return NULL;
}
diff --git a/cpukit/score/src/scheduleredfreleasejob.c b/cpukit/score/src/scheduleredfreleasejob.c
index c10943499a..0fbf0f0f61 100644
--- a/cpukit/score/src/scheduleredfreleasejob.c
+++ b/cpukit/score/src/scheduleredfreleasejob.c
@@ -42,13 +42,13 @@ static bool _Scheduler_EDF_Release_job_filter(
|| !_Thread_Owns_resources( the_thread );
}
-void _Scheduler_EDF_Release_job(
+Thread_Control *_Scheduler_EDF_Release_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
uint64_t deadline
)
{
- _Thread_Change_priority(
+ return _Thread_Apply_priority(
the_thread,
deadline,
NULL,
@@ -79,12 +79,12 @@ static bool _Scheduler_EDF_Cancel_job_filter(
|| !_Thread_Owns_resources( the_thread );
}
-void _Scheduler_EDF_Cancel_job(
+Thread_Control *_Scheduler_EDF_Cancel_job(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
)
{
- _Thread_Change_priority(
+ return _Thread_Apply_priority(
the_thread,
0,
NULL,