Changeset ad87de4 in rtems


Ignore:
Timestamp:
Apr 11, 2019, 6:54:29 AM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
5ca8190b
Parents:
cfcd6dc9
git-author:
Sebastian Huber <sebastian.huber@…> (04/11/19 06:54:29)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/11/19 07:19:12)
Message:

score: Rename _SMP_Get_processor_count()

Rename _SMP_Get_processor_count() in _SMP_Get_processor_maximum() to be
in line with the API level rtems_scheduler_get_processor_maximum().

Update #3732.

Files:
13 edited

Legend:

Unmodified
Added
Removed
  • bsps/powerpc/qoriq/start/bsprestart.c

    rcfcd6dc9 rad87de4  
    6868
    6969  _SMP_barrier_State_initialize(&bs);
    70   _SMP_barrier_Wait(&restart_barrier, &bs, _SMP_Get_processor_count());
     70  _SMP_barrier_Wait(&restart_barrier, &bs, _SMP_Get_processor_maximum());
    7171
    7272  cpu_self_index = rtems_scheduler_get_processor();
  • bsps/riscv/riscv/irq/irq.c

    rcfcd6dc9 rad87de4  
    248248      enable[group] |= bit;
    249249    } else {
     250      uint32_t cpu_max;
    250251      uint32_t cpu_index;
    251       uint32_t cpu_count;
    252 
    253       cpu_count = _SMP_Get_processor_count();
    254 
    255       for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
     252
     253      cpu_max = _SMP_Get_processor_maximum();
     254
     255      for (cpu_index = 0; cpu_index < cpu_max; ++cpu_index) {
    256256        Per_CPU_Control *cpu;
    257257
     
    290290      enable[group] &= ~bit;
    291291    } else {
     292      uint32_t cpu_max;
    292293      uint32_t cpu_index;
    293       uint32_t cpu_count;
    294 
    295       cpu_count = _SMP_Get_processor_count();
    296 
    297       for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
     294
     295      cpu_max = _SMP_Get_processor_maximum();
     296
     297      for (cpu_index = 0; cpu_index < cpu_max; ++cpu_index) {
    298298        Per_CPU_Control *cpu;
    299299
     
    358358
    359359    if (enable != NULL) {
     360      uint32_t cpu_max;
    360361      uint32_t cpu_index;
    361       uint32_t cpu_count;
    362 
    363       cpu_count = _SMP_Get_processor_count();
    364 
    365       for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
     362
     363      cpu_max = _SMP_Get_processor_maximum();
     364
     365      for (cpu_index = 0; cpu_index < cpu_max; ++cpu_index) {
    366366        Per_CPU_Control *cpu;
    367367
  • bsps/shared/dev/clock/clockimpl.h

    rcfcd6dc9 rad87de4  
    8080  rtems_clock_tick();
    8181#elif defined(RTEMS_SMP) && defined(CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR)
    82   uint32_t cpu_count = _SMP_Get_processor_count();
     82  uint32_t cpu_max;
    8383  uint32_t cpu_index;
    8484
    85   for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     85  cpu_max = _SMP_Get_processor_maximum();
     86
     87  for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
    8688    Per_CPU_Control *cpu;
    8789
  • cpukit/include/rtems/score/percpu.h

    rcfcd6dc9 rad87de4  
    598598#define _Per_CPU_Acquire_all( isr_cookie ) \
    599599  do { \
    600     uint32_t ncpus = _SMP_Get_processor_count(); \
     600    uint32_t ncpus = _SMP_Get_processor_maximum(); \
    601601    uint32_t cpu; \
    602602    _ISR_Local_disable( isr_cookie ); \
     
    613613#define _Per_CPU_Release_all( isr_cookie ) \
    614614  do { \
    615     uint32_t ncpus = _SMP_Get_processor_count(); \
     615    uint32_t ncpus = _SMP_Get_processor_maximum(); \
    616616    uint32_t cpu; \
    617617    for ( cpu = 0 ; cpu < ncpus ; ++cpu ) { \
  • cpukit/include/rtems/score/smp.h

    rcfcd6dc9 rad87de4  
    3838  extern uint32_t _SMP_Processor_maximum;
    3939
    40   static inline uint32_t _SMP_Get_processor_count( void )
     40  static inline uint32_t _SMP_Get_processor_maximum( void )
    4141  {
    4242    return _SMP_Processor_maximum;
    4343  }
    4444#else
    45   #define _SMP_Get_processor_count() UINT32_C(1)
     45  #define _SMP_Get_processor_maximum() UINT32_C(1)
    4646#endif
    4747
  • cpukit/rtems/src/getprocessorcount.c

    rcfcd6dc9 rad87de4  
    2222uint32_t rtems_scheduler_get_processor_maximum(void)
    2323{
    24   return _SMP_Get_processor_count();
     24  return _SMP_Get_processor_maximum();
    2525}
  • cpukit/rtems/src/scheduleridentbyprocessor.c

    rcfcd6dc9 rad87de4  
    3232  }
    3333
    34   if ( cpu_index >= _SMP_Get_processor_count() ) {
     34  if ( cpu_index >= _SMP_Get_processor_maximum() ) {
    3535    return RTEMS_INVALID_NAME;
    3636  }
  • cpukit/score/src/coretodset.c

    rcfcd6dc9 rad87de4  
    3030  struct bintime  tod_as_bintime;
    3131  uint64_t        tod_as_ticks;
    32   uint32_t        cpu_count;
     32  uint32_t        cpu_max;
    3333  uint32_t        cpu_index;
    3434
     
    3939
    4040  tod_as_ticks = _Watchdog_Ticks_from_timespec( tod );
    41   cpu_count = _SMP_Get_processor_count();
     41  cpu_max = _SMP_Get_processor_maximum();
    4242
    43   for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     43  for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
    4444    Per_CPU_Control  *cpu;
    4545    Watchdog_Header  *header;
  • cpukit/score/src/schedulerdefaultpinunpin.c

    rcfcd6dc9 rad87de4  
    2727  (void) cpu;
    2828
    29   if ( _SMP_Get_processor_count() > 1 ) {
     29  if ( _SMP_Get_processor_maximum() > 1 ) {
    3030    _Terminate(
    3131      RTEMS_FATAL_SOURCE_SMP,
  • cpukit/score/src/smp.c

    rcfcd6dc9 rad87de4  
    5454}
    5555
    56 static void _SMP_Start_processors( uint32_t cpu_count )
     56static void _SMP_Start_processors( uint32_t cpu_max )
    5757{
    5858  uint32_t cpu_index_self;
     
    6161  cpu_index_self = _SMP_Get_current_processor();
    6262
    63   for ( cpu_index = 0 ; cpu_index < cpu_count; ++cpu_index ) {
     63  for ( cpu_index = 0 ; cpu_index < cpu_max; ++cpu_index ) {
    6464    const Scheduler_Assignment *assignment;
    6565    Per_CPU_Control            *cpu;
     
    108108void _SMP_Handler_initialize( void )
    109109{
    110   uint32_t cpu_max = rtems_configuration_get_maximum_processors();
    111   uint32_t cpu_count;
    112   uint32_t cpu_index;
    113 
    114   for ( cpu_index = 0 ; cpu_index < cpu_max; ++cpu_index ) {
     110  uint32_t cpu_config_max;
     111  uint32_t cpu_max;
     112  uint32_t cpu_index;
     113
     114  cpu_config_max = rtems_configuration_get_maximum_processors();
     115
     116  for ( cpu_index = 0 ; cpu_index < cpu_config_max; ++cpu_index ) {
    115117    Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
    116118
     
    125127   */
    126128
    127   cpu_count = _CPU_SMP_Initialize();
    128   cpu_count = cpu_count < cpu_max ? cpu_count : cpu_max;
    129   _SMP_Processor_maximum = cpu_count;
    130 
    131   for ( cpu_index = cpu_count ; cpu_index < cpu_max; ++cpu_index ) {
     129  cpu_max = _CPU_SMP_Initialize();
     130  cpu_max = cpu_max < cpu_config_max ? cpu_max : cpu_config_max;
     131  _SMP_Processor_maximum = cpu_max;
     132
     133  for ( cpu_index = cpu_max ; cpu_index < cpu_config_max; ++cpu_index ) {
    132134    const Scheduler_Assignment *assignment;
    133135
     
    139141  }
    140142
    141   _SMP_Start_processors( cpu_count );
    142 
    143   _CPU_SMP_Finalize_initialization( cpu_count );
     143  _SMP_Start_processors( cpu_max );
     144
     145  _CPU_SMP_Finalize_initialization( cpu_max );
    144146}
    145147
     
    147149{
    148150  Per_CPU_Control *cpu_self;
    149   uint32_t         cpu_count;
     151  uint32_t         cpu_max;
    150152  uint32_t         cpu_index;
    151153
     
    153155  _Per_CPU_State_change( cpu_self, PER_CPU_STATE_READY_TO_START_MULTITASKING );
    154156
    155   cpu_count = _SMP_Get_processor_count();
    156 
    157   for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     157  cpu_max = _SMP_Get_processor_maximum();
     158
     159  for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
    158160    Per_CPU_Control *cpu;
    159161
     
    216218void _SMP_Send_message_broadcast( unsigned long message )
    217219{
    218   uint32_t cpu_count = _SMP_Get_processor_count();
    219   uint32_t cpu_index_self = _SMP_Get_current_processor();
     220  uint32_t cpu_max;
     221  uint32_t cpu_index_self;
    220222  uint32_t cpu_index;
    221223
    222224  _Assert( _Debug_Is_thread_dispatching_allowed() );
    223 
    224   for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     225  cpu_max = _SMP_Get_processor_maximum();
     226  cpu_index_self = _SMP_Get_current_processor();
     227
     228  for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
    225229    if (
    226230      cpu_index != cpu_index_self
     
    237241)
    238242{
    239   uint32_t cpu_count = _SMP_Get_processor_count();
    240   uint32_t cpu_index;
    241 
    242   for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     243  uint32_t cpu_max;
     244  uint32_t cpu_index;
     245
     246  cpu_max = _SMP_Get_processor_maximum();
     247
     248  for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
    243249    if ( _Processor_mask_Is_set( targets, cpu_index ) ) {
    244250      _SMP_Send_message( cpu_index, message );
     
    252258)
    253259{
    254   bool done = true;
    255   uint32_t cpu_count = _SMP_Get_processor_count();
    256   uint32_t cpu_index;
    257 
    258   for ( cpu_index = 0 ; done && cpu_index < cpu_count ; ++cpu_index ) {
     260  bool     done;
     261  uint32_t cpu_max;
     262  uint32_t cpu_index;
     263
     264  done = true;
     265  cpu_max = _SMP_Get_processor_maximum();
     266
     267  for ( cpu_index = 0 ; done && cpu_index < cpu_max ; ++cpu_index ) {
    259268    Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
    260269
  • cpukit/score/src/smpmulticastaction.c

    rcfcd6dc9 rad87de4  
    111111    _Processor_mask_Zero( &targets );
    112112
    113     for ( i = 0; i < _SMP_Get_processor_count(); ++i ) {
     113    for ( i = 0; i < _SMP_Get_processor_maximum(); ++i ) {
    114114      if ( CPU_ISSET_S( i, setsize, cpus ) ) {
    115115        _Processor_mask_Set( &targets, i );
  • cpukit/score/src/threadcreateidle.c

    rcfcd6dc9 rad87de4  
    8686void _Thread_Create_idle( void )
    8787{
    88   uint32_t cpu_count = _SMP_Get_processor_count();
     88  uint32_t cpu_max;
    8989  uint32_t cpu_index;
    9090
    9191  _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
     92  cpu_max = _SMP_Get_processor_maximum();
    9293
    93   for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     94  for ( cpu_index = 0 ; cpu_index < cpu_max ; ++cpu_index ) {
    9495    Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
    9596
  • testsuites/sptests/spsize/size.c

    rcfcd6dc9 rad87de4  
    323323#endif
    324324
    325 /*percpu.h*/    (_SMP_Get_processor_count() * sizeof(Per_CPU_Control))  +
     325/*percpu.h*/    (_SMP_Get_processor_maximum() * sizeof(Per_CPU_Control))  +
    326326
    327327/*ratemonimpl.h*/ (sizeof _Rate_monotonic_Information)    +
Note: See TracChangeset for help on using the changeset viewer.