Ignore:
Timestamp:
04/22/14 05:46:53 (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
e10574a
Parents:
f17e171
git-author:
Sebastian Huber <sebastian.huber@…> (04/22/14 05:46:53)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/22/14 06:34:45)
Message:

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().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadcreateidle.c

    rf17e171 r3380ee8  
    2424#include <rtems/config.h>
    2525
    26 static void _Thread_Create_idle_for_cpu( Per_CPU_Control *per_cpu )
     26static void _Thread_Create_idle_for_cpu( Per_CPU_Control *cpu )
    2727{
    2828  Objects_Name    name;
     
    4141    &_Thread_Internal_information,
    4242    idle,
    43     _Scheduler_Get_by_CPU( per_cpu ),
     43    _Scheduler_Get_by_CPU( cpu ),
    4444    NULL,        /* allocate the stack */
    4545    _Stack_Ensure_minimum( rtems_configuration_get_idle_task_stack_size() ),
     
    5757   *             MUST be done before _Thread_Start is invoked.
    5858   */
    59   per_cpu->heir      =
    60   per_cpu->executing = idle;
     59  cpu->heir      =
     60  cpu->executing = idle;
    6161
    6262  _Thread_Start(
     
    6666    NULL,
    6767    0,
    68     per_cpu
     68    cpu
    6969  );
    7070}
     
    7272void _Thread_Create_idle( void )
    7373{
    74   uint32_t processor_count = _SMP_Get_processor_count();
    75   uint32_t processor;
     74  uint32_t cpu_count = _SMP_Get_processor_count();
     75  uint32_t cpu_index;
    7676
    77   for ( processor = 0 ; processor < processor_count ; ++processor ) {
    78     Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( processor );
     77  for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     78    Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
    7979
    80     if ( _Per_CPU_Is_processor_started( per_cpu ) ) {
    81       _Thread_Create_idle_for_cpu( per_cpu );
     80    if ( _Per_CPU_Is_processor_started( cpu ) ) {
     81      _Thread_Create_idle_for_cpu( cpu );
    8282    }
    8383  }
Note: See TracChangeset for help on using the changeset viewer.