diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-22 07:46:53 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-22 08:34:45 +0200 |
commit | 3380ee8194ec35506b88257f369e88d1d26350f1 (patch) | |
tree | f2b84dc6ddc0d66e044b012bde6cb036828d5bf6 /cpukit/score/src/threadcreateidle.c | |
parent | score: Fix warning (diff) | |
download | rtems-3380ee8194ec35506b88257f369e88d1d26350f1.tar.bz2 |
score: Use common names for per-CPU variables
Use "cpu" for an arbitrary Per_CPU_Control variable.
Use "cpu_self" for the Per_CPU_Control of the current processor.
Use "cpu_index" for an arbitrary processor index.
Use "cpu_index_self" for the processor index of the current processor.
Use "cpu_count" for the processor count obtained via
_SMP_Get_processor_count().
Use "cpu_max" for the processor maximum obtained by
rtems_configuration_get_maximum_processors().
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/threadcreateidle.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c index 2a242658a5..8a5812f1a5 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -23,7 +23,7 @@ #include <rtems/score/stackimpl.h> #include <rtems/config.h> -static void _Thread_Create_idle_for_cpu( Per_CPU_Control *per_cpu ) +static void _Thread_Create_idle_for_cpu( Per_CPU_Control *cpu ) { Objects_Name name; Thread_Control *idle; @@ -40,7 +40,7 @@ static void _Thread_Create_idle_for_cpu( Per_CPU_Control *per_cpu ) _Thread_Initialize( &_Thread_Internal_information, idle, - _Scheduler_Get_by_CPU( per_cpu ), + _Scheduler_Get_by_CPU( cpu ), NULL, /* allocate the stack */ _Stack_Ensure_minimum( rtems_configuration_get_idle_task_stack_size() ), CPU_IDLE_TASK_IS_FP, @@ -56,8 +56,8 @@ static void _Thread_Create_idle_for_cpu( Per_CPU_Control *per_cpu ) * WARNING!!! This is necessary to "kick" start the system and * MUST be done before _Thread_Start is invoked. */ - per_cpu->heir = - per_cpu->executing = idle; + cpu->heir = + cpu->executing = idle; _Thread_Start( idle, @@ -65,20 +65,20 @@ static void _Thread_Create_idle_for_cpu( Per_CPU_Control *per_cpu ) rtems_configuration_get_idle_task(), NULL, 0, - per_cpu + cpu ); } void _Thread_Create_idle( void ) { - uint32_t processor_count = _SMP_Get_processor_count(); - uint32_t processor; + uint32_t cpu_count = _SMP_Get_processor_count(); + uint32_t cpu_index; - for ( processor = 0 ; processor < processor_count ; ++processor ) { - Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( processor ); + for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) { + Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index ); - if ( _Per_CPU_Is_processor_started( per_cpu ) ) { - _Thread_Create_idle_for_cpu( per_cpu ); + if ( _Per_CPU_Is_processor_started( cpu ) ) { + _Thread_Create_idle_for_cpu( cpu ); } } } |