[RTEMS Project] #3496: Remove superfluous interrupt enable in _Thread_Dispatch_enable()

RTEMS trac trac at rtems.org
Fri Aug 10 05:08:18 UTC 2018


#3496: Remove superfluous interrupt enable in _Thread_Dispatch_enable()
------------------------------+-----------------------------
  Reporter:  Sebastian Huber  |      Owner:  Sebastian Huber
      Type:  defect           |     Status:  assigned
  Priority:  normal           |  Milestone:  5.1
 Component:  admin            |    Version:  5
  Severity:  normal           |   Keywords:
Blocked By:                   |   Blocking:
------------------------------+-----------------------------
 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;
   }
 }
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3496>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list