Ticket #1599: dispatchnecessary.diff

File dispatchnecessary.diff, 23.7 KB (added by Gedare Bloom, on Jul 8, 2010 at 3:48:56 PM)

Replaces _Context_Switch_necessary with _Thread_Dispatch_necessary.

  • c/src/lib/libbsp/mips/shared/irq/exception.S

    RCS file: /usr1/CVS/rtems/c/src/lib/libbsp/mips/shared/irq/exception.S,v
    retrieving revision 1.4
    diff -u -p -r1.4 exception.S
    _ISR_Handler_cleanup: 
    322322   *    restore stack
    323323   *  #endif
    324324   *
    325    *  if ( !_Context_Switch_necessary )
     325   *  if ( !_Thread_Dispatch_necessary )
    326326   *    goto the label "exit interrupt (simple case)"
    327327   */
    328328        lb      t0,DISPATCH_NEEDED
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_hdl.c

    RCS file: /usr1/CVS/rtems/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_hdl.c,v
    retrieving revision 1.9
    diff -u -p -r1.9 ppc_exc_hdl.c
    rtems_status_code ppc_exc_set_handler(un 
    8181void ppc_exc_wrapup(BSP_Exception_frame *frame)
    8282{
    8383  /* dispatch_disable level is decremented from assembly code.  */
    84   if ( _Context_Switch_necessary ) {
     84  if ( _Thread_Dispatch_necessary ) {
    8585    /* FIXME: I believe it should be OK to re-enable
    8686     *        interrupts around the execution of _Thread_Dispatch();
    8787     */
  • c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c

    RCS file: /usr1/CVS/rtems/c/src/lib/libcpu/sh/sh7032/score/cpu_asm.c,v
    retrieving revision 1.16
    diff -u -p -r1.16 cpu_asm.c
    void __ISR_Handler( uint32_t vector) 
    176176    return;
    177177  }
    178178
    179   if ( _Context_Switch_necessary ) {
     179  if ( _Thread_Dispatch_necessary ) {
    180180    _Thread_Dispatch();
    181181  }
    182182}
  • c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c

    RCS file: /usr1/CVS/rtems/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c,v
    retrieving revision 1.18
    diff -u -p -r1.18 cpu_asm.c
    void __ISR_Handler( uint32_t vector) 
    178178    return;
    179179  }
    180180
    181   if ( _Context_Switch_necessary ) {
     181  if ( _Thread_Dispatch_necessary ) {
    182182    _Thread_Dispatch();
    183183  }
    184184}
  • c/src/lib/libcpu/sh/sh7750/score/cpu_asm.c

    RCS file: /usr1/CVS/rtems/c/src/lib/libcpu/sh/sh7750/score/cpu_asm.c,v
    retrieving revision 1.14
    diff -u -p -r1.14 cpu_asm.c
    void __ISR_Handler( uint32_t vector) 
    101101    return;
    102102  }
    103103
    104   if ( _Context_Switch_necessary ) {
     104  if ( _Thread_Dispatch_necessary ) {
    105105    _Thread_Dispatch();
    106106  }
    107107}
  • c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c

    RCS file: /usr1/CVS/rtems/c/src/lib/libcpu/sh/shgdb/score/cpu_asm.c,v
    retrieving revision 1.3
    diff -u -p -r1.3 cpu_asm.c
    void __ISR_Handler( uint32_t vector) 
    7575    return;
    7676  }
    7777
    78   if ( _Context_Switch_necessary ) {
     78  if ( _Thread_Dispatch_necessary ) {
    7979    _Thread_Dispatch();
    8080  }
    8181}
  • cpukit/posix/src/psignalunblockthread.c

    RCS file: /usr1/CVS/rtems/cpukit/posix/src/psignalunblockthread.c,v
    retrieving revision 1.11
    diff -u -p -r1.11 psignalunblockthread.c
    bool _POSIX_signals_Unblock_thread( 
    118118          }
    119119    } else if ( the_thread->current_state == STATES_READY ) {
    120120      if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
    121         _Context_Switch_necessary = true;
     121        _Thread_Dispatch_necessary = true;
    122122    }
    123123  }
    124124  return false;
  • cpukit/posix/src/pthreadkill.c

    RCS file: /usr1/CVS/rtems/cpukit/posix/src/pthreadkill.c,v
    retrieving revision 1.16
    diff -u -p -r1.16 pthreadkill.c
    int pthread_kill( 
    6464        (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
    6565
    6666        if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
    67           _Context_Switch_necessary = true;
     67          _Thread_Dispatch_necessary = true;
    6868      }
    6969      _Thread_Enable_dispatch();
    7070      return 0;
  • cpukit/rtems/src/signalsend.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/signalsend.c,v
    retrieving revision 1.11
    diff -u -p -r1.11 signalsend.c
    rtems_status_code rtems_signal_send( 
    6565          _ASR_Post_signals( signal_set, &asr->signals_posted );
    6666
    6767          if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
    68             _Context_Switch_necessary = true;
     68            _Thread_Dispatch_necessary = true;
    6969        } else {
    7070          _ASR_Post_signals( signal_set, &asr->signals_pending );
    7171        }
  • cpukit/score/cpu/avr/cpu_asm.S

    RCS file: /usr1/CVS/rtems/cpukit/score/cpu/avr/cpu_asm.S,v
    retrieving revision 1.10
    diff -u -p -r1.10 cpu_asm.S
    void _ISR_Handler(void) 
    441441   *  if ( _Thread_Dispatch_disable_level )
    442442   *    goto the label "exit interrupt (simple case)"
    443443   *
    444    *  if ( _Context_Switch_necessary ) {
     444   *  if ( _Thread_Dispatch_necessary ) {
    445445   *    call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
    446446   *    prepare to get out of interrupt
    447447   *    return from interrupt  (maybe to _ISR_Dispatch)
  • cpukit/score/cpu/lm32/irq.c

    RCS file: /usr1/CVS/rtems/cpukit/score/cpu/lm32/irq.c,v
    retrieving revision 1.5
    diff -u -p -r1.5 irq.c
    void __ISR_Handler(uint32_t vector, CPU_ 
    7878  if ( _ISR_Nest_level )
    7979    return;
    8080
    81   if ( _Context_Switch_necessary ) {
     81  if ( _Thread_Dispatch_necessary ) {
    8282
    8383    /* save off our stack frame so the context switcher can get to it */
    8484    _exception_stack_frame = ifr;
  • cpukit/score/cpu/m32c/cpu_asm.c

    RCS file: /usr1/CVS/rtems/cpukit/score/cpu/m32c/cpu_asm.c,v
    retrieving revision 1.6
    diff -u -p -r1.6 cpu_asm.c
    void _ISR_Handler(void) 
    8989   *  if ( _Thread_Dispatch_disable_level )
    9090   *    goto the label "exit interrupt (simple case)"
    9191   *
    92    *  if ( _Context_Switch_necessary ) {
     92   *  if ( _Thread_Dispatch_necessary ) {
    9393   *    call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
    9494   *    prepare to get out of interrupt
    9595   *    return from interrupt  (maybe to _ISR_Dispatch)
  • cpukit/score/cpu/m32r/cpu_asm.c

    RCS file: /usr1/CVS/rtems/cpukit/score/cpu/m32r/cpu_asm.c,v
    retrieving revision 1.4
    diff -u -p -r1.4 cpu_asm.c
    void _ISR_Handler(void) 
    7979   *  if ( _Thread_Dispatch_disable_level )
    8080   *    goto the label "exit interrupt (simple case)"
    8181   *
    82    *  if ( _Context_Switch_necessary ) {
     82   *  if ( _Thread_Dispatch_necessary ) {
    8383   *    call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
    8484   *    prepare to get out of interrupt
    8585   *    return from interrupt  (maybe to _ISR_Dispatch)
  • cpukit/score/cpu/mips/cpu_asm.S

    RCS file: /usr1/CVS/rtems/cpukit/score/cpu/mips/cpu_asm.S,v
    retrieving revision 1.42
    diff -u -p -r1.42 cpu_asm.S
    _ISR_Handler_1: 
    949949   *    restore stack
    950950   *  #endif
    951951   *
    952    *  if !_Context_Switch_necessary
     952   *  if !_Thread_Dispatch_necessary
    953953   *    goto the label "exit interrupt (simple case)"
    954954   */
    955955        lbu     t0,DISPATCH_NEEDED
  • cpukit/score/cpu/nios2/irq.c

    RCS file: /usr1/CVS/rtems/cpukit/score/cpu/nios2/irq.c,v
    retrieving revision 1.6
    diff -u -p -r1.6 irq.c
    void __ISR_Handler(uint32_t vector, CPU_ 
    7171
    7272    if( _Thread_Dispatch_disable_level == 0 )
    7373    {
    74       if ( _Context_Switch_necessary ) {
     74      if ( _Thread_Dispatch_necessary ) {
    7575        _CPU_ISR_Enable( level );
    7676        _Thread_Dispatch();
    7777        /* may have switched to another task and not return here immed. */
  • cpukit/score/cpu/no_cpu/cpu_asm.c

    RCS file: /usr1/CVS/rtems/cpukit/score/cpu/no_cpu/cpu_asm.c,v
    retrieving revision 1.19
    diff -u -p -r1.19 cpu_asm.c
    void _ISR_Handler(void) 
    168168   *  if ( _Thread_Dispatch_disable_level )
    169169   *    goto the label "exit interrupt (simple case)"
    170170   *
    171    *  if ( _Context_Switch_necessary ) {
     171   *  if ( _Thread_Dispatch_necessary ) {
    172172   *    call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
    173173   *    prepare to get out of interrupt
    174174   *    return from interrupt  (maybe to _ISR_Dispatch)
  • cpukit/score/include/rtems/score/percpu.h

    RCS file: /usr1/CVS/rtems/cpukit/score/include/rtems/score/percpu.h,v
    retrieving revision 1.2
    diff -u -p -r1.2 percpu.h
    typedef struct { 
    8383  Thread_Control *idle;
    8484
    8585  /** This is set to true when this CPU needs to run the dispatcher. */
    86   volatile bool dispatch_needed;
     86  volatile bool dispatch_necessary;
    8787
    8888} Per_CPU_Control;
    8989#endif
    extern Per_CPU_Control _Per_CPU_Informat 
    152152 * But on a non-SMP system, these macros are simple references.
    153153 * Thus when built for non-SMP, there should be no performance penalty.
    154154 */
    155 #define _Thread_Heir              _Per_CPU_Information.heir
    156 #define _Thread_Executing         _Per_CPU_Information.executing
    157 #define _Thread_Idle              _Per_CPU_Information.idle
    158 #define _ISR_Nest_level           _Per_CPU_Information.isr_nest_level
    159 #define _CPU_Interrupt_stack_low  _Per_CPU_Information.interrupt_stack_low
    160 #define _CPU_Interrupt_stack_high _Per_CPU_Information.interrupt_stack_high
    161 #define _Context_Switch_necessary _Per_CPU_Information.dispatch_needed
     155#define _Thread_Heir                _Per_CPU_Information.heir
     156#define _Thread_Executing           _Per_CPU_Information.executing
     157#define _Thread_Idle                _Per_CPU_Information.idle
     158#define _ISR_Nest_level             _Per_CPU_Information.isr_nest_level
     159#define _CPU_Interrupt_stack_low    _Per_CPU_Information.interrupt_stack_low
     160#define _CPU_Interrupt_stack_high   _Per_CPU_Information.interrupt_stack_high
     161#define _Thread_Dispatch_necessary  _Per_CPU_Information.dispatch_necessary
    162162
    163163#endif  /* ASM */
    164164
  • cpukit/score/inline/rtems/score/thread.inl

    RCS file: /usr1/CVS/rtems/cpukit/score/inline/rtems/score/thread.inl,v
    retrieving revision 1.40
    diff -u -p -r1.40 thread.inl
    RTEMS_INLINE_ROUTINE bool _Thread_Is_dis 
    258258
    259259RTEMS_INLINE_ROUTINE bool _Thread_Is_context_switch_necessary( void )
    260260{
    261   return ( _Context_Switch_necessary );
     261  return ( _Thread_Dispatch_necessary );
    262262}
    263263
    264264/**
    RTEMS_INLINE_ROUTINE bool _Thread_Evalua 
    346346
    347347  if ( !_States_Is_ready( executing->current_state ) ||
    348348       ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) {
    349     _Context_Switch_necessary = true;
     349    _Thread_Dispatch_necessary = true;
    350350    return true;
    351351  }
    352352
  • cpukit/score/src/thread.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/thread.c,v
    retrieving revision 1.63
    diff -u -p -r1.63 thread.c
    void _Thread_Handler_initialization(void 
    6969      INTERNAL_ERROR_BAD_STACK_HOOK
    7070    );
    7171
    72   _Context_Switch_necessary = false;
     72  _Thread_Dispatch_necessary = false;
    7373  _Thread_Executing         = NULL;
    7474  _Thread_Heir              = NULL;
    7575#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
  • cpukit/score/src/threadchangepriority.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadchangepriority.c,v
    retrieving revision 1.12
    diff -u -p -r1.12 threadchangepriority.c
    void _Thread_Change_priority( 
    137137
    138138  if ( !_Thread_Is_executing_also_the_heir() &&
    139139       _Thread_Executing->is_preemptible )
    140     _Context_Switch_necessary = true;
     140    _Thread_Dispatch_necessary = true;
    141141  _ISR_Enable( level );
    142142}
  • cpukit/score/src/threadclearstate.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadclearstate.c,v
    retrieving revision 1.10
    diff -u -p -r1.10 threadclearstate.c
    void _Thread_Clear_state( 
    8989          _Thread_Heir = the_thread;
    9090          if ( _Thread_Executing->is_preemptible ||
    9191               the_thread->current_priority == 0 )
    92             _Context_Switch_necessary = true;
     92            _Thread_Dispatch_necessary = true;
    9393        }
    9494      }
    9595  }
  • cpukit/score/src/threaddispatch.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threaddispatch.c,v
    retrieving revision 1.21
    diff -u -p -r1.21 threaddispatch.c
    void _Thread_Dispatch( void ) 
    8989
    9090  executing   = _Thread_Executing;
    9191  _ISR_Disable( level );
    92   while ( _Context_Switch_necessary == true ) {
     92  while ( _Thread_Dispatch_necessary == true ) {
    9393    heir = _Thread_Heir;
    9494    _Thread_Dispatch_disable_level = 1;
    95     _Context_Switch_necessary = false;
     95    _Thread_Dispatch_necessary = false;
    9696    _Thread_Executing = heir;
    9797
    9898    /*
  • cpukit/score/src/threadready.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadready.c,v
    retrieving revision 1.7
    diff -u -p -r1.7 threadready.c
    void _Thread_Ready( 
    7272  heir = _Thread_Heir;
    7373
    7474  if ( !_Thread_Is_executing( heir ) && _Thread_Executing->is_preemptible )
    75     _Context_Switch_necessary = true;
     75    _Thread_Dispatch_necessary = true;
    7676
    7777  _ISR_Enable( level );
    7878}
  • cpukit/score/src/threadresume.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadresume.c,v
    retrieving revision 1.10
    diff -u -p -r1.10 threadresume.c
    void _Thread_Resume( 
    7979        _Thread_Heir = the_thread;
    8080        if ( _Thread_Executing->is_preemptible ||
    8181             the_thread->current_priority == 0 )
    82           _Context_Switch_necessary = true;
     82          _Thread_Dispatch_necessary = true;
    8383      }
    8484    }
    8585  }
  • cpukit/score/src/threadsetstate.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadsetstate.c,v
    retrieving revision 1.6
    diff -u -p -r1.6 threadsetstate.c
    void _Thread_Set_state( 
    8181     _Thread_Calculate_heir();
    8282
    8383  if ( _Thread_Is_executing( the_thread ) )
    84     _Context_Switch_necessary = true;
     84    _Thread_Dispatch_necessary = true;
    8585
    8686  _ISR_Enable( level );
    8787}
  • cpukit/score/src/threadstartmultitasking.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadstartmultitasking.c,v
    retrieving revision 1.10
    diff -u -p -r1.10 threadstartmultitasking.c
    void _Thread_Start_multitasking( void ) 
    6161
    6262  _System_state_Set( SYSTEM_STATE_UP );
    6363
    64   _Context_Switch_necessary = false;
     64  _Thread_Dispatch_necessary = false;
    6565
    6666  _Thread_Executing = _Thread_Heir;
    6767
  • cpukit/score/src/threadsuspend.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadsuspend.c,v
    retrieving revision 1.7
    diff -u -p -r1.7 threadsuspend.c
    void _Thread_Suspend( 
    7979     _Thread_Calculate_heir();
    8080
    8181  if ( _Thread_Is_executing( the_thread ) )
    82     _Context_Switch_necessary = true;
     82    _Thread_Dispatch_necessary = true;
    8383
    8484  _ISR_Enable( level );
    8585}
  • cpukit/score/src/threadyieldprocessor.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadyieldprocessor.c,v
    retrieving revision 1.5
    diff -u -p -r1.5 threadyieldprocessor.c
    void _Thread_Yield_processor( void ) 
    6767
    6868      if ( _Thread_Is_heir( executing ) )
    6969        _Thread_Heir = (Thread_Control *) ready->first;
    70       _Context_Switch_necessary = true;
     70      _Thread_Dispatch_necessary = true;
    7171    }
    7272    else if ( !_Thread_Is_heir( executing ) )
    73       _Context_Switch_necessary = true;
     73      _Thread_Dispatch_necessary = true;
    7474
    7575  _ISR_Enable( level );
    7676}
  • doc/porting/interrupts.t

    RCS file: /usr1/CVS/rtems/doc/porting/interrupts.t,v
    retrieving revision 1.10
    diff -u -p -r1.10 interrupts.t
    if ( _ISR_Nest_level ) 
    368368if ( _Thread_Dispatch_disable_level )
    369369    goto the label "exit interrupt (simple case)"
    370370 
    371 if ( _Context_Switch_necessary )
     371if ( _Thread_Dispatch_necessary )
    372372   call _Thread_Dispatch() or prepare to return to _ISR_Dispatch
    373373   prepare to get out of interrupt
    374374   return from interrupt  (maybe to _ISR_Dispatch)
  • testsuites/sptests/spsize/size.c

    RCS file: /usr1/CVS/rtems/testsuites/sptests/spsize/size.c,v
    retrieving revision 1.65
    diff -u -p -r1.65 size.c
    uninitialized = 
    228228                (sizeof _Configuration_MP_table)          +
    229229        #endif
    230230
    231 /*context.h*/   (sizeof _Context_Switch_necessary)        +
     231/*context.h*/   (sizeof _Thread_Dispatch_necessary)        +
    232232
    233233/*copyrt.h*/    0                                         +
    234234
  • testsuites/tmtests/tm26/task1.c

    RCS file: /usr1/CVS/rtems/testsuites/tmtests/tm26/task1.c,v
    retrieving revision 1.30
    diff -u -p -r1.30 task1.c
    rtems_task High_task( 
    225225    _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED );
    226226  thread_set_state_time = benchmark_timer_read();
    227227
    228   _Context_Switch_necessary = true;
     228  _Thread_Dispatch_necessary = true;
    229229
    230230  benchmark_timer_initialize();
    231231    _Thread_Dispatch();           /* dispatches Middle_task */
    rtems_task Middle_task( 
    246246
    247247  /* do not force context switch */
    248248
    249   _Context_Switch_necessary = false;
     249  _Thread_Dispatch_necessary = false;
    250250
    251251  _Thread_Disable_dispatch();
    252252
    rtems_task Low_task( 
    283283
    284284  /* do not force context switch */
    285285
    286   _Context_Switch_necessary = false;
     286  _Thread_Dispatch_necessary = false;
    287287
    288288  _Thread_Disable_dispatch();
    289289
    rtems_task Floating_point_task_1( 
    310310
    311311  /* do not force context switch */
    312312
    313   _Context_Switch_necessary = false;
     313  _Thread_Dispatch_necessary = false;
    314314
    315315  _Thread_Disable_dispatch();
    316316
    rtems_task Floating_point_task_1( 
    333333
    334334  /* do not force context switch */
    335335
    336   _Context_Switch_necessary = false;
     336  _Thread_Dispatch_necessary = false;
    337337
    338338  _Thread_Disable_dispatch();
    339339
    rtems_task Floating_point_task_2( 
    364364
    365365  /* do not force context switch */
    366366
    367   _Context_Switch_necessary = false;
     367  _Thread_Dispatch_necessary = false;
    368368
    369369  _Thread_Disable_dispatch();
    370370
    void complete_test( void ) 
    430430   */
    431431
    432432  _Thread_Heir = _Thread_Executing;
    433   _Context_Switch_necessary = false;
     433  _Thread_Dispatch_necessary = false;
    434434  _Thread_Dispatch_disable_level = 0;
    435435
    436436  /*
  • testsuites/tmtests/tm27/task1.c

    RCS file: /usr1/CVS/rtems/testsuites/tmtests/tm27/task1.c,v
    retrieving revision 1.27
    diff -u -p -r1.27 task1.c
    rtems_task Task_1( 
    172172
    173173  _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[LOW_PRIORITY].last;
    174174
    175   _Context_Switch_necessary = 1;
     175  _Thread_Dispatch_necessary = 1;
    176176
    177177  Interrupt_occurred = 0;
    178178  benchmark_timer_initialize();
    rtems_task Task_2( 
    229229
    230230  _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[LOW_PRIORITY].first;
    231231
    232   _Context_Switch_necessary = 1;
     232  _Thread_Dispatch_necessary = 1;
    233233
    234234  _Thread_Dispatch();
    235235