Ticket #1817: 1817.diff

File 1817.diff, 9.1 KB (added by Helder Silva, on Sep 22, 2011 at 9:40:26 AM)

Patch of the bug implementation on the head of the repository 20110921

  • .cvsignore

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/.cvsignore rtems_updated//.cvsignore
    old new  
    1 aclocal.m4
    2 autom4te*.cache
    3 compile
    4 config.cache
    5 config.guess
    6 config.log
    7 config.status
    8 config.sub
    9 configure
    10 depcomp
    11 install-sh
    12 install.sh
    13 Makefile
    14 Makefile.in
    15 mdate-sh
    16 missing
    17 texinfo.tex
  • cpukit/score/inline/rtems/score/schedulerpriority.inl

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/inline/rtems/score/schedulerpriority.inl rtems_updated//cpukit/score/inline/rtems/score/schedulerpriority.inl
    old new  
    2424#define _RTEMS_SCORE_SCHEDULERPRIORITY_INL
    2525
    2626#include <rtems/score/wkspace.h>
     27#include <rtems/score/isr.h>
    2728
    2829/**
    2930 *  @addtogroup ScoreScheduler
     
    180181 */
    181182RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
    182183{
     184  ISR_Level level;
     185  _ISR_Disable(level);
    183186  _Thread_Heir = _Scheduler_priority_Ready_queue_first(
    184187    (Chain_Control *) _Scheduler.information
    185188  );
     189  _ISR_Enable(level);
    186190}
    187191
    188192/**
  • cpukit/score/src/schedulercbsunblock.c

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/src/schedulercbsunblock.c rtems_updated//cpukit/score/src/schedulercbsunblock.c
    old new  
    1616#include <rtems/system.h>
    1717#include <rtems/score/scheduler.h>
    1818#include <rtems/score/schedulercbs.h>
     19#include <rtems/score/isr.h>
    1920
    2021void _Scheduler_CBS_Unblock(
    2122  Thread_Control    *the_thread
     
    2425  Scheduler_CBS_Per_thread *sched_info;
    2526  Scheduler_CBS_Server *serv_info;
    2627  Priority_Control new_priority;
     28  ISR_Level level;
    2729
    2830  _Scheduler_EDF_Enqueue(the_thread);
    2931  /* TODO: flash critical section? */
     
    6668   *    Even if the thread isn't preemptible, if the new heir is
    6769   *    a pseudo-ISR system task, we need to do a context switch.
    6870   */
     71  _ISR_Disable(level);
    6972  if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
    7073       _Thread_Heir->current_priority)) {
    7174    _Thread_Heir = the_thread;
     
    7376         the_thread->current_priority == 0 )
    7477      _Thread_Dispatch_necessary = true;
    7578  }
     79  _ISR_Enable(level);
    7680}
  • cpukit/score/src/scheduleredfschedule.c

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/src/scheduleredfschedule.c rtems_updated//cpukit/score/src/scheduleredfschedule.c
    old new  
    1616#include <rtems/system.h>
    1717#include <rtems/score/scheduler.h>
    1818#include <rtems/score/scheduleredf.h>
     19#include <rtems/score/isr.h>
    1920
    2021void _Scheduler_EDF_Schedule(void)
    2122{
     23  ISR_Level level;
    2224  RBTree_Node *first_node =
    2325    _RBTree_Peek(&_Scheduler_EDF_Ready_queue, RBT_LEFT);
    2426  Scheduler_EDF_Per_thread *sched_info =
    2527    _RBTree_Container_of(first_node, Scheduler_EDF_Per_thread, Node);
    2628
     29  _ISR_Disable(level);
    2730  _Thread_Heir = (Thread_Control *) sched_info->thread;
     31  _ISR_Enable(level);
    2832}
  • cpukit/score/src/scheduleredfunblock.c

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/src/scheduleredfunblock.c rtems_updated//cpukit/score/src/scheduleredfunblock.c
    old new  
    1616#include <rtems/system.h>
    1717#include <rtems/score/scheduler.h>
    1818#include <rtems/score/scheduleredf.h>
     19#include <rtems/score/isr.h>
    1920
    2021void _Scheduler_EDF_Unblock(
    2122  Thread_Control    *the_thread
    2223)
    2324{
     25  ISR_Level level;
    2426  _Scheduler_EDF_Enqueue(the_thread);
    2527  /* TODO: flash critical section? */
    2628
     
    3638   *    Even if the thread isn't preemptible, if the new heir is
    3739   *    a pseudo-ISR system task, we need to do a context switch.
    3840   */
     41  _ISR_Disable(level);
    3942  if ( _Scheduler_Is_priority_lower_than(
    4043         _Thread_Heir->current_priority,
    4144         the_thread->current_priority )) {
     
    4447         the_thread->current_priority == 0 )
    4548      _Thread_Dispatch_necessary = true;
    4649  }
     50  _ISR_Enable(level);
    4751}
  • cpukit/score/src/schedulerpriorityunblock.c

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/src/schedulerpriorityunblock.c rtems_updated//cpukit/score/src/schedulerpriorityunblock.c
    old new  
    1818#include <rtems/system.h>
    1919#include <rtems/score/scheduler.h>
    2020#include <rtems/score/schedulerpriority.h>
     21#include <rtems/score/isr.h>
    2122
    2223void _Scheduler_priority_Unblock (
    2324  Thread_Control          *the_thread
    2425)
    2526{
     27  ISR_Level level;
    2628  _Scheduler_priority_Ready_queue_enqueue(the_thread);
    2729
    2830  /* TODO: flash critical section? */
     
    3941   *    Even if the thread isn't preemptible, if the new heir is
    4042   *    a pseudo-ISR system task, we need to do a context switch.
    4143   */
     44  _ISR_Disable(level);
    4245  if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
    4346    _Thread_Heir = the_thread;
    4447    if ( _Thread_Executing->is_preemptible ||
    4548        the_thread->current_priority == 0 )
    4649      _Thread_Dispatch_necessary = true;
    4750  }
     51  _ISR_Enable(level);
    4852}
  • cpukit/score/src/schedulersimpleschedule.c

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/src/schedulersimpleschedule.c rtems_updated//cpukit/score/src/schedulersimpleschedule.c
    old new  
    2828
    2929void _Scheduler_simple_Schedule(void)
    3030{
     31  ISR_Level level;
     32  _ISR_Disable(level);
    3133  _Thread_Heir = (Thread_Control *) _Chain_First(
    3234    (Chain_Control *) _Scheduler.information
    3335  );
     36 _ISR_Enable(level);
    3437}
  • cpukit/score/src/schedulersimpleunblock.c

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/src/schedulersimpleunblock.c rtems_updated//cpukit/score/src/schedulersimpleunblock.c
    old new  
    2424  Thread_Control    *the_thread
    2525)
    2626{
     27  ISR_Level level;
    2728  _Scheduler_simple_Ready_queue_enqueue(the_thread);
    2829
    2930  /*
     
    3839   *    Even if the thread isn't preemptible, if the new heir is
    3940   *    a pseudo-ISR system task, we need to do a context switch.
    4041   */
     42  _ISR_Disable(level);
    4143  if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
    4244    _Thread_Heir = the_thread;
    4345    if ( _Thread_Executing->is_preemptible ||
    4446        the_thread->current_priority == 0 )
    4547      _Thread_Dispatch_necessary = true;
    4648  }
     49 _ISR_Enable(level);
    4750}
  • cpukit/score/src/thread.c

    diff -BNaur -x .svn -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x .cproject -x subdir.mk -x objects.mk -x sources.mk -x .project -x makeedilib.log -x makefile -x Debug rtems/cpukit/score/src/thread.c rtems_updated//cpukit/score/src/thread.c
    old new  
    5555  #if defined(RTEMS_MULTIPROCESSING)
    5656    uint32_t   maximum_proxies;
    5757  #endif
     58  ISR_Level level;
    5859
    5960  ticks_per_timeslice = Configuration.ticks_per_timeslice;
    6061  maximum_extensions  = Configuration.maximum_extensions;
     
    7374      INTERNAL_ERROR_BAD_STACK_HOOK
    7475    );
    7576
     77  _ISR_Disable(level);
    7678  _Thread_Dispatch_necessary = false;
    7779  _Thread_Executing         = NULL;
    7880  _Thread_Heir              = NULL;
     
    8789  #if defined(RTEMS_MULTIPROCESSING)
    8890    _Thread_MP_Handler_initialization( maximum_proxies );
    8991  #endif
     92  _ISR_Enable(level);
    9093
    9194  /*
    9295   *  Initialize the internal class of threads.  We need an IDLE thread