Changeset 477259c in rtems


Ignore:
Timestamp:
Jun 12, 2013, 3:06:51 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
1ccb64e1
Parents:
edde99b
git-author:
Sebastian Huber <sebastian.huber@…> (06/12/13 15:06:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/13 14:26:07)
Message:

score: Simplify _Thread_Create_idle()

File:
1 edited

Legend:

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

    redde99b r477259c  
    2626#include <rtems/score/object.h>
    2727#include <rtems/score/priority.h>
     28#include <rtems/score/smp.h>
    2829#include <rtems/score/states.h>
    2930#include <rtems/score/sysstate.h>
     
    3233#include <rtems/score/wkspace.h>
    3334#include <rtems/config.h>
    34 #if defined(RTEMS_SMP)
    35   #include <rtems/score/smp.h>
    36 #endif
    3735
    38 static inline void _Thread_Create_idle_helper(
    39   uint32_t name_u32,
    40   int      cpu
    41 )
     36static void _Thread_Create_idle_for_cpu( Per_CPU_Control *per_cpu )
    4237{
    43   Per_CPU_Control *per_cpu;
    44   Objects_Name     name;
    45   Thread_Control  *idle;
     38  Objects_Name    name;
     39  Thread_Control *idle;
    4640
    47   per_cpu = &_Per_CPU_Information[ cpu ];
    48   name.name_u32 = name_u32;
     41  name.name_u32 = _Objects_Build_name( 'I', 'D', 'L', 'E' );
    4942
    5043  /*
     
    8780void _Thread_Create_idle( void )
    8881{
    89   #if defined(RTEMS_SMP)
    90     int cpu;
     82  uint32_t processor_count = _SMP_Get_processor_count();
     83  uint32_t processor;
    9184
    92     for ( cpu=0 ; cpu < _SMP_Get_processor_count() ; cpu++ ) {
    93       _Thread_Create_idle_helper(
    94         _Objects_Build_name( 'I', 'D', 'L', 'E' ),
    95         cpu
    96       );
    97     }
    98   #else
    99     _Thread_Create_idle_helper(_Objects_Build_name( 'I', 'D', 'L', 'E' ), 0);
    100   #endif
     85  for ( processor = 0 ; processor < processor_count ; ++processor ) {
     86    Per_CPU_Control *per_cpu = &_Per_CPU_Information[ processor ];
     87
     88    _Thread_Create_idle_for_cpu( per_cpu );
     89  }
    10190}
Note: See TracChangeset for help on using the changeset viewer.