#3497 closed defect (fixed)

Remove superfluous interrupt enable in _Thread_Dispatch_enable() (cloned)

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 4.11.3
Component: score Version: 4.11
Severity: normal Keywords:
Cc: Blocked By: #3496
Blocking:

Description

Cloned from #3496:


The _Thread_Dispatch_enable() contains a superfluous interrupt enable. This bug had probably no effect since the interrupt enable is idempotent on all CPU ports.

RTEMS_INLINE_ROUTINE void _Thread_Dispatch_enable( Per_CPU_Control *cpu_self )
{
  uint32_t disable_level = cpu_self->thread_dispatch_disable_level;

  if ( disable_level == 1 ) {
    ISR_Level level;

    _ISR_Local_disable( level );

    if (
      cpu_self->dispatch_necessary
#if defined(RTEMS_SCORE_ROBUST_THREAD_DISPATCH)
        || !_ISR_Is_enabled( level )
#endif
    ) {
      _Thread_Do_dispatch( cpu_self, level ); <-- This function enabled interrupts
    } else {
      cpu_self->thread_dispatch_disable_level = 0;
      _Profiling_Thread_dispatch_enable( cpu_self, 0 );
    }

    _ISR_Local_enable( level ); <-- Here we enable it again
  } else {
    _Assert( disable_level > 0 );
    cpu_self->thread_dispatch_disable_level = disable_level - 1;
  }
}

Change History (2)

comment:1 Changed on Aug 10, 2018 at 5:09:16 AM by Sebastian Huber

Component: adminscore

comment:2 Changed on Aug 20, 2018 at 6:40:57 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In dc6bd8bb/rtems:

score: Fix ISR enable in _Thread_Dispatch_enable()

This bug had probably no effect since the interrupt enable is idempotent
on all CPU ports.

Close #3497.

Note: See TracTickets for help on using tickets.