Ticket #1647: rtems-modsched.diff

File rtems-modsched.diff, 43.2 KB (added by Gedare Bloom, on 11/13/10 at 17:05:54)

Updated patch.

  • cpukit/posix/src/nanosleep.c

    RCS file: /usr1/CVS/rtems/cpukit/posix/src/nanosleep.c,v
    retrieving revision 1.11
    diff -u -p -r1.11 nanosleep.c
     
    1818
    1919#include <rtems/system.h>
    2020#include <rtems/score/isr.h>
     21#include <rtems/score/scheduler.h>
    2122#include <rtems/score/thread.h>
    2223#include <rtems/score/tod.h>
    2324
    int nanosleep( 
    5657
    5758  if ( !ticks ) {
    5859    _Thread_Disable_dispatch();
    59       _Thread_Yield_processor();
     60      _Scheduler_Yield();
    6061    _Thread_Enable_dispatch();
    6162    if ( rmtp ) {
    6263       rmtp->tv_sec = 0;
  • cpukit/posix/src/sched_yield.c

    RCS file: /usr1/CVS/rtems/cpukit/posix/src/sched_yield.c,v
    retrieving revision 1.1
    diff -u -p -r1.1 sched_yield.c
     
    1919#include <errno.h>
    2020
    2121#include <rtems/system.h>
     22#include <rtems/score/scheduler.h>
    2223#include <rtems/score/tod.h>
    2324#include <rtems/score/thread.h>
    2425#include <rtems/seterr.h>
     
    2829int sched_yield( void )
    2930{
    3031  _Thread_Disable_dispatch();
    31     _Thread_Yield_processor();
     32    _Scheduler_Yield();
    3233  _Thread_Enable_dispatch();
    3334  return 0;
    3435}
  • cpukit/rtems/src/taskwakeafter.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/taskwakeafter.c,v
    retrieving revision 1.4
    diff -u -p -r1.4 taskwakeafter.c
     
    2121#include <rtems/rtems/support.h>
    2222#include <rtems/rtems/modes.h>
    2323#include <rtems/score/object.h>
     24#include <rtems/score/scheduler.h>
    2425#include <rtems/score/stack.h>
    2526#include <rtems/score/states.h>
    2627#include <rtems/rtems/tasks.h>
    rtems_status_code rtems_task_wake_after( 
    5253{
    5354  _Thread_Disable_dispatch();
    5455    if ( ticks == 0 ) {
    55       _Thread_Yield_processor();
     56      _Scheduler_Yield();
    5657    } else {
    5758      _Thread_Set_state( _Thread_Executing, STATES_DELAYING );
    5859      _Watchdog_Initialize(
  • cpukit/sapi/include/confdefs.h

    RCS file: /usr1/CVS/rtems/cpukit/sapi/include/confdefs.h,v
    retrieving revision 1.149
    diff -u -p -r1.149 confdefs.h
    rtems_fs_init_functions_t rtems_fs_in 
    535535#endif
    536536
    537537/*
     538 * Scheduler configuration.
     539 *
     540 * The scheduler configuration allows an application to select the
     541 * scheduling policy to use.  The supported configurations are:
     542 *  CONFIGURE_SCHEDULER_USER
     543 *  CONFIGURE_SCHEDULER_PRIORITY
     544 *
     545 * If no configuration is specified by the application, then
     546 * CONFIGURE_SCHEDULER_PRIORITY is assumed to be the default.
     547 *
     548 * An application can define its own scheduling policy by defining
     549 * CONFIGURE_SCHEDULER_USER and CONFIGURE_SCHEDULER_ENTRY_USER to point
     550 * to an initialization routine.  Note: CONFIGURE_SCHEDULER_USER is not
     551 * fully supported, since it has no per-thread field.
     552 *
     553 * To add a new scheduler:
     554 */
     555#include <rtems/score/scheduler.h>
     556
     557#if defined(CONFIGURE_SCHEDULER_USER) && \
     558    !defined(CONFIGURE_SCHEDULER_ENTRY_USER)
     559  #error "CONFIGURE_ERROR: CONFIGURE_SCHEDULER_USER without CONFIGURE_SCHEDULER_ENTRY_USER"
     560#endif
     561
     562/* enable all RTEMS-provided schedulers */
     563#if defined(CONFIGURE_SCHEDULER_ALL)
     564  #define CONFIGURE_SCHEDULER_PRIORITY
     565#endif
     566
     567/* If no scheduler is specified, the priority scheduler is default. */
     568#if !defined(CONFIGURE_SCHEDULER_USER) && \
     569    !defined(CONFIGURE_SCHEDULER_PRIORITY)
     570  #define CONFIGURE_SCHEDULER_PRIORITY
     571  #define CONFIGURE_SCHEDULER_POLICY _Scheduler_PRIORITY
     572#endif
     573
     574/*
     575 * If a user scheduler is specified and no policy is set,
     576 * the user scheduler is the default policy.
     577 */
     578#if defined(CONFIGURE_SCHEDULER_USER) && \
     579    !defined(CONFIGURE_SCHEDULER_POLICY)
     580  #define CONFIGURE_SCHEDULER_POLICY _Scheduler_USER
     581#endif
     582
     583/*
     584 * Check for priority scheduler next, as it is the default policy if there
     585 * is no CONFIGURE_SCHEDULER_POLICY set and no USER scheduler provided.
     586 */
     587#if defined(CONFIGURE_SCHEDULER_PRIORITY)
     588  #include <rtems/score/schedulerpriority.h>
     589  #define CONFIGURE_SCHEDULER_ENTRY_PRIORITY { _Scheduler_priority_Initialize }
     590  #if !defined(CONFIGURE_SCHEDULER_POLICY)
     591    #define CONFIGURE_SCHEDULER_POLICY _Scheduler_PRIORITY
     592  #endif
     593
     594  /**
     595   * define the memory used by the priority scheduler
     596   */
     597  #define CONFIGURE_MEMORY_SCHEDULER_PRIORITY ( \
     598    _Configure_From_workspace( \
     599      ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) ) \
     600  )
     601  #define CONFIGURE_MEMORY_PER_TASK_SCHEDULER_PRIORITY ( \
     602    _Configure_From_workspace(sizeof(Scheduler_priority_Per_thread)) )
     603#endif
     604
     605/*
     606 * Set up the scheduler table.  The scheduling code indexes this table to
     607 * invoke the correct scheduling implementation. The scheduler to use is
     608 * determined by the Configuration.scheduler_policy field, which is set
     609 * by CONFIGURE_SCHEDULER_POLICY.  If a particular scheduler is not enabled,
     610 * an empty entry is included in its entry in the scheduler table.
     611 */
     612
     613  /**
     614   * An empty scheduler entry
     615   */
     616  #define CONFIGURE_SCHEDULER_NULL { NULL }
     617
     618#ifdef CONFIGURE_INIT
     619  /* the table of available schedulers. */
     620  const Scheduler_Table_t _Scheduler_Table[] = {
     621    #if defined(CONFIGURE_SCHEDULER_USER) && \
     622        defined(CONFIGURE_SCHEDULER_ENTRY_USER)
     623      CONFIGURE_SCHEDULER_ENTRY_USER,
     624    #else
     625      CONFIGURE_SCHEDULER_NULL,
     626    #endif
     627    #if defined(CONFIGURE_SCHEDULER_PRIORITY) && \
     628        defined(CONFIGURE_SCHEDULER_ENTRY_PRIORITY)
     629      CONFIGURE_SCHEDULER_ENTRY_PRIORITY,
     630    #else
     631      CONFIGURE_SCHEDULER_NULL,
     632    #endif
     633  };
     634#endif
     635
     636/**
     637 * Define the memory overhead for the scheduler
     638 */
     639#define CONFIGURE_MEMORY_FOR_SCHEDULER ( \
     640    CONFIGURE_MEMORY_SCHEDULER_PRIORITY \
     641  )
     642
     643#define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER ( \
     644    CONFIGURE_MEMORY_PER_TASK_SCHEDULER_PRIORITY \
     645  )
     646
     647/*
    538648 *  If you said the IDLE task was going to do application initialization
    539649 *  and didn't override the IDLE body, then something is amiss.
    540650 */
    rtems_fs_init_functions_t rtems_fs_in 
    16061716   (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \
    16071717    CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API + \
    16081718    CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \
    1609     CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API))  + \
     1719    CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
     1720    CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER))  + \
    16101721  _Configure_From_workspace( \
    16111722    _Configure_Max_Objects(_number_FP_tasks) * CONTEXT_FP_SIZE) + \
    16121723  _Configure_From_workspace( \
    rtems_fs_init_functions_t rtems_fs_in 
    17041815  _Configure_Object_RAM(1, sizeof(API_Mutex_Control))
    17051816
    17061817/**
    1707  *  This defines the memory used by the thread ready chains.  There is
    1708  *  one chain per priority.
    1709  */
    1710 #define CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS \
    1711     _Configure_From_workspace( \
    1712         ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) )
    1713 /**
    17141818 *  This defines the amount of memory reserved for the IDLE task
    17151819 *  control structures and stack.
    17161820 */
    rtems_fs_init_functions_t rtems_fs_in 
    17231827 */
    17241828#define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
    17251829  ( CONFIGURE_MEMORY_FOR_IDLE_TASK +                /* IDLE and stack */ \
    1726     CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS +     /* Ready chains */ \
     1830    CONFIGURE_MEMORY_FOR_SCHEDULER +                /* Scheduler */ \
    17271831    CONFIGURE_INTERRUPT_VECTOR_TABLE +             /* interrupt vectors */ \
    17281832    CONFIGURE_INTERRUPT_STACK_MEMORY +             /* interrupt stack */ \
    17291833    CONFIGURE_API_MUTEX_MEMORY                     /* allocation mutex */ \
    rtems_fs_init_functions_t rtems_fs_in 
    20042108    CONFIGURE_MAXIMUM_USER_EXTENSIONS,        /* maximum dynamic extensions */
    20052109    CONFIGURE_MICROSECONDS_PER_TICK,          /* microseconds per clock tick */
    20062110    CONFIGURE_TICKS_PER_TIMESLICE,            /* ticks per timeslice quantum */
     2111    CONFIGURE_SCHEDULER_POLICY,               /* scheduling policy */
    20072112    CONFIGURE_IDLE_TASK_BODY,                 /* user's IDLE task */
    20082113    CONFIGURE_IDLE_TASK_STACK_SIZE,           /* IDLE task stack size */
    20092114    CONFIGURE_INTERRUPT_STACK_SIZE,           /* interrupt stack size */
  • cpukit/sapi/include/rtems/config.h

    RCS file: /usr1/CVS/rtems/cpukit/sapi/include/rtems/config.h,v
    retrieving revision 1.53
    diff -u -p -r1.53 config.h
    typedef struct { 
    118118   */
    119119  uint32_t                       ticks_per_timeslice;
    120120
     121  /** This field specifies the scheduling policy to use.
     122   */
     123  uint32_t                       scheduler_policy;
     124
    121125  /** This element points to the BSP's optional idle task which may override
    122126   *  the default one provided with RTEMS.
    123127   */
  • cpukit/sapi/src/exinit.c

    RCS file: /usr1/CVS/rtems/cpukit/sapi/src/exinit.c,v
    retrieving revision 1.55
    diff -u -p -r1.55 exinit.c
     
    4242#include <rtems/score/mpci.h>
    4343#endif
    4444#include <rtems/score/priority.h>
    45 #include <rtems/score/prioritybitmap.h>
     45#include <rtems/score/scheduler.h>
    4646#include <rtems/score/thread.h>
    4747#include <rtems/score/tod.h>
    4848#include <rtems/score/userext.h>
    void rtems_initialize_data_structures(vo 
    131131
    132132  _Thread_Handler_initialization();
    133133
     134  _Scheduler_Handler_initialization();
     135
    134136  #if defined(RTEMS_MULTIPROCESSING)
    135137    _Objects_MP_Handler_initialization();
    136138    _MPCI_Handler_initialization( RTEMS_TIMEOUT );
  • cpukit/score/Makefile.am

    RCS file: /usr1/CVS/rtems/cpukit/score/Makefile.am,v
    retrieving revision 1.88
    diff -u -p -r1.88 Makefile.am
    include_rtems_score_HEADERS = include/rt 
    2626    include/rtems/score/interr.h include/rtems/score/isr.h \
    2727    include/rtems/score/object.h include/rtems/score/percpu.h \
    2828    include/rtems/score/priority.h include/rtems/score/prioritybitmap.h \
     29    include/rtems/score/scheduler.h include/rtems/score/schedulerpriority.h \
    2930    include/rtems/score/stack.h include/rtems/score/states.h \
    3031    include/rtems/score/sysstate.h include/rtems/score/thread.h \
    3132    include/rtems/score/threadq.h include/rtems/score/threadsync.h \
    include_rtems_score_HEADERS += inline/rt 
    5455    inline/rtems/score/coresem.inl inline/rtems/score/heap.inl \
    5556    inline/rtems/score/isr.inl inline/rtems/score/object.inl \
    5657    inline/rtems/score/priority.inl inline/rtems/score/prioritybitmap.inl \
     58    inline/rtems/score/scheduler.inl inline/rtems/score/schedulerpriority.inl \
    5759    inline/rtems/score/stack.inl inline/rtems/score/states.inl \
    5860    inline/rtems/score/sysstate.inl inline/rtems/score/thread.inl \
    5961    inline/rtems/score/threadq.inl inline/rtems/score/tod.inl \
    libscore_a_SOURCES += src/objectallocate 
    137139    src/objectgetinfo.c src/objectgetinfoid.c src/objectapimaximumclass.c \
    138140    src/objectnamespaceremove.c
    139141
     142## SCHEDULER_C_FILES
     143libscore_a_SOURCES += src/scheduler.c
     144
     145## SCHEDULERPRIORITY_C_FILES
     146libscore_a_SOURCES += src/schedulerpriority.c \
     147                                                                                        src/schedulerpriorityblock.c \
     148                      src/schedulerprioritythreadschedulerallocate.c \
     149                      src/schedulerprioritythreadschedulerfree.c \
     150                      src/schedulerprioritythreadschedulerupdate.c \
     151                                                                                        src/schedulerpriorityschedule.c \
     152                                                                                        src/schedulerpriorityunblock.c \
     153                                                                                        src/schedulerpriorityyield.c
     154
    140155## PROTECTED_HEAP_C_FILES
    141156libscore_a_SOURCES += src/pheapallocate.c \
    142157    src/pheapextend.c src/pheapfree.c src/pheapgetsize.c \
    libscore_a_SOURCES += src/thread.c src/t 
    153168    src/threadsetstate.c src/threadsettransient.c \
    154169    src/threadstackallocate.c src/threadstackfree.c src/threadstart.c \
    155170    src/threadstartmultitasking.c src/threadsuspend.c \
    156     src/threadtickletimeslice.c src/threadyieldprocessor.c \
     171    src/threadtickletimeslice.c \
    157172    src/iterateoverthreads.c src/threadblockingoperationcancel.c
    158173
    159174## THREADQ_C_FILES
  • cpukit/score/preinstall.am

    RCS file: /usr1/CVS/rtems/cpukit/score/preinstall.am,v
    retrieving revision 1.24
    diff -u -p -r1.24 preinstall.am
    $(PROJECT_INCLUDE)/rtems/score/priorityb 
    111111        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.h
    112112PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.h
    113113
     114$(PROJECT_INCLUDE)/rtems/score/scheduler.h: include/rtems/score/scheduler.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     115        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/scheduler.h
     116PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/scheduler.h
     117
     118$(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h: include/rtems/score/schedulerpriority.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     119        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
     120PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
     121
    114122$(PROJECT_INCLUDE)/rtems/score/stack.h: include/rtems/score/stack.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
    115123        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.h
    116124PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stack.h
    $(PROJECT_INCLUDE)/rtems/score/priorityb 
    245253        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.inl
    246254PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.inl
    247255
     256$(PROJECT_INCLUDE)/rtems/score/scheduler.inl: inline/rtems/score/scheduler.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     257        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/scheduler.inl
     258PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/scheduler.inl
     259
     260$(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl: inline/rtems/score/schedulerpriority.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     261        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl
     262PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl
     263
    248264$(PROJECT_INCLUDE)/rtems/score/stack.inl: inline/rtems/score/stack.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
    249265        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.inl
    250266PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stack.inl
  • cpukit/score/include/rtems/score/prioritybitmap.h

    RCS file: /usr1/CVS/rtems/cpukit/score/include/rtems/score/prioritybitmap.h,v
    retrieving revision 1.1
    diff -u -p -r1.1 prioritybitmap.h
    extern "C" { 
    3737
    3838#include <rtems/score/priority.h>
    3939
     40
    4041/*
    41  * TODO:
    42  * These should only be instantiated if using the bit map handler.  The
    43  * logical place for this is in confdefs.h when a scheduler that uses the
    44  * bit map handler is configured.
     42 * The Priority_bit_map_Control variables are instantiated only
     43 * if using the bit map handler.
    4544 */
    4645
    4746/**
    4847 *  Each sixteen bit entry in this array is associated with one of
    4948 *  the sixteen entries in the Priority Bit map.
    5049 */
    51 SCORE_EXTERN volatile Priority_bit_map_Control _Priority_Major_bit_map;
     50extern volatile Priority_bit_map_Control _Priority_Major_bit_map;
    5251
    5352/** Each bit in the Priority Bitmap indicates whether or not there are
    5453 *  threads ready at a particular priority.  The mapping of
    SCORE_EXTERN volatile Priority_bit_map_C 
    5655 *  dependent as is the value of each bit used to indicate that
    5756 *  threads are ready at that priority.
    5857 */
    59 SCORE_EXTERN Priority_bit_map_Control
     58extern Priority_bit_map_Control
    6059               _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
    6160
    6261/*
  • cpukit/score/include/rtems/score/thread.h

    RCS file: /usr1/CVS/rtems/cpukit/score/include/rtems/score/thread.h,v
    retrieving revision 1.97
    diff -u -p -r1.97 thread.h
    extern "C" { 
    7070#endif
    7171#include <rtems/score/object.h>
    7272#include <rtems/score/priority.h>
    73 #include <rtems/score/prioritybitmap.h>
     73#include <rtems/score/scheduler.h>
    7474#include <rtems/score/stack.h>
    7575#include <rtems/score/states.h>
    7676#include <rtems/score/tod.h>
    struct Thread_Control_struct { 
    390390   *  since it was created.
    391391   */
    392392  Thread_CPU_usage_t                    cpu_time_used;
    393   /** This field points to the Ready FIFO for this priority. */
    394   Chain_Control                        *ready;
    395   /** This field contains precalculated priority map indices. */
    396   Priority_bit_map_Information          Priority_map;
     393  /** This union holds per-thread data for the scheduler and ready queue. */
     394  union {
     395    Scheduler_priority_Per_thread      *priority;
     396  } scheduler;
    397397  /** This field contains information about the starting state of
    398398   *  this thread.
    399399   */
    SCORE_EXTERN uint32_t _Thread_Maximum_ 
    456456SCORE_EXTERN uint32_t   _Thread_Ticks_per_timeslice;
    457457
    458458/**
    459  *  The following points to the array of FIFOs used to manage the
    460  *  set of ready threads.
    461  */
    462 SCORE_EXTERN Chain_Control *_Thread_Ready_chain;
    463 
    464 /**
    465459 *  The following points to the thread whose floating point
    466460 *  context is currently loaded.
    467461 */
    void _Thread_Set_transient( 
    654648void _Thread_Tickle_timeslice( void );
    655649
    656650/**
    657  *  This routine is invoked when a thread wishes to voluntarily
    658  *  transfer control of the processor to another thread of equal
    659  *  or greater priority.
    660  */
    661 void _Thread_Yield_processor( void );
    662 
    663 /**
    664651 *  This routine initializes the context of the_thread to its
    665652 *  appropriate starting state.
    666653 */
  • cpukit/score/inline/rtems/score/thread.inl

    RCS file: /usr1/CVS/rtems/cpukit/score/inline/rtems/score/thread.inl,v
    retrieving revision 1.43
    diff -u -p -r1.43 thread.inl
    RTEMS_INLINE_ROUTINE void _Thread_Restar 
    120120}
    121121
    122122/**
    123  *  This function returns a pointer to the highest priority
    124  *  ready thread.
    125  */
    126 
    127 RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
    128 {
    129   _Thread_Heir = (Thread_Control *)
    130     _Thread_Ready_chain[ _Priority_bit_map_Get_highest() ].first;
    131 }
    132 
    133 /**
    134123 *  This function returns true if the floating point context of
    135124 *  the_thread is currently loaded in the floating point unit, and
    136125 *  false otherwise.
  • cpukit/score/src/thread.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/thread.c,v
    retrieving revision 1.64
    diff -u -p -r1.64 thread.c
     
    2424#include <rtems/score/isr.h>
    2525#include <rtems/score/object.h>
    2626#include <rtems/score/priority.h>
     27#include <rtems/score/scheduler.h>
    2728#include <rtems/score/states.h>
    2829#include <rtems/score/sysstate.h>
    2930#include <rtems/score/thread.h>
     
    4546
    4647void _Thread_Handler_initialization(void)
    4748{
    48   uint32_t     index;
    4949  uint32_t     ticks_per_timeslice;
    5050  uint32_t     maximum_extensions;
    5151  #if defined(RTEMS_MULTIPROCESSING)
    void _Thread_Handler_initialization(void 
    8080
    8181  _Thread_Ticks_per_timeslice  = ticks_per_timeslice;
    8282
    83   _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error(
    84     (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control)
    85   );
    86 
    87   for ( index=0; index <= PRIORITY_MAXIMUM ; index++ )
    88     _Chain_Initialize_empty( &_Thread_Ready_chain[ index ] );
    89 
    9083#if defined(RTEMS_MULTIPROCESSING)
    9184  _Thread_MP_Handler_initialization( maximum_proxies );
    9285#endif
  • cpukit/score/src/threadchangepriority.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadchangepriority.c,v
    retrieving revision 1.14
    diff -u -p -r1.14 threadchangepriority.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
     27#include <rtems/score/schedulerpriority.h>
    2628#include <rtems/score/states.h>
    2729#include <rtems/score/sysstate.h>
    2830#include <rtems/score/thread.h>
    void _Thread_Change_priority( 
    117119     *  We now know the thread will be in the READY state when we remove
    118120     *  the TRANSIENT state.  So we have to place it on the appropriate
    119121     *  Ready Queue with interrupts off.
     122     *
     123     *  FIXME: hard-coded for priority scheduling. Might be ok since this
     124     *  function is specific to priority scheduling?
    120125     */
    121126    the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
    122127
    123     _Priority_bit_map_Add( &the_thread->Priority_map );
    124128    if ( prepend_it )
    125       _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
     129      _Scheduler_priority_Ready_queue_enqueue_first( the_thread );
    126130    else
    127       _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
     131      _Scheduler_priority_Ready_queue_enqueue( the_thread );
    128132  }
    129133
    130134  _ISR_Flash( level );
    void _Thread_Change_priority( 
    133137   *  We altered the set of thread priorities.  So let's figure out
    134138   *  who is the heir and if we need to switch to them.
    135139   */
    136   _Thread_Calculate_heir();
     140  _Scheduler_Schedule(&_Scheduler);
    137141
    138142  if ( !_Thread_Is_executing_also_the_heir() &&
    139143       _Thread_Executing->is_preemptible )
  • cpukit/score/src/threadclearstate.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadclearstate.c,v
    retrieving revision 1.12
    diff -u -p -r1.12 threadclearstate.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Clear_state( 
    6667      the_thread->current_state = _States_Clear( state, current_state );
    6768
    6869      if ( _States_Is_ready( current_state ) ) {
    69 
    70         _Priority_bit_map_Add( &the_thread->Priority_map );
    71 
    72         _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
    73 
    74         _ISR_Flash( level );
    75 
    76         /*
    77          *  If the thread that was unblocked is more important than the heir,
    78          *  then we have a new heir.  This may or may not result in a
    79          *  context switch.
    80          *
    81          *  Normal case:
    82          *    If the current thread is preemptible, then we need to do
    83          *    a context switch.
    84          *  Pseudo-ISR case:
    85          *    Even if the thread isn't preemptible, if the new heir is
    86          *    a pseudo-ISR system task, we need to do a context switch.
    87          */
    88         if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
    89           _Thread_Heir = the_thread;
    90           if ( _Thread_Executing->is_preemptible ||
    91                the_thread->current_priority == 0 )
    92             _Thread_Dispatch_necessary = true;
    93         }
     70        _Scheduler_Unblock( &_Scheduler, the_thread);
    9471      }
    9572  }
    9673  _ISR_Enable( level );
  • cpukit/score/src/threadclose.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadclose.c,v
    retrieving revision 1.12
    diff -u -p -r1.12 threadclose.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Close( 
    8687  }
    8788
    8889  /*
     90   * Free the per-thread scheduling information.
     91   */
     92  _Scheduler_Thread_scheduler_free( &_Scheduler, the_thread );
     93
     94  /*
    8995   *  The thread might have been FP.  So deal with that.
    9096   */
    9197#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
  • cpukit/score/src/threadinitialize.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadinitialize.c,v
    retrieving revision 1.39
    diff -u -p -r1.39 threadinitialize.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    bool _Thread_Initialize( 
    6061  #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
    6162    void              *fp_area;
    6263  #endif
     64  void                *sched = NULL;
    6365  void                *extensions_area;
    6466  bool                 extension_status;
    6567  int                  i;
    bool _Thread_Initialize( 
    192194  the_thread->resource_count          = 0;
    193195  the_thread->real_priority           = priority;
    194196  the_thread->Start.initial_priority  = priority;
     197  sched =_Scheduler_Thread_scheduler_allocate( &_Scheduler, the_thread );
     198  if ( !sched )
     199    goto failed;
    195200  _Thread_Set_priority( the_thread, priority );
    196201
    197202  /*
    failed: 
    235240      (void) _Workspace_Free( fp_area );
    236241  #endif
    237242
     243  if ( sched )
     244    (void) _Workspace_Free( sched );
     245
    238246   _Thread_Stack_Free( the_thread );
    239247  return false;
    240248
  • cpukit/score/src/threadready.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadready.c,v
    retrieving revision 1.9
    diff -u -p -r1.9 threadready.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Ready( 
    5556)
    5657{
    5758  ISR_Level              level;
    58   Thread_Control *heir;
    5959
    6060  _ISR_Disable( level );
    6161
    6262  the_thread->current_state = STATES_READY;
    6363
    64   _Priority_bit_map_Add( &the_thread->Priority_map );
    65 
    66   _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
    67 
    68   _ISR_Flash( level );
    69 
    70   _Thread_Calculate_heir();
    71 
    72   heir = _Thread_Heir;
    73 
    74   if ( !_Thread_Is_executing( heir ) && _Thread_Executing->is_preemptible )
    75     _Thread_Dispatch_necessary = true;
     64  _Scheduler_Unblock( &_Scheduler, the_thread );
    7665
    7766  _ISR_Enable( level );
    7867}
  • cpukit/score/src/threadresume.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadresume.c,v
    retrieving revision 1.12
    diff -u -p -r1.12 threadresume.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Resume( 
    6869    the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state);
    6970
    7071    if ( _States_Is_ready( current_state ) ) {
    71 
    72       _Priority_bit_map_Add( &the_thread->Priority_map );
    73 
    74       _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
    75 
    76       _ISR_Flash( level );
    77 
    78       if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
    79         _Thread_Heir = the_thread;
    80         if ( _Thread_Executing->is_preemptible ||
    81              the_thread->current_priority == 0 )
    82           _Thread_Dispatch_necessary = true;
    83       }
     72      _Scheduler_Unblock( &_Scheduler, the_thread );
    8473    }
    8574  }
    8675
  • cpukit/score/src/threadsetpriority.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadsetpriority.c,v
    retrieving revision 1.5
    diff -u -p -r1.5 threadsetpriority.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Set_priority( 
    5051)
    5152{
    5253  the_thread->current_priority = new_priority;
    53   the_thread->ready            = &_Thread_Ready_chain[ new_priority ];
    5454
    55   _Priority_bit_map_Initialize_information(
    56       &the_thread->Priority_map,
    57       new_priority
    58   );
     55  _Scheduler_Thread_scheduler_update(&_Scheduler, the_thread);
    5956}
  • cpukit/score/src/threadsetstate.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadsetstate.c,v
    retrieving revision 1.8
    diff -u -p -r1.8 threadsetstate.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Set_state( 
    5455)
    5556{
    5657  ISR_Level      level;
    57   Chain_Control *ready;
    58 
    59   ready = the_thread->ready;
     58 
    6059  _ISR_Disable( level );
    6160  if ( !_States_Is_ready( the_thread->current_state ) ) {
    6261    the_thread->current_state =
    void _Thread_Set_state( 
    6766
    6867  the_thread->current_state = state;
    6968
    70   if ( _Chain_Has_only_one_node( ready ) ) {
    71 
    72     _Chain_Initialize_empty( ready );
    73     _Priority_bit_map_Remove( &the_thread->Priority_map );
    74 
    75   } else
    76     _Chain_Extract_unprotected( &the_thread->Object.Node );
    77 
    78   _ISR_Flash( level );
    79 
    80   if ( _Thread_Is_heir( the_thread ) )
    81      _Thread_Calculate_heir();
    82 
    83   if ( _Thread_Is_executing( the_thread ) )
    84     _Thread_Dispatch_necessary = true;
     69  _Scheduler_Block( &_Scheduler, the_thread);
    8570
    8671  _ISR_Enable( level );
    8772}
  • cpukit/score/src/threadsettransient.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadsettransient.c,v
    retrieving revision 1.6
    diff -u -p -r1.6 threadsettransient.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
     27#include <rtems/score/schedulerpriority.h>
    2628#include <rtems/score/states.h>
    2729#include <rtems/score/sysstate.h>
    2830#include <rtems/score/thread.h>
    void _Thread_Set_transient( 
    5456{
    5557  ISR_Level             level;
    5658  uint32_t              old_state;
    57   Chain_Control *ready;
    58 
    59   ready = the_thread->ready;
     59 
    6060  _ISR_Disable( level );
    6161
    6262  old_state = the_thread->current_state;
    6363  the_thread->current_state = _States_Set( STATES_TRANSIENT, old_state );
    6464
     65  /* FIXME: need to check which scheduler to use? */
    6566  if ( _States_Is_ready( old_state ) ) {
    66     if ( _Chain_Has_only_one_node( ready ) ) {
    67 
    68       _Chain_Initialize_empty( ready );
    69       _Priority_bit_map_Remove( &the_thread->Priority_map );
    70 
    71     } else
    72       _Chain_Extract_unprotected( &the_thread->Object.Node );
     67    _Scheduler_priority_Ready_queue_extract( the_thread);
    7368  }
    7469
    7570  _ISR_Enable( level );
  • cpukit/score/src/threadsuspend.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadsuspend.c,v
    retrieving revision 1.9
    diff -u -p -r1.9 threadsuspend.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Suspend( 
    5253)
    5354{
    5455  ISR_Level      level;
    55   Chain_Control *ready;
    56 
    57   ready = the_thread->ready;
     56 
    5857  _ISR_Disable( level );
    5958  if ( !_States_Is_ready( the_thread->current_state ) ) {
    6059    the_thread->current_state =
    void _Thread_Suspend( 
    6564
    6665  the_thread->current_state = STATES_SUSPENDED;
    6766
    68   if ( _Chain_Has_only_one_node( ready ) ) {
    69 
    70     _Chain_Initialize_empty( ready );
    71     _Priority_bit_map_Remove( &the_thread->Priority_map );
    72 
    73   } else
    74     _Chain_Extract_unprotected( &the_thread->Object.Node );
    75 
    76   _ISR_Flash( level );
    77 
    78   if ( _Thread_Is_heir( the_thread ) )
    79      _Thread_Calculate_heir();
    80 
    81   if ( _Thread_Is_executing( the_thread ) )
    82     _Thread_Dispatch_necessary = true;
     67  _Scheduler_Block(&_Scheduler, the_thread);
    8368
    8469  _ISR_Enable( level );
    8570}
  • cpukit/score/src/threadtickletimeslice.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadtickletimeslice.c,v
    retrieving revision 1.12
    diff -u -p -r1.12 threadtickletimeslice.c
     
    2323#include <rtems/score/isr.h>
    2424#include <rtems/score/object.h>
    2525#include <rtems/score/priority.h>
     26#include <rtems/score/scheduler.h>
    2627#include <rtems/score/states.h>
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/thread.h>
    void _Thread_Tickle_timeslice( void ) 
    8990         *  currently executing thread is placed at the rear of the
    9091         *  FIFO for this priority and a new heir is selected.
    9192         */
    92         _Thread_Yield_processor();
     93        _Scheduler_Yield( );
    9394        executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
    9495      }
    9596      break;
  • testsuites/sptests/spsize/size.c

    RCS file: /usr1/CVS/rtems/testsuites/sptests/spsize/size.c,v
    retrieving revision 1.68
    diff -u -p -r1.68 size.c
     
    3737#include <rtems/rtems/region.h>
    3838#include <rtems/rtems/sem.h>
    3939#include <rtems/rtems/signal.h>
     40#include <rtems/score/scheduler.h>
    4041#include <rtems/score/sysstate.h>
    4142#include <rtems/score/thread.h>
    4243#include <rtems/rtems/timer.h>
     
    4950#include <unistd.h>
    5051#include <tmacros.h>
    5152
     53#include "system.h"
     54
    5255/* external function prototypes */
    5356int getint( void );
    5457void size_rtems(int mode);
    void print_formula(void); 
    6467 */
    6568#define  HEAP_OVHD        16    /* wasted heap space per task stack */
    6669#define  NAME_PTR_SIZE     8    /* size of name and pointer table entries */
    67 #define  READYCHAINS_SIZE  \
     70
     71#if CONFIGURE_SCHEDULER_POLICY == _Scheduler_PRIORITY
     72  #include <rtems/score/prioritybitmap.h>
     73
     74  /* Priority scheduling uninitialized (globals) consumption */
     75  #define SCHEDULER_OVHD          ((sizeof _Scheduler)              + \
     76                                   (sizeof _Priority_Major_bit_map) + \
     77                                   (sizeof _Priority_Bit_map))
     78
     79  /* Priority scheduling per-thread consumption. Gets
     80   * included in the PER_TASK consumption. */
     81  #define SCHEDULER_TASK_WKSP     (sizeof(Scheduler_priority_Per_thread))
     82
     83  /* Priority scheduling workspace consumption
     84   *
     85   * Include allocation of ready queue.  Pointers are already counted by
     86   * including _Scheduler in SCHEDULER_OVHD.
     87   */
     88  #define  SCHEDULER_WKSP_SIZE  \
    6889    ((RTEMS_MAXIMUM_PRIORITY + 1) * sizeof(Chain_Control ))
     90#endif
    6991
    7092#define PER_TASK      \
    7193     (long) (sizeof (Thread_Control) + \
    72       NAME_PTR_SIZE + HEAP_OVHD + sizeof( RTEMS_API_Control ))
     94      NAME_PTR_SIZE + HEAP_OVHD + sizeof( RTEMS_API_Control ) + \
     95      SCHEDULER_TASK_WKSP )
    7396#define PER_SEMAPHORE \
    7497     (long) (sizeof (Semaphore_Control) + NAME_PTR_SIZE)
    7598#define PER_TIMER     \
    int initialized = 0; 
    159182 *
    160183 *    + Object MP
    161184 *      - Global Object CB's
    162  *    + Thread
    163  *      - Ready Chain
    164185 *    + Thread MP
    165186 *      - Proxies Chain
     187 *    + Scheduler
     188 *      - Ready queue
    166189 *    + Interrupt Manager
    167190 *      - Interrupt Stack
    168191 *    + Timer Manager
    int initialized = 0; 
    195218 *  The following calculates the overhead needed by RTEMS from the
    196219 *  Workspace Area.
    197220 */
    198 sys_req = SYSTEM_TASKS     +     /* MPCI Receive Server and IDLE */
    199           NAME_PTR_SIZE    +     /* Task Overhead */
    200           READYCHAINS_SIZE +     /* Ready Chains */
    201           NAME_PTR_SIZE    +     /* Timer Overhead */
    202           NAME_PTR_SIZE    +     /* Semaphore Overhead */
    203           NAME_PTR_SIZE    +     /* Message Queue Overhead */
    204           NAME_PTR_SIZE    +     /* Region Overhead */
    205           NAME_PTR_SIZE    +     /* Partition Overhead */
    206           NAME_PTR_SIZE    +     /* Dual-Ported Memory Overhead */
    207           NAME_PTR_SIZE    +     /* Rate Monotonic Overhead */
    208           NAME_PTR_SIZE    +     /* Extension Overhead */
    209           PER_NODE;              /* Extra Gobject Table */
     221sys_req = SYSTEM_TASKS        +     /* MPCI Receive Server and IDLE */
     222          NAME_PTR_SIZE       +     /* Task Overhead */
     223          SCHEDULER_WKSP_SIZE +     /* Scheduler Overhead */
     224          NAME_PTR_SIZE       +     /* Timer Overhead */
     225          NAME_PTR_SIZE       +     /* Semaphore Overhead */
     226          NAME_PTR_SIZE       +     /* Message Queue Overhead */
     227          NAME_PTR_SIZE       +     /* Region Overhead */
     228          NAME_PTR_SIZE       +     /* Partition Overhead */
     229          NAME_PTR_SIZE       +     /* Dual-Ported Memory Overhead */
     230          NAME_PTR_SIZE       +     /* Rate Monotonic Overhead */
     231          NAME_PTR_SIZE       +     /* Extension Overhead */
     232          PER_NODE;                 /* Extra Gobject Table */
    210233
    211234uninitialized =
    212235/*address.h*/   0                                         +
    uninitialized = 
    311334
    312335/*percpu.h*/    (sizeof _Per_CPU_Information)             +
    313336
    314 /*priority.h*/  (sizeof _Priority_Major_bit_map)          +
    315                 (sizeof _Priority_Bit_map)                +
    316 
    317337/*ratemon.h*/   (sizeof _Rate_monotonic_Information)      +
    318338
    319339/*region.h*/    (sizeof _Region_Information)              +
    uninitialized = 
    324344
    325345/*rtems.h*/     /* Not applicable */
    326346
     347/*scheduler.h*/ SCHEDULER_OVHD                            +
     348
    327349/*sem.h*/       (sizeof _Semaphore_Information)           +
    328350
    329351#if defined(RTEMS_MULTIPROCESSING)
    uninitialized = 
    355377                (sizeof _Thread_Dispatch_disable_level)   +
    356378                (sizeof _Thread_Maximum_extensions)       +
    357379                (sizeof _Thread_Ticks_per_timeslice)      +
    358                 (sizeof _Thread_Ready_chain)              +
    359380                (sizeof _Thread_Executing)                +
    360381                (sizeof _Thread_Heir)                     +
    361382#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1)
  • testsuites/tmtests/tm26/task1.c

    RCS file: /usr1/CVS/rtems/testsuites/tmtests/tm26/task1.c,v
    retrieving revision 1.32
    diff -u -p -r1.32 task1.c
    rtems_task Middle_task( 
    242242  Middle_tcb   = _Thread_Executing;
    243243
    244244  _Thread_Executing =
    245         (Thread_Control *) _Chain_First(&_Thread_Ready_chain[LOW_PRIORITY]);
     245        (Thread_Control *)
     246        _Chain_First(&_Scheduler.ready_queues.Priority[LOW_PRIORITY]);
    246247
    247248  /* do not force context switch */
    248249
    rtems_task Low_task( 
    279280  context_switch_another_task_time = benchmark_timer_read();
    280281
    281282  _Thread_Executing =
    282         (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP1_PRIORITY]);
     283        (Thread_Control *)
     284        _Chain_First(&_Scheduler.ready_queues.Priority[FP1_PRIORITY]);
    283285
    284286  /* do not force context switch */
    285287
    rtems_task Floating_point_task_1( 
    306308  executing = _Thread_Executing;
    307309
    308310  _Thread_Executing =
    309         (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP2_PRIORITY]);
     311        (Thread_Control *)
     312        _Chain_First(&_Scheduler.ready_queues.Priority[FP2_PRIORITY]);
    310313
    311314  /* do not force context switch */
    312315
    rtems_task Floating_point_task_1( 
    329332  executing = _Thread_Executing;
    330333
    331334  _Thread_Executing =
    332        (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP2_PRIORITY]);
     335       (Thread_Control *)
     336       _Chain_First(&_Scheduler.ready_queues.Priority[FP2_PRIORITY]);
    333337
    334338  /* do not force context switch */
    335339
    rtems_task Floating_point_task_2( 
    358362  executing = _Thread_Executing;
    359363
    360364  _Thread_Executing =
    361        (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP1_PRIORITY]);
     365       (Thread_Control *)
     366       _Chain_First(&_Scheduler.ready_queues.Priority[FP1_PRIORITY]);
    362367
    363368  FP_LOAD( 1.0 );
    364369
  • testsuites/tmtests/tm27/task1.c

    RCS file: /usr1/CVS/rtems/testsuites/tmtests/tm27/task1.c,v
    retrieving revision 1.29
    diff -u -p -r1.29 task1.c
    rtems_task Task_1( 
    170170
    171171  _Thread_Dispatch_disable_level = 0;
    172172
    173   _Thread_Heir = (rtems_tcb *) _Chain_Last(&_Thread_Ready_chain[LOW_PRIORITY]);
     173  _Thread_Heir = (rtems_tcb *)
     174        _Chain_Last(&_Scheduler.ready_queues.Priority[LOW_PRIORITY]);
    174175
    175176  _Thread_Dispatch_necessary = 1;
    176177
    rtems_task Task_2( 
    227228
    228229  _Thread_Dispatch_disable_level = 0;
    229230
    230   _Thread_Heir = (rtems_tcb *) _Chain_First(&_Thread_Ready_chain[LOW_PRIORITY]);
     231  _Thread_Heir = (rtems_tcb *)
     232      _Chain_First(&_Scheduler.ready_queues.Priority[LOW_PRIORITY]);
    231233
    232234  _Thread_Dispatch_necessary = 1;
    233235