#3496 closed defect (fixed)

Remove superfluous interrupt enable in _Thread_Dispatch_enable()

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: score Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking: #3497

Description

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 (3)

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

Blocking: 3497 added

comment:2 Changed on Aug 10, 2018 at 5:09:33 AM by Sebastian Huber

Component: adminscore

comment:3 Changed on Aug 20, 2018 at 6:37:24 AM by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In d14f934/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 #3496.

Note: See TracTickets for help on using tickets.