Changeset 25f5730f in rtems for cpukit/score/src


Ignore:
Timestamp:
May 28, 2014, 4:11:51 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
606ed52
Parents:
a92c488
git-author:
Sebastian Huber <sebastian.huber@…> (05/28/14 16:11:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/02/14 06:28:42)
Message:

score: _Scheduler_Set_affinity()

Do not change the scheduler with this function. Documentation. Coding
style.

File:
1 edited

Legend:

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

    ra92c488 r25f5730f  
    2727)
    2828{
    29   bool ok;
     29  const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
    3030
    31   if ( _CPU_set_Is_large_enough( cpusetsize ) ) {
    32 #if defined(RTEMS_SMP)
    33     uint32_t cpu_count = _SMP_Get_processor_count();
    34     uint32_t cpu_index;
    35 
    36     ok = false;
    37 
    38     for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
    39       if ( CPU_ISSET_S( (int) cpu_index, cpusetsize, cpuset ) ) {
    40         const Scheduler_Control *scheduler_of_cpu =
    41           _Scheduler_Get_by_CPU_index( cpu_index );
    42 
    43         if ( scheduler_of_cpu != NULL ) {
    44           ok = ( *scheduler_of_cpu->Operations.set_affinity )(
    45             scheduler_of_cpu,
    46             the_thread,
    47             cpusetsize,
    48             cpuset
    49           );
    50         }
    51 
    52         break;
    53       }
    54     }
    55 #else
    56     ok = _Scheduler_default_Set_affinity_body(
    57       _Scheduler_Get( the_thread ),
    58       the_thread,
    59       cpusetsize,
    60       cpuset
    61     );
    62 #endif
    63   } else {
    64     ok = false;
     31  if ( !_CPU_set_Is_large_enough( cpusetsize ) ) {
     32    return false;
    6533  }
    6634
    67   return ok;
     35#if defined(RTEMS_SMP)
     36  return ( *scheduler->Operations.set_affinity )(
     37    scheduler,
     38    the_thread,
     39    cpusetsize,
     40    cpuset
     41  );
     42#else
     43  return _Scheduler_default_Set_affinity_body(
     44    scheduler,
     45    the_thread,
     46    cpusetsize,
     47    cpuset
     48  );
     49#endif
    6850}
    6951
Note: See TracChangeset for help on using the changeset viewer.