summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-03 15:58:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-04 09:47:11 +0200
commit4d1f5008dbce6567e9501de8b7623b245c9f8283 (patch)
treeefea6ce1b08f4c813e000307c7419aff1dc92e03 /cpukit/score/include/rtems/score
parentscore: Replace _Scheduler_Allocate/Free() (diff)
downloadrtems-4d1f5008dbce6567e9501de8b7623b245c9f8283.tar.bz2
score: Rename _Scheduler_Update()
Rename _Scheduler_Update() to _Scheduler_Update_priority(). Add parameter for the new thread priority to avoid direct usage of Thread_Control::current_priority in the scheduler operation.
Diffstat (limited to '')
-rw-r--r--cpukit/score/include/rtems/score/scheduler.h14
-rw-r--r--cpukit/score/include/rtems/score/schedulercbs.h2
-rw-r--r--cpukit/score/include/rtems/score/scheduleredf.h7
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h22
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriority.h15
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h2
-rw-r--r--cpukit/score/include/rtems/score/schedulerprioritysmp.h7
-rw-r--r--cpukit/score/include/rtems/score/schedulersimple.h2
-rw-r--r--cpukit/score/include/rtems/score/schedulersimplesmp.h2
9 files changed, 44 insertions, 29 deletions
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index 7ca2133460..542e4aea46 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -77,8 +77,12 @@ typedef struct {
/** @see _Scheduler_Node_destroy() */
void ( *node_destroy )( const Scheduler_Control *, Thread_Control * );
- /** @see _Scheduler_Update() */
- void ( *update )( const Scheduler_Control *, Thread_Control * );
+ /** @see _Scheduler_Update_priority() */
+ void ( *update_priority )(
+ const Scheduler_Control *,
+ Thread_Control *,
+ Priority_Control
+ );
/** @see _Scheduler_Priority_compare() */
int ( *priority_compare )(
@@ -277,10 +281,12 @@ void _Scheduler_default_Node_destroy(
*
* @param[in] scheduler Unused.
* @param[in] the_thread Unused.
+ * @param[in] new_priority Unused.
*/
-void _Scheduler_default_Update(
+void _Scheduler_default_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Priority_Control new_priority
);
/**
diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h
index 23e528da66..473d6fec6f 100644
--- a/cpukit/score/include/rtems/score/schedulercbs.h
+++ b/cpukit/score/include/rtems/score/schedulercbs.h
@@ -55,7 +55,7 @@ extern "C" {
_Scheduler_EDF_Change_priority, /* change priority entry point */ \
_Scheduler_CBS_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
- _Scheduler_EDF_Update, /* update entry point */ \
+ _Scheduler_EDF_Update_priority, /* update priority entry point */ \
_Scheduler_EDF_Priority_compare, /* compares two priorities */ \
_Scheduler_CBS_Release_job, /* new period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h
index a7ed88db39..7a20b5b031 100644
--- a/cpukit/score/include/rtems/score/scheduleredf.h
+++ b/cpukit/score/include/rtems/score/scheduleredf.h
@@ -48,7 +48,7 @@ extern "C" {
_Scheduler_EDF_Change_priority, /* change priority entry point */ \
_Scheduler_EDF_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
- _Scheduler_EDF_Update, /* update entry point */ \
+ _Scheduler_EDF_Update_priority, /* update priority entry point */ \
_Scheduler_EDF_Priority_compare, /* compares two priorities */ \
_Scheduler_EDF_Release_job, /* new period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
@@ -161,9 +161,10 @@ void _Scheduler_EDF_Node_initialize(
* @param[in] the_thread will have its scheduler specific information
* structure updated.
*/
-void _Scheduler_EDF_Update(
+void _Scheduler_EDF_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Priority_Control new_priority
);
/**
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 5e7c928686..e469214fa7 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -209,16 +209,22 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_destroy(
}
/**
- * @brief Scheduler update.
+ * @brief Updates the scheduler about a priority change of a not ready thread.
*
- * This routine updates @a the_thread->scheduler
+ * @param[in] the_thread The thread.
+ * @param[in] new_priority The new priority of the thread.
*/
-RTEMS_INLINE_ROUTINE void _Scheduler_Update(
+RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Priority_Control new_priority
)
{
- ( *scheduler->Operations.update )( scheduler, the_thread );
+ ( *scheduler->Operations.update_priority )(
+ scheduler,
+ the_thread,
+ new_priority
+ );
}
/**
@@ -367,7 +373,11 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Set(
_Scheduler_Node_destroy( current_scheduler, the_thread );
the_thread->scheduler = scheduler;
_Scheduler_Node_initialize( scheduler, the_thread );
- _Scheduler_Update( scheduler, the_thread );
+ _Scheduler_Update_priority(
+ scheduler,
+ the_thread,
+ the_thread->current_priority
+ );
_Thread_Clear_state( the_thread, STATES_MIGRATING );
}
#else
diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h
index 3f18f54c09..2e4f3abfc3 100644
--- a/cpukit/score/include/rtems/score/schedulerpriority.h
+++ b/cpukit/score/include/rtems/score/schedulerpriority.h
@@ -55,7 +55,7 @@ extern "C" {
_Scheduler_priority_Change_priority, /* change priority entry point */ \
_Scheduler_default_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
- _Scheduler_priority_Update, /* update entry point */ \
+ _Scheduler_priority_Update_priority, /* update priority entry point */ \
_Scheduler_priority_Priority_compare, /* compares two priorities */ \
_Scheduler_default_Release_job, /* new period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
@@ -139,16 +139,13 @@ void _Scheduler_priority_Schedule(
);
/**
- * @brief Update the scheduler priority.
- * This routine updates @a the_thread->scheduler based on @a the_scheduler
- * structures and thread state.
- *
- * @param[in] the_thread will have its scheduler specific information
- * structure updated.
+ * @brief Updates the scheduler node to reflect the new priority of the
+ * thread.
*/
-void _Scheduler_priority_Update(
+void _Scheduler_priority_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ Priority_Control new_priority
);
/**
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
index ab35704a5e..0ba8191e44 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -57,7 +57,7 @@ extern "C" {
_Scheduler_priority_SMP_Change_priority, \
_Scheduler_priority_affinity_SMP_Node_initialize, \
_Scheduler_default_Node_destroy, \
- _Scheduler_priority_SMP_Update, \
+ _Scheduler_priority_SMP_Update_priority, \
_Scheduler_priority_Priority_compare, \
_Scheduler_default_Release_job, \
_Scheduler_default_Tick, \
diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
index c17fcf4a05..cbb8a588ea 100644
--- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
@@ -86,7 +86,7 @@ typedef struct {
_Scheduler_priority_SMP_Change_priority, \
_Scheduler_priority_SMP_Node_initialize, \
_Scheduler_default_Node_destroy, \
- _Scheduler_priority_SMP_Update, \
+ _Scheduler_priority_SMP_Update_priority, \
_Scheduler_priority_Priority_compare, \
_Scheduler_default_Release_job, \
_Scheduler_default_Tick, \
@@ -119,9 +119,10 @@ void _Scheduler_priority_SMP_Change_priority(
bool prepend_it
);
-void _Scheduler_priority_SMP_Update(
+void _Scheduler_priority_SMP_Update_priority(
const Scheduler_Control *scheduler,
- Thread_Control *thread
+ Thread_Control *thread,
+ Priority_Control new_priority
);
void _Scheduler_priority_SMP_Yield(
diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h
index 9fc2d31f15..68ed527648 100644
--- a/cpukit/score/include/rtems/score/schedulersimple.h
+++ b/cpukit/score/include/rtems/score/schedulersimple.h
@@ -45,7 +45,7 @@ extern "C" {
_Scheduler_simple_Change_priority, /* change priority entry point */ \
_Scheduler_default_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
- _Scheduler_default_Update, /* update entry point */ \
+ _Scheduler_default_Update_priority, /* update priority entry point */ \
_Scheduler_priority_Priority_compare, /* compares two priorities */ \
_Scheduler_default_Release_job, /* new period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h
index 6ab1dd2894..c0195e0bab 100644
--- a/cpukit/score/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h
@@ -67,7 +67,7 @@ typedef struct {
_Scheduler_simple_SMP_Change_priority, \
_Scheduler_simple_SMP_Node_initialize, \
_Scheduler_default_Node_destroy, \
- _Scheduler_default_Update, \
+ _Scheduler_default_Update_priority, \
_Scheduler_priority_Priority_compare, \
_Scheduler_default_Release_job, \
_Scheduler_default_Tick, \