forked from Imagelibrary/rtems
score: Improve variable names in thread init
This commit is contained in:
@@ -101,17 +101,17 @@ static void _Thread_Initialize_scheduler_and_wait_nodes(
|
|||||||
const Thread_Configuration *config
|
const Thread_Configuration *config
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Scheduler_Node *scheduler_node;
|
Scheduler_Node *home_scheduler_node;
|
||||||
#if defined(RTEMS_SMP)
|
#if defined(RTEMS_SMP)
|
||||||
Scheduler_Node *scheduler_node_for_index;
|
Scheduler_Node *scheduler_node;
|
||||||
const Scheduler_Control *scheduler_for_index;
|
const Scheduler_Control *scheduler;
|
||||||
size_t scheduler_index;
|
size_t scheduler_index;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(RTEMS_SMP)
|
#if defined(RTEMS_SMP)
|
||||||
scheduler_node = NULL;
|
home_scheduler_node = NULL;
|
||||||
scheduler_node_for_index = the_thread->Scheduler.nodes;
|
scheduler_node = the_thread->Scheduler.nodes;
|
||||||
scheduler_for_index = &_Scheduler_Table[ 0 ];
|
scheduler = &_Scheduler_Table[ 0 ];
|
||||||
scheduler_index = 0;
|
scheduler_index = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -121,27 +121,27 @@ static void _Thread_Initialize_scheduler_and_wait_nodes(
|
|||||||
* configured.
|
* configured.
|
||||||
*/
|
*/
|
||||||
while ( scheduler_index < _Scheduler_Count ) {
|
while ( scheduler_index < _Scheduler_Count ) {
|
||||||
Priority_Control priority_for_index;
|
Priority_Control priority;
|
||||||
|
|
||||||
if ( scheduler_for_index == config->scheduler ) {
|
if ( scheduler == config->scheduler ) {
|
||||||
priority_for_index = config->priority;
|
priority = config->priority;
|
||||||
scheduler_node = scheduler_node_for_index;
|
home_scheduler_node = scheduler_node;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Use the idle thread priority for the non-home scheduler instances by
|
* Use the idle thread priority for the non-home scheduler instances by
|
||||||
* default.
|
* default.
|
||||||
*/
|
*/
|
||||||
priority_for_index = _Scheduler_Map_priority(
|
priority = _Scheduler_Map_priority(
|
||||||
scheduler_for_index,
|
scheduler,
|
||||||
scheduler_for_index->maximum_priority
|
scheduler->maximum_priority
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_Scheduler_Node_initialize(
|
_Scheduler_Node_initialize(
|
||||||
scheduler_for_index,
|
scheduler,
|
||||||
scheduler_node_for_index,
|
scheduler_node,
|
||||||
the_thread,
|
the_thread,
|
||||||
priority_for_index
|
priority
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -149,9 +149,9 @@ static void _Thread_Initialize_scheduler_and_wait_nodes(
|
|||||||
* configuration, the _Scheduler_Node_size constant is used to get the next
|
* configuration, the _Scheduler_Node_size constant is used to get the next
|
||||||
* scheduler node. Using sizeof( Scheduler_Node ) would be wrong.
|
* scheduler node. Using sizeof( Scheduler_Node ) would be wrong.
|
||||||
*/
|
*/
|
||||||
scheduler_node_for_index = (Scheduler_Node *)
|
scheduler_node = (Scheduler_Node *)
|
||||||
( (uintptr_t) scheduler_node_for_index + _Scheduler_Node_size );
|
( (uintptr_t) scheduler_node + _Scheduler_Node_size );
|
||||||
++scheduler_for_index;
|
++scheduler;
|
||||||
++scheduler_index;
|
++scheduler_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,23 +159,23 @@ static void _Thread_Initialize_scheduler_and_wait_nodes(
|
|||||||
* The thread is initialized to use exactly one scheduler node which is
|
* The thread is initialized to use exactly one scheduler node which is
|
||||||
* provided by its home scheduler.
|
* provided by its home scheduler.
|
||||||
*/
|
*/
|
||||||
_Assert( scheduler_node != NULL );
|
_Assert( home_scheduler_node != NULL );
|
||||||
_Chain_Initialize_one(
|
_Chain_Initialize_one(
|
||||||
&the_thread->Scheduler.Wait_nodes,
|
&the_thread->Scheduler.Wait_nodes,
|
||||||
&scheduler_node->Thread.Wait_node
|
&home_scheduler_node->Thread.Wait_node
|
||||||
);
|
);
|
||||||
_Chain_Initialize_one(
|
_Chain_Initialize_one(
|
||||||
&the_thread->Scheduler.Scheduler_nodes,
|
&the_thread->Scheduler.Scheduler_nodes,
|
||||||
&scheduler_node->Thread.Scheduler_node.Chain
|
&home_scheduler_node->Thread.Scheduler_node.Chain
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* In uniprocessor configurations, the thread has exactly one scheduler node.
|
* In uniprocessor configurations, the thread has exactly one scheduler node.
|
||||||
*/
|
*/
|
||||||
scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
|
home_scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
|
||||||
_Scheduler_Node_initialize(
|
_Scheduler_Node_initialize(
|
||||||
config->scheduler,
|
config->scheduler,
|
||||||
scheduler_node,
|
home_scheduler_node,
|
||||||
the_thread,
|
the_thread,
|
||||||
config->priority
|
config->priority
|
||||||
);
|
);
|
||||||
@@ -189,7 +189,7 @@ static void _Thread_Initialize_scheduler_and_wait_nodes(
|
|||||||
*/
|
*/
|
||||||
_Priority_Node_initialize( &the_thread->Real_priority, config->priority );
|
_Priority_Node_initialize( &the_thread->Real_priority, config->priority );
|
||||||
_Priority_Initialize_one(
|
_Priority_Initialize_one(
|
||||||
&scheduler_node->Wait.Priority,
|
&home_scheduler_node->Wait.Priority,
|
||||||
&the_thread->Real_priority
|
&the_thread->Real_priority
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user