Changeset ef9d20f in rtems


Ignore:
Timestamp:
Apr 12, 2019, 9:13:32 AM (2 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
be50969
Parents:
5cc313b
git-author:
Sebastian Huber <sebastian.huber@…> (04/12/19 09:13:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/12/19 09:15:40)
Message:

score: More robust _SMP_Multicast_action()

If the caller already disabled interrupts, then do not disable thread
dispatching. Calling _SMP_Multicast_action() with interrupts disabled
is a questionable use case.

Files:
3 edited

Legend:

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

    r5cc313b ref9d20f  
    219219  uint32_t         cpu_max;
    220220  Per_CPU_Control *cpu_self;
     221  uint32_t         isr_level;
    221222
    222223  cpu_max = _SMP_Get_processor_maximum();
     
    229230  jobs.handler = handler;
    230231  jobs.arg = arg;
    231 
    232   cpu_self = _Thread_Dispatch_disable();
     232  isr_level = _ISR_Get_level();
     233
     234  if ( isr_level == 0 ) {
     235    cpu_self = _Thread_Dispatch_disable();
     236  } else {
     237    cpu_self = _Per_CPU_Get();
     238  }
     239
    233240  _SMP_Issue_action_jobs( targets, &jobs, cpu_max );
    234241  _SMP_Wait_for_action_jobs( targets, &jobs, cpu_max, cpu_self );
    235   _Thread_Dispatch_enable( cpu_self );
    236 }
     242
     243  if ( isr_level == 0 ) {
     244    _Thread_Dispatch_enable( cpu_self );
     245  }
     246}
  • testsuites/smptests/smpcache01/init.c

    r5cc313b ref9d20f  
    127127
    128128  for (i = 0; i < RTEMS_ARRAY_SIZE( test_cases ); ++i) {
    129     Per_CPU_Control *cpu_self;
    130     ISR_Level        isr_level;
    131 
    132     cpu_self = _Thread_Dispatch_disable();
     129    ISR_Level isr_level;
     130
    133131    _ISR_Local_disable( isr_level );
    134132    barrier( bs );
    135133    ( *test_cases[ i ] )();
    136134    _ISR_Local_enable( isr_level );
    137     _Thread_Dispatch_enable( cpu_self );
    138135    barrier( bs );
    139136  }
  • testsuites/smptests/smpmulticast01/init.c

    r5cc313b ref9d20f  
    6060)
    6161{
    62   Per_CPU_Control *cpu_self;
    6362  rtems_interrupt_level level;
    6463
    65   cpu_self = _Thread_Dispatch_disable();
    6664  rtems_interrupt_local_disable(level);
    6765  _SMP_Multicast_action(targets, handler, arg);
    6866  rtems_interrupt_local_enable(level);
    69   _Thread_Dispatch_enable(cpu_self);
    7067}
    7168
Note: See TracChangeset for help on using the changeset viewer.