<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-11-24)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-11-24 Gedare Bloom <giddyup44@yahoo.com>

        PR 1647/cpukit
        * posix/src/nanosleep.c, posix/src/sched_yield.c,
        rtems/src/taskwakeafter.c, sapi/include/confdefs.h,
        sapi/include/rtems/config.h, sapi/src/exinit.c, score/Makefile.am,
        score/preinstall.am, score/include/rtems/score/prioritybitmap.h,
        score/include/rtems/score/thread.h,
        score/inline/rtems/score/thread.inl, score/src/thread.c,
        score/src/threadchangepriority.c, score/src/threadclearstate.c,
        score/src/threadclose.c, score/src/threadinitialize.c,
        score/src/threadready.c, score/src/threadresume.c,
        score/src/threadsetpriority.c, score/src/threadsetstate.c,
        score/src/threadsettransient.c, score/src/threadsuspend.c,
        score/src/threadtickletimeslice.c: Refactor scheduler out of thread
        handler to facilitate alternate scheduler implementations.
        * score/src/threadyieldprocessor.c: Removed.
        * score/src/schedulerprioritythreadschedulerupdate.c,
        score/src/schedulerprioritythreadschedulerfree.c,
        score/src/schedulerpriorityblock.c, score/src/scheduler.c,
        score/src/schedulerprioritythreadschedulerallocate.c,
        score/src/schedulerpriorityunblock.c,
        score/src/schedulerpriority.c, score/src/schedulerpriorityyield.c,
        score/include/rtems/score/schedulerpriority.h,
        score/include/rtems/score/scheduler.h,
        score/inline/rtems/score/scheduler.inl,
        score/inline/rtems/score/schedulerpriority.inl: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2654&r2=text&tr2=1.2655&diff_format=h">M</a></td><td width='1%'>1.2655</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/nanosleep.c.diff?r1=text&tr1=1.11&r2=text&tr2=1.12&diff_format=h">M</a></td><td width='1%'>1.12</td><td width='100%'>cpukit/posix/src/nanosleep.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/sched_yield.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>cpukit/posix/src/sched_yield.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/rtems/src/taskwakeafter.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/rtems/src/taskwakeafter.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/include/confdefs.h.diff?r1=text&tr1=1.150&r2=text&tr2=1.151&diff_format=h">M</a></td><td width='1%'>1.151</td><td width='100%'>cpukit/sapi/include/confdefs.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/include/rtems/config.h.diff?r1=text&tr1=1.53&r2=text&tr2=1.54&diff_format=h">M</a></td><td width='1%'>1.54</td><td width='100%'>cpukit/sapi/include/rtems/config.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/src/exinit.c.diff?r1=text&tr1=1.55&r2=text&tr2=1.56&diff_format=h">M</a></td><td width='1%'>1.56</td><td width='100%'>cpukit/sapi/src/exinit.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/Makefile.am.diff?r1=text&tr1=1.88&r2=text&tr2=1.89&diff_format=h">M</a></td><td width='1%'>1.89</td><td width='100%'>cpukit/score/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/include/rtems/score/prioritybitmap.h.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>cpukit/score/include/rtems/score/prioritybitmap.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/include/rtems/score/scheduler.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/include/rtems/score/scheduler.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/include/rtems/score/schedulerpriority.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/include/rtems/score/schedulerpriority.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/include/rtems/score/thread.h.diff?r1=text&tr1=1.97&r2=text&tr2=1.98&diff_format=h">M</a></td><td width='1%'>1.98</td><td width='100%'>cpukit/score/include/rtems/score/thread.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/inline/rtems/score/scheduler.inl?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/inline/rtems/score/scheduler.inl</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/inline/rtems/score/schedulerpriority.inl?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/inline/rtems/score/schedulerpriority.inl</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/inline/rtems/score/thread.inl.diff?r1=text&tr1=1.43&r2=text&tr2=1.44&diff_format=h">M</a></td><td width='1%'>1.44</td><td width='100%'>cpukit/score/inline/rtems/score/thread.inl</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/preinstall.am.diff?r1=text&tr1=1.24&r2=text&tr2=1.25&diff_format=h">M</a></td><td width='1%'>1.25</td><td width='100%'>cpukit/score/preinstall.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/scheduler.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/scheduler.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerpriority.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerpriority.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerpriorityblock.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerpriorityblock.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerpriorityschedule.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerpriorityschedule.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerprioritythreadschedulerallocate.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerprioritythreadschedulerallocate.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerprioritythreadschedulerfree.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerprioritythreadschedulerfree.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerprioritythreadschedulerupdate.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerprioritythreadschedulerupdate.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerpriorityunblock.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerpriorityunblock.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulerpriorityyield.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/schedulerpriorityyield.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/thread.c.diff?r1=text&tr1=1.64&r2=text&tr2=1.65&diff_format=h">M</a></td><td width='1%'>1.65</td><td width='100%'>cpukit/score/src/thread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadchangepriority.c.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>cpukit/score/src/threadchangepriority.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadclearstate.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/score/src/threadclearstate.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadclose.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/score/src/threadclose.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadinitialize.c.diff?r1=text&tr1=1.39&r2=text&tr2=1.40&diff_format=h">M</a></td><td width='1%'>1.40</td><td width='100%'>cpukit/score/src/threadinitialize.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadready.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>cpukit/score/src/threadready.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadresume.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/score/src/threadresume.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadsetpriority.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>cpukit/score/src/threadsetpriority.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadsetstate.c.diff?r1=text&tr1=1.8&r2=text&tr2=1.9&diff_format=h">M</a></td><td width='1%'>1.9</td><td width='100%'>cpukit/score/src/threadsetstate.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadsettransient.c.diff?r1=text&tr1=1.6&r2=text&tr2=1.7&diff_format=h">M</a></td><td width='1%'>1.7</td><td width='100%'>cpukit/score/src/threadsettransient.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadsuspend.c.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>cpukit/score/src/threadsuspend.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadtickletimeslice.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/score/src/threadtickletimeslice.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2654 rtems/cpukit/ChangeLog:1.2655
--- rtems/cpukit/ChangeLog:1.2654       Tue Nov 23 17:44:06 2010
+++ rtems/cpukit/ChangeLog      Wed Nov 24 09:51:26 2010
</font><font color='#997700'>@@ -1,3 +1,31 @@
</font><font color='#000088'>+2010-11-24    Gedare Bloom <giddyup44@yahoo.com>
+
+       PR 1647/cpukit
+       * posix/src/nanosleep.c, posix/src/sched_yield.c,
+       rtems/src/taskwakeafter.c, sapi/include/confdefs.h,
+       sapi/include/rtems/config.h, sapi/src/exinit.c, score/Makefile.am,
+       score/preinstall.am, score/include/rtems/score/prioritybitmap.h,
+       score/include/rtems/score/thread.h,
+       score/inline/rtems/score/thread.inl, score/src/thread.c,
+       score/src/threadchangepriority.c, score/src/threadclearstate.c,
+       score/src/threadclose.c, score/src/threadinitialize.c,
+       score/src/threadready.c, score/src/threadresume.c,
+       score/src/threadsetpriority.c, score/src/threadsetstate.c,
+       score/src/threadsettransient.c, score/src/threadsuspend.c,
+       score/src/threadtickletimeslice.c: Refactor scheduler out of thread
+       handler to facilitate alternate scheduler implementations.
+       * score/src/threadyieldprocessor.c: Removed.
+       * score/src/schedulerprioritythreadschedulerupdate.c,
+       score/src/schedulerprioritythreadschedulerfree.c,
+       score/src/schedulerpriorityblock.c, score/src/scheduler.c,
+       score/src/schedulerprioritythreadschedulerallocate.c,
+       score/src/schedulerpriorityunblock.c,
+       score/src/schedulerpriority.c, score/src/schedulerpriorityyield.c,
+       score/include/rtems/score/schedulerpriority.h,
+       score/include/rtems/score/scheduler.h,
+       score/inline/rtems/score/scheduler.inl,<span style="background-color: #FF0000"> </span>
+       score/inline/rtems/score/schedulerpriority.inl: New files.
+
</font> 2010-11-23        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
        * score/src/iterateoverthreads.c, libmisc/cpuuse/cpuusagereport.c:

<font color='#006600'>diff -u rtems/cpukit/posix/src/nanosleep.c:1.11 rtems/cpukit/posix/src/nanosleep.c:1.12
--- rtems/cpukit/posix/src/nanosleep.c:1.11     Tue Jun 22 10:36:06 2010
+++ rtems/cpukit/posix/src/nanosleep.c  Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -18,6 +18,7 @@
</font> 
 #include <rtems/system.h>
 #include <rtems/score/isr.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
 
<font color='#997700'>@@ -56,7 +57,7 @@
</font> 
   if ( !ticks ) {
     _Thread_Disable_dispatch();
<font color='#880000'>-      _Thread_Yield_processor();
</font><font color='#000088'>+      _Scheduler_Yield();
</font>     _Thread_Enable_dispatch();
     if ( rmtp ) {
        rmtp->tv_sec = 0;

<font color='#006600'>diff -u rtems/cpukit/posix/src/sched_yield.c:1.1 rtems/cpukit/posix/src/sched_yield.c:1.2
--- rtems/cpukit/posix/src/sched_yield.c:1.1    Thu Dec 13 10:52:21 2007
+++ rtems/cpukit/posix/src/sched_yield.c        Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -19,6 +19,7 @@
</font> #include <errno.h>
 
 #include <rtems/system.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/tod.h>
 #include <rtems/score/thread.h>
 #include <rtems/seterr.h>
<font color='#997700'>@@ -28,7 +29,7 @@
</font> int sched_yield( void )
 {
   _Thread_Disable_dispatch();
<font color='#880000'>-    _Thread_Yield_processor();
</font><font color='#000088'>+    _Scheduler_Yield();
</font>   _Thread_Enable_dispatch();
   return 0;
 }

<font color='#006600'>diff -u rtems/cpukit/rtems/src/taskwakeafter.c:1.4 rtems/cpukit/rtems/src/taskwakeafter.c:1.5
--- rtems/cpukit/rtems/src/taskwakeafter.c:1.4  Tue Jan 18 03:03:45 2005
+++ rtems/cpukit/rtems/src/taskwakeafter.c      Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -21,6 +21,7 @@
</font> #include <rtems/rtems/support.h>
 #include <rtems/rtems/modes.h>
 #include <rtems/score/object.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/stack.h>
 #include <rtems/score/states.h>
 #include <rtems/rtems/tasks.h>
<font color='#997700'>@@ -52,7 +53,7 @@
</font> {
   _Thread_Disable_dispatch();
     if ( ticks == 0 ) {
<font color='#880000'>-      _Thread_Yield_processor();
</font><font color='#000088'>+      _Scheduler_Yield();
</font>     } else {
       _Thread_Set_state( _Thread_Executing, STATES_DELAYING );
       _Watchdog_Initialize(

<font color='#006600'>diff -u rtems/cpukit/sapi/include/confdefs.h:1.150 rtems/cpukit/sapi/include/confdefs.h:1.151
--- rtems/cpukit/sapi/include/confdefs.h:1.150  Tue Nov 16 13:14:10 2010
+++ rtems/cpukit/sapi/include/confdefs.h        Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -535,6 +535,116 @@
</font> #endif
 
 /*
<font color='#000088'>+ * Scheduler configuration.
+ *
+ * The scheduler configuration allows an application to select the<span style="background-color: #FF0000"> </span>
+ * scheduling policy to use.  The supported configurations are:
+ *  CONFIGURE_SCHEDULER_USER
+ *  CONFIGURE_SCHEDULER_PRIORITY
+ *<span style="background-color: #FF0000"> </span>
+ * If no configuration is specified by the application, then<span style="background-color: #FF0000"> </span>
+ * CONFIGURE_SCHEDULER_PRIORITY is assumed to be the default.
+ *
+ * An application can define its own scheduling policy by defining
+ * CONFIGURE_SCHEDULER_USER and CONFIGURE_SCHEDULER_ENTRY_USER to point
+ * to an initialization routine.  Note: CONFIGURE_SCHEDULER_USER is not<span style="background-color: #FF0000"> </span>
+ * fully supported, since it has no per-thread field.
+ *
+ * To add a new scheduler:
+ */
+#include <rtems/score/scheduler.h>
+
+#if defined(CONFIGURE_SCHEDULER_USER) && \
+    !defined(CONFIGURE_SCHEDULER_ENTRY_USER)
+  #error "CONFIGURE_ERROR: CONFIGURE_SCHEDULER_USER without CONFIGURE_SCHEDULER_ENTRY_USER"
+#endif
+
+/* enable all RTEMS-provided schedulers */
+#if defined(CONFIGURE_SCHEDULER_ALL)
+  #define CONFIGURE_SCHEDULER_PRIORITY
+#endif
+
+/* If no scheduler is specified, the priority scheduler is default. */
+#if !defined(CONFIGURE_SCHEDULER_USER) && \
+    !defined(CONFIGURE_SCHEDULER_PRIORITY)
+  #define CONFIGURE_SCHEDULER_PRIORITY
+  #define CONFIGURE_SCHEDULER_POLICY _Scheduler_PRIORITY
+#endif
+
+/*
+ * If a user scheduler is specified and no policy is set,<span style="background-color: #FF0000"> </span>
+ * the user scheduler is the default policy.
+ */
+#if defined(CONFIGURE_SCHEDULER_USER) && \
+    !defined(CONFIGURE_SCHEDULER_POLICY)
+  #define CONFIGURE_SCHEDULER_POLICY _Scheduler_USER
+#endif
+
+/*<span style="background-color: #FF0000"> </span>
+ * Check for priority scheduler next, as it is the default policy if there
+ * is no CONFIGURE_SCHEDULER_POLICY set and no USER scheduler provided.
+ */
+#if defined(CONFIGURE_SCHEDULER_PRIORITY)
+  #include <rtems/score/schedulerpriority.h>
+  #define CONFIGURE_SCHEDULER_ENTRY_PRIORITY { _Scheduler_priority_Initialize }
+  #if !defined(CONFIGURE_SCHEDULER_POLICY)
+    #define CONFIGURE_SCHEDULER_POLICY _Scheduler_PRIORITY
+  #endif
+
+  /**
+   * define the memory used by the priority scheduler
+   */
+  #define CONFIGURE_MEMORY_SCHEDULER_PRIORITY ( \
+    _Configure_From_workspace( \
+      ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) ) \
+  )
+  #define CONFIGURE_MEMORY_PER_TASK_SCHEDULER_PRIORITY ( \
+    _Configure_From_workspace(sizeof(Scheduler_priority_Per_thread)) )
+#endif
+
+/*<span style="background-color: #FF0000"> </span>
+ * Set up the scheduler table.  The scheduling code indexes this table to<span style="background-color: #FF0000"> </span>
+ * invoke the correct scheduling implementation. The scheduler to use is<span style="background-color: #FF0000"> </span>
+ * determined by the Configuration.scheduler_policy field, which is set
+ * by CONFIGURE_SCHEDULER_POLICY.  If a particular scheduler is not enabled,
+ * an empty entry is included in its entry in the scheduler table.
+ */
+
+  /**
+   * An empty scheduler entry
+   */
+  #define CONFIGURE_SCHEDULER_NULL { NULL }
+
+#ifdef CONFIGURE_INIT
+  /* the table of available schedulers. */
+  const Scheduler_Table_t _Scheduler_Table[] = {
+    #if defined(CONFIGURE_SCHEDULER_USER) && \
+        defined(CONFIGURE_SCHEDULER_ENTRY_USER)
+      CONFIGURE_SCHEDULER_ENTRY_USER,
+    #else
+      CONFIGURE_SCHEDULER_NULL,
+    #endif
+    #if defined(CONFIGURE_SCHEDULER_PRIORITY) && \
+        defined(CONFIGURE_SCHEDULER_ENTRY_PRIORITY)
+      CONFIGURE_SCHEDULER_ENTRY_PRIORITY,
+    #else
+      CONFIGURE_SCHEDULER_NULL,
+    #endif
+  };
+#endif
+
+/**
+ * Define the memory overhead for the scheduler
+ */
+#define CONFIGURE_MEMORY_FOR_SCHEDULER ( \
+    CONFIGURE_MEMORY_SCHEDULER_PRIORITY \
+  )
+
+#define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER ( \
+    CONFIGURE_MEMORY_PER_TASK_SCHEDULER_PRIORITY \
+  )
+
+/*
</font>  *  If you said the IDLE task was going to do application initialization
  *  and didn't override the IDLE body, then something is amiss.
  */
<font color='#997700'>@@ -1607,7 +1717,8 @@
</font>    (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \
     CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API + \
     CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \
<font color='#880000'>-    CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API))  + \
</font><font color='#000088'>+    CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
+    CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER))  + \
</font>   _Configure_From_workspace( \
     _Configure_Max_Objects(_number_FP_tasks) * CONTEXT_FP_SIZE) + \
   _Configure_From_workspace( \
<font color='#997700'>@@ -1705,13 +1816,6 @@
</font>   _Configure_Object_RAM(1, sizeof(API_Mutex_Control))
 
 /**
<font color='#880000'>- *  This defines the memory used by the thread ready chains.  There is
- *  one chain per priority.
- */
-#define CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS \
-    _Configure_From_workspace( \
-        ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) )
-/**
</font>  *  This defines the amount of memory reserved for the IDLE task
  *  control structures and stack.
  */
<font color='#997700'>@@ -1724,7 +1828,7 @@
</font>  */
 #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
   ( CONFIGURE_MEMORY_FOR_IDLE_TASK +                /* IDLE and stack */ \
<font color='#880000'>-    CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS +     /* Ready chains */ \
</font><font color='#000088'>+    CONFIGURE_MEMORY_FOR_SCHEDULER +                /* Scheduler */ \
</font>     CONFIGURE_INTERRUPT_VECTOR_TABLE +             /* interrupt vectors */ \
     CONFIGURE_INTERRUPT_STACK_MEMORY +             /* interrupt stack */ \
     CONFIGURE_API_MUTEX_MEMORY                     /* allocation mutex */ \
<font color='#997700'>@@ -2005,6 +2109,7 @@
</font>     CONFIGURE_MAXIMUM_USER_EXTENSIONS,        /* maximum dynamic extensions */
     CONFIGURE_MICROSECONDS_PER_TICK,          /* microseconds per clock tick */
     CONFIGURE_TICKS_PER_TIMESLICE,            /* ticks per timeslice quantum */
<font color='#000088'>+    CONFIGURE_SCHEDULER_POLICY,               /* scheduling policy */
</font>     CONFIGURE_IDLE_TASK_BODY,                 /* user's IDLE task */
     CONFIGURE_IDLE_TASK_STACK_SIZE,           /* IDLE task stack size */
     CONFIGURE_INTERRUPT_STACK_SIZE,           /* interrupt stack size */

<font color='#006600'>diff -u rtems/cpukit/sapi/include/rtems/config.h:1.53 rtems/cpukit/sapi/include/rtems/config.h:1.54
--- rtems/cpukit/sapi/include/rtems/config.h:1.53       Thu Jun 17 23:04:05 2010
+++ rtems/cpukit/sapi/include/rtems/config.h    Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -118,6 +118,10 @@
</font>    */
   uint32_t                       ticks_per_timeslice;
 
<font color='#000088'>+  /** This field specifies the scheduling policy to use.
+   */
+  uint32_t                       scheduler_policy;
+
</font>   /** This element points to the BSP's optional idle task which may override
    *  the default one provided with RTEMS.
    */

<font color='#006600'>diff -u rtems/cpukit/sapi/src/exinit.c:1.55 rtems/cpukit/sapi/src/exinit.c:1.56
--- rtems/cpukit/sapi/src/exinit.c:1.55 Thu Jul 29 12:52:09 2010
+++ rtems/cpukit/sapi/src/exinit.c      Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -42,7 +42,7 @@
</font> #include <rtems/score/mpci.h>
 #endif
 #include <rtems/score/priority.h>
<font color='#880000'>-#include <rtems/score/prioritybitmap.h>
</font><font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
 #include <rtems/score/userext.h>
<font color='#997700'>@@ -131,6 +131,8 @@
</font> 
   _Thread_Handler_initialization();
 
<font color='#000088'>+  _Scheduler_Handler_initialization();
+
</font>   #if defined(RTEMS_MULTIPROCESSING)
     _Objects_MP_Handler_initialization();
     _MPCI_Handler_initialization( RTEMS_TIMEOUT );

<font color='#006600'>diff -u rtems/cpukit/score/Makefile.am:1.88 rtems/cpukit/score/Makefile.am:1.89
--- rtems/cpukit/score/Makefile.am:1.88 Mon Aug 23 11:10:53 2010
+++ rtems/cpukit/score/Makefile.am      Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -26,6 +26,7 @@
</font>     include/rtems/score/interr.h include/rtems/score/isr.h \
     include/rtems/score/object.h include/rtems/score/percpu.h \
     include/rtems/score/priority.h include/rtems/score/prioritybitmap.h \
<font color='#000088'>+    include/rtems/score/scheduler.h include/rtems/score/schedulerpriority.h \
</font>     include/rtems/score/stack.h include/rtems/score/states.h \
     include/rtems/score/sysstate.h include/rtems/score/thread.h \
     include/rtems/score/threadq.h include/rtems/score/threadsync.h \
<font color='#997700'>@@ -54,6 +55,7 @@
</font>     inline/rtems/score/coresem.inl inline/rtems/score/heap.inl \
     inline/rtems/score/isr.inl inline/rtems/score/object.inl \
     inline/rtems/score/priority.inl inline/rtems/score/prioritybitmap.inl \
<font color='#000088'>+    inline/rtems/score/scheduler.inl inline/rtems/score/schedulerpriority.inl \
</font>     inline/rtems/score/stack.inl inline/rtems/score/states.inl \
     inline/rtems/score/sysstate.inl inline/rtems/score/thread.inl \
     inline/rtems/score/threadq.inl inline/rtems/score/tod.inl \
<font color='#997700'>@@ -137,6 +139,19 @@
</font>     src/objectgetinfo.c src/objectgetinfoid.c src/objectapimaximumclass.c \
     src/objectnamespaceremove.c
 
<font color='#000088'>+## SCHEDULER_C_FILES
+libscore_a_SOURCES += src/scheduler.c
+
+## SCHEDULERPRIORITY_C_FILES
+libscore_a_SOURCES += src/schedulerpriority.c \
+                                                                                       src/schedulerpriorityblock.c \
+                      src/schedulerprioritythreadschedulerallocate.c \
+                      src/schedulerprioritythreadschedulerfree.c \
+                      src/schedulerprioritythreadschedulerupdate.c \
+                                                                                       src/schedulerpriorityschedule.c \
+                                                                                       src/schedulerpriorityunblock.c \
+                                                                                       src/schedulerpriorityyield.c
+
</font> ## PROTECTED_HEAP_C_FILES
 libscore_a_SOURCES += src/pheapallocate.c \
     src/pheapextend.c src/pheapfree.c src/pheapgetsize.c \
<font color='#997700'>@@ -153,7 +168,7 @@
</font>     src/threadsetstate.c src/threadsettransient.c \
     src/threadstackallocate.c src/threadstackfree.c src/threadstart.c \
     src/threadstartmultitasking.c src/threadsuspend.c \
<font color='#880000'>-    src/threadtickletimeslice.c src/threadyieldprocessor.c \
</font><font color='#000088'>+    src/threadtickletimeslice.c \
</font>     src/iterateoverthreads.c src/threadblockingoperationcancel.c
 
 ## THREADQ_C_FILES

<font color='#006600'>diff -u rtems/cpukit/score/include/rtems/score/prioritybitmap.h:1.1 rtems/cpukit/score/include/rtems/score/prioritybitmap.h:1.2
--- rtems/cpukit/score/include/rtems/score/prioritybitmap.h:1.1 Thu Jul 29 12:52:10 2010
+++ rtems/cpukit/score/include/rtems/score/prioritybitmap.h     Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -37,18 +37,17 @@
</font> 
 #include <rtems/score/priority.h>
 
<font color='#000088'>+
</font> /*<span style="background-color: #FF0000"> </span>
<font color='#880000'>- * TODO:<span style="background-color: #FF0000"> </span>
- * These should only be instantiated if using the bit map handler.  The<span style="background-color: #FF0000"> </span>
- * logical place for this is in confdefs.h when a scheduler that uses the<span style="background-color: #FF0000"> </span>
- * bit map handler is configured.
</font><font color='#000088'>+ * The Priority_bit_map_Control variables are instantiated only<span style="background-color: #FF0000"> </span>
+ * if using the bit map handler.
</font>  */
 
 /**
  *  Each sixteen bit entry in this array is associated with one of
  *  the sixteen entries in the Priority Bit map.
  */
<font color='#880000'>-SCORE_EXTERN volatile Priority_bit_map_Control _Priority_Major_bit_map;
</font><font color='#000088'>+extern volatile Priority_bit_map_Control _Priority_Major_bit_map;
</font> 
 /** Each bit in the Priority Bitmap indicates whether or not there are
  *  threads ready at a particular priority.  The mapping of
<font color='#997700'>@@ -56,7 +55,7 @@
</font>  *  dependent as is the value of each bit used to indicate that
  *  threads are ready at that priority.
  */
<font color='#880000'>-SCORE_EXTERN Priority_bit_map_Control
</font><font color='#000088'>+extern Priority_bit_map_Control
</font>                _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
 
 /*

<font color='#006600'>diff -u /dev/null rtems/cpukit/score/include/rtems/score/scheduler.h:1.1
--- /dev/null   Wed Nov 24 10:10:42 2010
+++ rtems/cpukit/score/include/rtems/score/scheduler.h  Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -0,0 +1,156 @@
</font><font color='#000088'>+/**
+ *  @file  rtems/score/scheduler.h
+ *
+ *  This include file contains all the constants and structures associated
+ *  with the scheduler.
+ */
+
+/*
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULER_H
+#define _RTEMS_SCORE_SCHEDULER_H
+
+/**
+ *  @defgroup ScoreScheduler Scheduler Handler
+ *
+ *  This handler encapsulates functionality related to managing sets of threads
+ *  that are ready for execution.
+ */
+/**@{*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rtems/score/percpu.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/priority.h>
+#include <rtems/score/prioritybitmap.h>
+
+/*<span style="background-color: #FF0000"> </span>
+ * These defines are used to set the scheduler_policy value. The values<span style="background-color: #FF0000"> </span>
+ * must correspond directly with the order of the fields in the scheduler
+ * table (Scheduler_Table_t), because the Configuration.scheduler_policy<span style="background-color: #FF0000"> </span>
+ * field is used to index the scheduler table.
+ */
+#define _Scheduler_USER     (0)
+#define _Scheduler_PRIORITY (1)
+
+typedef struct Scheduler_Control_struct Scheduler_Control;
+
+/*
+ * The Scheduler_Table_t type defines the scheduler initialization table,<span style="background-color: #FF0000"> </span>
+ * which is set up by confdefs.h based on the user's choice of scheduler<span style="background-color: #FF0000"> </span>
+ * policy.
+ */
+typedef struct {
+  void ( *scheduler_init )( Scheduler_Control * );
+} Scheduler_Table_t;
+
+/* instantiated and initialized in confdefs.h */
+extern const Scheduler_Table_t          _Scheduler_Table[];<span style="background-color: #FF0000"> </span>
+
+/**
+ * The following Scheduler_Per_thread_xxx structures are used to<span style="background-color: #FF0000"> </span>
+ * hold per-thread data used by the scheduler.  Thread_Control->scheduler is a<span style="background-color: #FF0000"> </span>
+ * union of pointers, one for each of the following structures.  The
+ * scheduler->xxx field points to an instantion of one of these structures,<span style="background-color: #FF0000"> </span>
+ * which is allocated from the workspace during _Thread_Start.
+ */
+
+/**
+ * Per-thread data related to the _Scheduler_PRIORITY scheduling policy.
+ */
+typedef struct {
+  /** This field points to the Ready FIFO for this thread's priority. */
+  Chain_Control                        *ready_chain;
+
+  /** This field contains precalculated priority map indices. */
+  Priority_bit_map_Information          Priority_map;
+} Scheduler_priority_Per_thread;
+
+/**
+ * function jump table that holds pointers to the functions that<span style="background-color: #FF0000"> </span>
+ * implement specific schedulers.
+ */
+typedef struct {
+  /** Implements the scheduling decision logic (policy). */
+  void ( *schedule ) ( Scheduler_Control * );
+
+  /** Voluntarily yields the processor per the scheduling policy. */
+  void ( *yield ) ( Scheduler_Control * );
+
+  /** Removes the given thread from scheduling decisions. */
+  void ( *block ) ( Scheduler_Control *, Thread_Control * );
+
+  /** Adds the given thread to scheduling decisions. */
+  void ( *unblock ) ( Scheduler_Control *, Thread_Control * );
+
+  /** allocates the scheduler field of the given thread */
+  void * ( *scheduler_allocate ) ( Scheduler_Control *, Thread_Control * );
+
+  /** frees the scheduler field of the given thread */
+  void ( *scheduler_free ) ( Scheduler_Control *, Thread_Control * );
+<span style="background-color: #FF0000">  </span>
+  /** updates the scheduler field of the given thread -- primarily used<span style="background-color: #FF0000"> </span>
+   * when changing the thread's priority. */
+  void ( *scheduler_update ) ( Scheduler_Control *, Thread_Control * );
+} Scheduler_Operations;
+
+/**
+ * This is the structure used to manage the scheduler.
+ */
+struct Scheduler_Control_struct {
+  /**<span style="background-color: #FF0000"> </span>
+   *  This union contains the pointer to the data structure used to manage<span style="background-color: #FF0000"> </span>
+   *  the ready set of tasks. The pointer varies based upon the type of<span style="background-color: #FF0000"> </span>
+   *  ready queue required by the scheduler.
+   */
+  union {
+    /**<span style="background-color: #FF0000"> </span>
+     * This is the set of lists (an array of Chain_Control) for<span style="background-color: #FF0000"> </span>
+     * priority scheduling.<span style="background-color: #FF0000"> </span>
+     */
+    Chain_Control            *Priority;
+
+  } ready_queues;
+
+  /** The jump table for scheduler-specific functions */
+  Scheduler_Operations                  operations;
+};
+
+/**
+ *  The _Scheduler holds the structures used to manage the
+ *  scheduler.
+ *
+ * @note Can we make this per-cpu? then _Scheduler will be a macro.
+ */
+SCORE_EXTERN Scheduler_Control          _Scheduler;
+
+/**
+ *  This routine initializes the scheduler to the policy chosen by the user<span style="background-color: #FF0000"> </span>
+ *  through confdefs, or to the priority scheduler with ready chains by
+ *  default.
+ */
+void _Scheduler_Handler_initialization( void );
+
+#ifndef __RTEMS_APPLICATION__
+#include <rtems/score/scheduler.inl>
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+
+#endif
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/include/rtems/score/schedulerpriority.h:1.1
--- /dev/null   Wed Nov 24 10:10:42 2010
+++ rtems/cpukit/score/include/rtems/score/schedulerpriority.h  Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -0,0 +1,117 @@
</font><font color='#000088'>+/**
+ *  @file  rtems/score/schedulerpriority.h
+ *
+ *  This include file contains all the constants and structures associated
+ *  with the manipulation of threads for the priority-based scheduler.
+ */
+
+/*
+ *  Copryight (c) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULERPRIORITY_H
+#define _RTEMS_SCORE_SCHEDULERPRIORITY_H
+
+/**
+ *  @addtogroup ScoreScheduler
+ *
+ */
+/**@{*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rtems/score/chain.h>
+#include <rtems/score/priority.h>
+#include <rtems/score/percpu.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/wkspace.h>
+
+/**
+ * This routine initializes the priority scheduler.
+ */
+void _Scheduler_priority_Initialize(
+    Scheduler_Control    *the_scheduler
+);
+
+/**
+ *  This routine removes @a the_thread from the scheduling decision,<span style="background-color: #FF0000"> </span>
+ *  that is, removes it from the ready queue.  It performs
+ *  any necessary scheduling operations including the selection of
+ *  a new heir thread.
+ */
+void _Scheduler_priority_Block(<span style="background-color: #FF0000"> </span>
+    Scheduler_Control *the_scheduler,
+    Thread_Control    *the_thread<span style="background-color: #FF0000"> </span>
+);
+
+/**
+ *  This kernel routine sets the heir thread to be the next ready thread<span style="background-color: #FF0000"> </span>
+ *  by invoking the_scheduler->ready_queue->operations->first().
+ */
+void _Scheduler_priority_Schedule(
+    Scheduler_Control *the_scheduler
+);
+
+/**
+ * This routine allocates @a the_thread->scheduler.
+ */
+void * _Scheduler_priority_Thread_scheduler_allocate(
+    Scheduler_Control   *the_scheduler,
+    Thread_Control      *the_thread
+);
+
+/**
+ * This routine frees @a the_thread->scheduler.
+ */
+void _Scheduler_priority_Thread_scheduler_free(
+    Scheduler_Control   *the_scheduler,
+    Thread_Control      *the_thread
+);
+
+/**
+ * This routine updates @a the_thread->scheduler based on @a the_scheduler<span style="background-color: #FF0000"> </span>
+ * structures and thread state
+ */
+void _Scheduler_priority_Thread_scheduler_update(
+    Scheduler_Control   *the_scheduler,
+    Thread_Control      *the_thread
+);
+
+/**
+ *  This routine adds @a the_thread to the scheduling decision,<span style="background-color: #FF0000"> </span>
+ *  that is, adds it to the ready queue and<span style="background-color: #FF0000"> </span>
+ *  updates any appropriate scheduling variables, for example the heir thread.
+ */
+void _Scheduler_priority_Unblock(
+    Scheduler_Control *the_scheduler,
+    Thread_Control    *the_thread<span style="background-color: #FF0000"> </span>
+);
+
+/**
+ *  This routine is invoked when a thread wishes to voluntarily
+ *  transfer control of the processor to another thread in the queue.
+ */
+void _Scheduler_priority_Yield(
+    Scheduler_Control *the_scheduler
+);
+
+#ifndef __RTEMS_APPLICATION__
+#include <rtems/score/schedulerpriority.inl>
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+
+#endif
+/* end of include file */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/include/rtems/score/thread.h:1.97 rtems/cpukit/score/include/rtems/score/thread.h:1.98
--- rtems/cpukit/score/include/rtems/score/thread.h:1.97        Thu Jul 29 12:52:10 2010
+++ rtems/cpukit/score/include/rtems/score/thread.h     Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -70,7 +70,7 @@
</font> #endif
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#880000'>-#include <rtems/score/prioritybitmap.h>
</font><font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/stack.h>
 #include <rtems/score/states.h>
 #include <rtems/score/tod.h>
<font color='#997700'>@@ -390,10 +390,10 @@
</font>    *  since it was created.
    */
   Thread_CPU_usage_t                    cpu_time_used;
<font color='#880000'>-  /** This field points to the Ready FIFO for this priority. */
-  Chain_Control                        *ready;
-  /** This field contains precalculated priority map indices. */
-  Priority_bit_map_Information          Priority_map;
</font><font color='#000088'>+  /** This union holds per-thread data for the scheduler and ready queue. */
+  union {
+    Scheduler_priority_Per_thread      *priority;
+  } scheduler;
</font>   /** This field contains information about the starting state of
    *  this thread.
    */
<font color='#997700'>@@ -456,12 +456,6 @@
</font> SCORE_EXTERN uint32_t   _Thread_Ticks_per_timeslice;
 
 /**
<font color='#880000'>- *  The following points to the array of FIFOs used to manage the
- *  set of ready threads.
- */
-SCORE_EXTERN Chain_Control *_Thread_Ready_chain;
-
-/**
</font>  *  The following points to the thread whose floating point
  *  context is currently loaded.
  */
<font color='#997700'>@@ -654,13 +648,6 @@
</font> void _Thread_Tickle_timeslice( void );
 
 /**
<font color='#880000'>- *  This routine is invoked when a thread wishes to voluntarily
- *  transfer control of the processor to another thread of equal
- *  or greater priority.
- */
-void _Thread_Yield_processor( void );
-
-/**
</font>  *  This routine initializes the context of the_thread to its
  *  appropriate starting state.
  */

<font color='#006600'>diff -u /dev/null rtems/cpukit/score/inline/rtems/score/scheduler.inl:1.1
--- /dev/null   Wed Nov 24 10:10:42 2010
+++ rtems/cpukit/score/inline/rtems/score/scheduler.inl Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,139 @@
</font><font color='#000088'>+/**<span style="background-color: #FF0000"> </span>
+ *  @file  rtems/score/scheduler.inl
+ *
+ *  This inline file contains all of the inlined routines associated with
+ *  the manipulation of the scheduler.
+ */
+
+/*
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULER_H
+# error "Never use <rtems/score/scheduler.inl> directly; include <rtems/score/scheduler.h> instead."
+#endif
+
+#ifndef _RTEMS_SCORE_SCHEDULER_INL
+#define _RTEMS_SCORE_SCHEDULER_INL
+
+/**
+ *  @addtogroup ScoreScheduler
+ * @{
+ */
+
+/**
+ * The preferred method to add a new scheduler is to define the jump table<span style="background-color: #FF0000"> </span>
+ * entries and add a case to the _Scheduler_Initialize routine.<span style="background-color: #FF0000"> </span>
+ *
+ * Generic scheduling implementations that rely on the ready queue only can<span style="background-color: #FF0000"> </span>
+ * be found in the _Scheduler_queue_XXX functions.
+ *
+ */
+
+/* Passing the Scheduler_Control* to these functions allows for multiple<span style="background-color: #FF0000"> </span>
+ * scheduler's to exist simultaneously, which could be useful on an SMP<span style="background-color: #FF0000"> </span>
+ * system.  Then remote Schedulers may be accessible.  How to protect such<span style="background-color: #FF0000"> </span>
+ * accesses remains an open problem.
+ */
+
+/** @brief _Scheduler_Schedule
+ *
+ *  This kernel routine implements the scheduling decision logic for<span style="background-color: #FF0000"> </span>
+ *  @a the_scheduler. It does NOT dispatch.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Schedule(
+    Scheduler_Control *the_scheduler<span style="background-color: #FF0000"> </span>
+)
+{
+  the_scheduler->operations.schedule( the_scheduler );
+}
+
+/** @brief _Scheduler_Yield
+ *
+ *  This routine is invoked when a thread wishes to voluntarily
+ *  transfer control of the processor to another thread. This routine
+ *  always operates on the scheduler that 'owns' the currently executing
+ *  thread.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void )
+{
+  _Scheduler.operations.yield( &_Scheduler );
+}
+
+/** @brief _Scheduler_Block
+ *
+ *  This routine removes @a the_thread from the scheduling decision for<span style="background-color: #FF0000"> </span>
+ *  @a the_scheduler. The primary task is to remove the thread from the<span style="background-color: #FF0000"> </span>
+ *  ready queue.  It performs any necessary schedulering operations<span style="background-color: #FF0000"> </span>
+ *  including the selection of a new heir thread.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Block(<span style="background-color: #FF0000"> </span>
+    Scheduler_Control *the_scheduler,
+    Thread_Control    *the_thread<span style="background-color: #FF0000"> </span>
+)
+{
+  the_scheduler->operations.block( the_scheduler, the_thread );
+}
+
+/** @brief _Scheduler_Unblock
+ *
+ *  This routine adds @a the_thread to the scheduling decision for<span style="background-color: #FF0000"> </span>
+ *  @a the_scheduler.  The primary task is to add the thread to the
+ *  ready queue per the schedulering policy and update any appropriate<span style="background-color: #FF0000"> </span>
+ *  scheduling variables, for example the heir thread.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Unblock(
+    Scheduler_Control *the_scheduler,
+    Thread_Control    *the_thread<span style="background-color: #FF0000"> </span>
+)
+{
+  the_scheduler->operations.unblock( the_scheduler, the_thread );
+}
+
+/** @brief _Scheduler_Thread_scheduler_allocate
+ *
+ * This routine allocates @a the_thread->scheduler
+ */
+RTEMS_INLINE_ROUTINE void* _Scheduler_Thread_scheduler_allocate(<span style="background-color: #FF0000"> </span>
+  Scheduler_Control *the_scheduler,
+  Thread_Control    *the_thread
+)
+{
+  return<span style="background-color: #FF0000"> </span>
+    the_scheduler->operations.scheduler_allocate( the_scheduler, the_thread );
+}
+
+/** @brief _Scheduler_Thread_scheduler_free
+ *
+ * This routine frees @a the_thread->scheduler
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Thread_scheduler_free(<span style="background-color: #FF0000"> </span>
+  Scheduler_Control *the_scheduler,
+  Thread_Control    *the_thread
+)
+{
+  return the_scheduler->operations.scheduler_free( the_scheduler, the_thread );
+}
+
+/** @brief _Scheduler_Thread_scheduler_update
+ *
+ * This routine updates @a the_thread->scheduler
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Thread_scheduler_update(<span style="background-color: #FF0000"> </span>
+  Scheduler_Control *the_scheduler,
+  Thread_Control    *the_thread
+)
+{
+  the_scheduler->operations.scheduler_update( the_scheduler, the_thread );
+}
+
+/**@}*/
+
+#endif
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/inline/rtems/score/schedulerpriority.inl:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/inline/rtems/score/schedulerpriority.inl Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,286 @@
</font><font color='#000088'>+/**<span style="background-color: #FF0000"> </span>
+ *  @file  rtems/score/schedulerpriority.inl
+ *
+ *  This inline file contains all of the inlined routines associated with
+ *  the manipulation of the priority-based scheduling structures.
+ */
+
+/*
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULERPRIORITY_H
+# error "Never use <rtems/score/schedulerpriority.inl> directly; include <rtems/score/schedulerpriority.h> instead."
+#endif
+
+#ifndef _RTEMS_SCORE_SCHEDULERPRIORITY_INL
+#define _RTEMS_SCORE_SCHEDULERPRIORITY_INL
+
+/**
+ *  @addtogroup ScoreScheduler
+ * @{
+ */
+
+/** @brief  Scheduler priority Ready queue initialize
+ *
+ *  This routine initializes @a the_ready_queue for priority-based scheduling.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_initialize(
+  Scheduler_Control         *the_scheduler
+) {
+  uint32_t index;
+
+  /* allocate ready queue structures */
+  the_scheduler->ready_queues.Priority = (Chain_Control *)<span style="background-color: #FF0000"> </span>
+    _Workspace_Allocate_or_fatal_error(
+      (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control)
+    );
+
+  /* initialize ready queue structures */
+  for( index=0; index <= PRIORITY_MAXIMUM; index++)
+    _Chain_Initialize_empty( &the_scheduler->ready_queues.Priority[index] );
+}
+
+/*<span style="background-color: #FF0000"> </span>
+ *  _Scheduler_priority_Ready_queue_enqueue
+ *
+ *  This routine puts @a the_thread on to the priority-based ready queue.
+ *<span style="background-color: #FF0000">  </span>
+ *  Input parameters:
+ *    the_thread  - pointer to thread
+ *
+ *  Output parameters: NONE
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_enqueue(
+  Thread_Control                  *the_thread
+)
+{
+  _Priority_bit_map_Add( &the_thread->scheduler.priority->Priority_map );
+<span style="background-color: #FF0000">  </span>
+  _Chain_Append_unprotected( the_thread->scheduler.priority->ready_chain,<span style="background-color: #FF0000"> </span>
+      &the_thread->Object.Node );
+}
+
+/*
+ *  _Scheduler_priority_Ready_queue_Enqueue_first
+ *
+ *  This routine puts @a the_thread to the head of the ready queue.<span style="background-color: #FF0000"> </span>
+ *  For priority-based ready queues, the thread will be the first thread
+ *  at its priority level.
+ *<span style="background-color: #FF0000">  </span>
+ *  Input parameters:
+ *    the_thread      - pointer to thread
+ *
+ *  Output parameters: NONE
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_enqueue_first(
+  Thread_Control                   *the_thread
+)
+{
+  _Priority_bit_map_Add( &the_thread->scheduler.priority->Priority_map );
+
+  _Chain_Prepend_unprotected( the_thread->scheduler.priority->ready_chain,<span style="background-color: #FF0000"> </span>
+      &the_thread->Object.Node );
+}
+
+/*
+ *  _Scheduler_priority_Ready_queue_extract
+ *
+ *  This routine removes a specific thread from the specified<span style="background-color: #FF0000"> </span>
+ *  priority-based ready queue.
+ *
+ *  Input parameters:
+ *    the_thread       - pointer to a thread control block
+ *
+ *  Output parameters: NONE
+ *
+ *  INTERRUPT LATENCY: NONE
+ */
+
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_extract(
+  Thread_Control        *the_thread
+)
+{
+  Chain_Control         *ready  = the_thread->scheduler.priority->ready_chain;
+
+  if ( _Chain_Has_only_one_node( ready ) ) {
+    _Chain_Initialize_empty( ready );
+    _Priority_bit_map_Remove( &the_thread->scheduler.priority->Priority_map );
+  } else
+    _Chain_Extract_unprotected( &the_thread->Object.Node );
+}
+
+/*
+ *  _Scheduler_priority_Ready_queue_first
+ *
+ *  This routines returns a pointer to the first thread on @a the_ready_queue.
+ *
+ *  Input parameters:
+ *    the_ready_queue - pointer to thread queue
+ *
+ *  Output parameters:
+ *    returns - first thread or NULL
+ */
+
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_priority_Ready_queue_first(
+  Chain_Control       *the_ready_queue
+)
+{
+  uint32_t    index = _Priority_bit_map_Get_highest();
+
+  if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
+    return (Thread_Control *) the_ready_queue[ index ].first;
+
+  return NULL;
+}
+
+/*
+ *  _Scheduler_priority_Ready_queue_requeue
+ *
+ *  This routine is invoked when a thread changes priority and should be
+ *  moved to a different position on the ready queue.
+ *
+ *  Input parameters:
+ *    the_thread        - pointer to a thread control block
+ *
+ *  Output parameters: NONE
+ *
+ *  INTERRUPT LATENCY: NONE
+ */
+
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_requeue(
+  Thread_Control            *the_thread
+)
+{
+  if ( !_Chain_Has_only_one_node(
+        the_thread->scheduler.priority->ready_chain
+        ) ) {
+    _Chain_Extract_unprotected( &the_thread->Object.Node );
+
+    _Chain_Append_unprotected( the_thread->scheduler.priority->ready_chain,<span style="background-color: #FF0000"> </span>
+      &the_thread->Object.Node );
+  }
+}
+
+/*
+ * _Scheduler_priority_Schedule_body
+ *
+ * This kernel routine implements scheduling decision logic for priority-based
+ * scheduling.<span style="background-color: #FF0000">  </span>
+ *
+ * Input parameters:
+ *   the_scheduler  - pointer to scheduler control
+ *   the_thread     - pointer to thread control block
+ *
+ * Output parameters:  NONE
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(
+  Scheduler_Control     *the_scheduler
+)
+{
+  _Thread_Heir = _Scheduler_priority_Ready_queue_first(
+      the_scheduler->ready_queues.Priority
+  );
+}
+
+/*
+ * _Scheduler_priority_Block_body
+ *
+ * This kernel routine removes the_thread from scheduling decisions based<span style="background-color: #FF0000"> </span>
+ * on simple queue extraction.
+ *
+ * Input parameters:
+ *   the_scheduler  - pointer to scheduler control
+ *   the_thread     - pointer to thread control block
+ *
+ * Output parameters:  NONE
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Block_body(
+  Scheduler_Control *the_scheduler,
+  Thread_Control   *the_thread
+)
+{
+  _Scheduler_priority_Ready_queue_extract(the_thread);
+
+  /* TODO: flash critical section */
+
+  if ( _Thread_Is_heir( the_thread ) )
+     _Scheduler_priority_Schedule_body(the_scheduler);
+
+  if ( _Thread_Is_executing( the_thread ) )
+    _Thread_Dispatch_necessary = true;
+
+  return;
+}
+
+/*
+ *  _Scheduler_priority_Unblock_body
+ *
+ *  This kernel routine readies the requested thread according to the queuing<span style="background-color: #FF0000"> </span>
+ *  discipline. A new heir thread may be selected.
+ *
+ *  Input parameters:
+ *    the_scheduler - pointer to scheduler control
+ *    the_thread    - pointer to thread control block
+ *
+ *  Output parameters:  NONE
+ *
+ *  NOTE:  This routine uses the "blocking" heir selection mechanism.
+ *         This ensures the correct heir after a thread restart.
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+RTEMS_INLINE_ROUTINE void _Scheduler_priority_Unblock_body (
+  Scheduler_Control       *the_scheduler,
+  Thread_Control          *the_thread
+)
+{
+  _Scheduler_priority_Ready_queue_enqueue(
+      the_thread
+  );
+
+  /* TODO: flash critical section */
+
+  /*
+   *  If the thread that was unblocked is more important than the heir,
+   *  then we have a new heir.  This may or may not result in a
+   *  context switch.
+   *
+   *  Normal case:
+   *    If the current thread is preemptible, then we need to do
+   *    a context switch.
+   *  Pseudo-ISR case:
+   *    Even if the thread isn't preemptible, if the new heir is
+   *    a pseudo-ISR system task, we need to do a context switch.
+   */
+  if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
+    _Thread_Heir = the_thread;
+    if ( _Thread_Executing->is_preemptible ||
+        the_thread->current_priority == 0 )
+      _Thread_Dispatch_necessary = true;
+  }
+}
+
+/**@}*/
+
+#endif
+/* end of include file */
</font>
<font color='#006600'>diff -u rtems/cpukit/score/inline/rtems/score/thread.inl:1.43 rtems/cpukit/score/inline/rtems/score/thread.inl:1.44
--- rtems/cpukit/score/inline/rtems/score/thread.inl:1.43       Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/inline/rtems/score/thread.inl    Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -120,17 +120,6 @@
</font> }
 
 /**
<font color='#880000'>- *  This function returns a pointer to the highest priority
- *  ready thread.
- */
-
-RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
-{
-  _Thread_Heir = (Thread_Control *)
-    _Thread_Ready_chain[ _Priority_bit_map_Get_highest() ].first;
-}
-
-/**
</font>  *  This function returns true if the floating point context of
  *  the_thread is currently loaded in the floating point unit, and
  *  false otherwise.

<font color='#006600'>diff -u rtems/cpukit/score/preinstall.am:1.24 rtems/cpukit/score/preinstall.am:1.25
--- rtems/cpukit/score/preinstall.am:1.24       Thu Jul 29 12:52:10 2010
+++ rtems/cpukit/score/preinstall.am    Wed Nov 24 09:51:27 2010
</font><font color='#997700'>@@ -111,6 +111,14 @@
</font>   $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.h
 
<font color='#000088'>+$(PROJECT_INCLUDE)/rtems/score/scheduler.h: include/rtems/score/scheduler.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/scheduler.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/scheduler.h
+
+$(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h: include/rtems/score/schedulerpriority.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
+
</font> $(PROJECT_INCLUDE)/rtems/score/stack.h: include/rtems/score/stack.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stack.h
<font color='#997700'>@@ -245,6 +253,14 @@
</font>   $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.inl
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/prioritybitmap.inl
 
<font color='#000088'>+$(PROJECT_INCLUDE)/rtems/score/scheduler.inl: inline/rtems/score/scheduler.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/scheduler.inl
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/scheduler.inl
+
+$(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl: inline/rtems/score/schedulerpriority.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl
+
</font> $(PROJECT_INCLUDE)/rtems/score/stack.inl: inline/rtems/score/stack.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.inl
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stack.inl

<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/scheduler.c:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/src/scheduler.c  Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,45 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/states.h>
+#include <rtems/score/thread.h>
+
+/*
+ *  _Scheduler_Handler_initialization
+ *
+ *  This routine initializes the scheduler by calling the scheduler_init<span style="background-color: #FF0000"> </span>
+ *  function registered in the Configuration Scheduler Table.
+ *
+ *  Input parameters: NONE
+ *
+ *  Output parameters: NONE
+ */
+
+void _Scheduler_Handler_initialization( )
+{
+  Scheduler_Control *the_scheduler = &_Scheduler;
+
+  (*(_Scheduler_Table[Configuration.scheduler_policy].scheduler_init))(
+      the_scheduler
+  );
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerpriority.c:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/src/schedulerpriority.c  Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,66 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/states.h>
+#include <rtems/score/thread.h>
+
+/* Instantiate any global variables needed by the priority scheduler */
+volatile Priority_bit_map_Control _Priority_Major_bit_map;
+
+Priority_bit_map_Control          _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
+
+/*
+ *  _Scheduler_priority_Initialize
+ *
+ * Initializes the scheduler for priority scheduling.
+ *
+ *  Input parameters:
+ *    the_scheduler - pointer to scheduler control
+ *
+ *  Output parameters: NONE
+ */
+
+void _Scheduler_priority_Initialize (
+    Scheduler_Control       *the_scheduler
+)
+{
+  /* the operations table is a jump table to redirect generic scheduler<span style="background-color: #FF0000"> </span>
+   * function calls to scheduler implementation specific functions.  The<span style="background-color: #FF0000"> </span>
+   * main purpose of scheduler initialization is to set up the jump table<span style="background-color: #FF0000"> </span>
+   * for the scheduler.  Every scheduler implementation provides its own
+   * scheduler operations table.
+   */
+  the_scheduler->operations.schedule           = &_Scheduler_priority_Schedule;
+  the_scheduler->operations.yield              = &_Scheduler_priority_Yield;
+  the_scheduler->operations.block              = &_Scheduler_priority_Block;
+  the_scheduler->operations.unblock            = &_Scheduler_priority_Unblock;
+  the_scheduler->operations.scheduler_allocate =<span style="background-color: #FF0000"> </span>
+      &_Scheduler_priority_Thread_scheduler_allocate;
+  the_scheduler->operations.scheduler_free     =<span style="background-color: #FF0000"> </span>
+      &_Scheduler_priority_Thread_scheduler_free;
+  the_scheduler->operations.scheduler_update   =<span style="background-color: #FF0000"> </span>
+      &_Scheduler_priority_Thread_scheduler_update;
+
+  _Scheduler_priority_Ready_queue_initialize( the_scheduler );
+  _Priority_bit_map_Handler_initialization( );
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerpriorityblock.c:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/src/schedulerpriorityblock.c     Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,48 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/context.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/priority.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/thread.h>
+
+/*
+ * _Scheduler_priority_Block
+ *
+ * This kernel routine removes the_thread from scheduling decisions based<span style="background-color: #FF0000"> </span>
+ * on simple queue extraction.
+ *
+ * Input parameters:
+ *   the_scheduler  - pointer to scheduler control
+ *   the_thread     - pointer to thread control block
+ *
+ * Output parameters:  NONE
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+void _Scheduler_priority_Block(
+  Scheduler_Control *the_scheduler,
+  Thread_Control   *the_thread
+)
+{
+  _Scheduler_priority_Block_body(the_scheduler, the_thread);
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerpriorityschedule.c:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/src/schedulerpriorityschedule.c  Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,48 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/context.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/priority.h>
+#include <rtems/score/percpu.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/thread.h>
+
+/*
+ * _Scheduler_priority_Schedule
+ *
+ * This kernel routine implements scheduling decision logic for priority-based
+ * scheduling.<span style="background-color: #FF0000">  </span>
+ *
+ * Input parameters:
+ *   the_scheduler  - pointer to scheduler control
+ *   the_thread     - pointer to thread control block
+ *
+ * Output parameters:  NONE
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+void _Scheduler_priority_Schedule(
+  Scheduler_Control     *the_scheduler
+)
+{
+  _Scheduler_priority_Schedule_body( the_scheduler );
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerprioritythreadschedulerallocate.c:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/src/schedulerprioritythreadschedulerallocate.c   Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,53 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/states.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/wkspace.h>
+
+/*
+ *  _Scheduler_priority_Thread_scheduler_allocate
+ *
+ * Allocates @a the_thread->scheduler
+ *
+ *  Input parameters:
+ *    the_scheduler - pointer to scheduler control
+ *    the_thread    - pointer to thread control block
+ *
+ *  Output parameters:<span style="background-color: #FF0000"> </span>
+ *    Returns pointer to allocated space.
+ */
+
+void* _Scheduler_priority_Thread_scheduler_allocate (
+  Scheduler_Control     *the_scheduler,
+  Thread_Control        *the_thread
+)
+{
+  void                  *sched;
+
+  sched = _Workspace_Allocate( sizeof(Scheduler_priority_Per_thread) );
+
+  the_thread->scheduler.priority = (Scheduler_priority_Per_thread*) sched;
+
+  return sched;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerprioritythreadschedulerfree.c:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/src/schedulerprioritythreadschedulerfree.c       Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,46 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/states.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/wkspace.h>
+
+/*
+ *  _Scheduler_priority_Thread_scheduler_free
+ *
+ * Frees @a the_thread->scheduler
+ *
+ *  Input parameters:
+ *    the_scheduler - pointer to scheduler control
+ *    the_thread    - pointer to thread control block
+ *
+ *  Output parameters: NONE
+ */
+
+void _Scheduler_priority_Thread_scheduler_free (
+    Scheduler_Control *the_scheduler,
+    Thread_Control    *the_thread
+)
+{
+  _Workspace_Free( the_thread->scheduler.priority );
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerprioritythreadschedulerupdate.c:1.1
--- /dev/null   Wed Nov 24 10:10:43 2010
+++ rtems/cpukit/score/src/schedulerprioritythreadschedulerupdate.c     Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,55 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/config.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/priority.h>
+#include <rtems/score/prioritybitmap.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/states.h>
+#include <rtems/score/thread.h>
+
+/*
+ *  _Scheduler_priority_Thread_scheduler_update
+ *
+ * Updates @a the_thread->scheduler
+ *
+ *  Input parameters:
+ *    the_scheduler - pointer to scheduler control
+ *    the_thread    - pointer to thread control block
+ *
+ *  Output parameters: NONE
+ */
+
+void _Scheduler_priority_Thread_scheduler_update (
+    Scheduler_Control *the_scheduler,
+    Thread_Control    *the_thread
+)
+{
+  Chain_Control *rq = the_scheduler->ready_queues.Priority;
+  the_thread->scheduler.priority->ready_chain = &rq[
+    the_thread->current_priority<span style="background-color: #FF0000"> </span>
+  ];
+
+  _Priority_bit_map_Initialize_information(<span style="background-color: #FF0000"> </span>
+      &the_thread->scheduler.priority->Priority_map,<span style="background-color: #FF0000"> </span>
+      the_thread->current_priority<span style="background-color: #FF0000"> </span>
+  );
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerpriorityunblock.c:1.1
--- /dev/null   Wed Nov 24 10:10:44 2010
+++ rtems/cpukit/score/src/schedulerpriorityunblock.c   Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,57 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/apiext.h>
+#include <rtems/score/context.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/priority.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/states.h>
+#include <rtems/score/sysstate.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/threadq.h>
+#include <rtems/score/userext.h>
+#include <rtems/score/wkspace.h>
+
+/*
+ *  _Scheduler_priority_Unblock
+ *
+ *  This kernel routine readies the requested thread according to the queuing<span style="background-color: #FF0000"> </span>
+ *  discipline. A new heir thread may be selected.
+ *
+ *  Input parameters:
+ *    the_scheduler - pointer to scheduler control
+ *    the_thread    - pointer to thread control block
+ *
+ *  Output parameters:  NONE
+ *
+ *  NOTE:  This routine uses the "blocking" heir selection mechanism.
+ *         This ensures the correct heir after a thread restart.
+ *
+ *  INTERRUPT LATENCY:
+ */
+
+void _Scheduler_priority_Unblock (
+  Scheduler_Control       *the_scheduler,
+  Thread_Control          *the_thread
+)
+{
+  _Scheduler_priority_Unblock_body(the_scheduler, the_thread);
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/schedulerpriorityyield.c:1.1
--- /dev/null   Wed Nov 24 10:10:44 2010
+++ rtems/cpukit/score/src/schedulerpriorityyield.c     Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -0,0 +1,77 @@
</font><font color='#000088'>+/*
+ *  Scheduler Handler
+ *
+ *  Copyright (C) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/apiext.h>
+#include <rtems/score/context.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/object.h>
+#include <rtems/score/priority.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/states.h>
+#include <rtems/score/sysstate.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/threadq.h>
+#include <rtems/score/userext.h>
+#include <rtems/score/wkspace.h>
+
+/*
+ *  _Scheduler_priority_Yield
+ *
+ *  This kernel routine will remove the running THREAD from the ready queue
+ *  and place it immediately at the rear of this chain.  Reset timeslice
+ *  and yield the processor functions both use this routine, therefore if
+ *  reset is true and this is the only thread on the queue then the
+ *  timeslice counter is reset.  The heir THREAD will be updated if the
+ *  running is also the currently the heir.
+ *
+ *  Input parameters:
+ *    the_scheduler - pointer to scheduler control
+ *
+ *  Output parameters:  NONE
+ *
+ *  INTERRUPT LATENCY:
+ *    ready chain
+ *    select heir
+ */
+
+void _Scheduler_priority_Yield(<span style="background-color: #FF0000"> </span>
+    Scheduler_Control   *the_scheduler
+)
+{
+  ISR_Level       level;
+  Thread_Control *executing;
+  Chain_Control  *ready;
+
+  executing = _Thread_Executing;
+  ready = executing->scheduler.priority->ready_chain;
+  _ISR_Disable( level );
+    if ( !_Chain_Has_only_one_node( ready ) ) {
+      _Chain_Extract_unprotected( &executing->Object.Node );
+      _Chain_Append_unprotected( ready, &executing->Object.Node );
+
+      _ISR_Flash( level );
+
+      if ( _Thread_Is_heir( executing ) )
+        _Thread_Heir = (Thread_Control *) ready->first;
+      _Thread_Dispatch_necessary = true;
+    }
+    else if ( !_Thread_Is_heir( executing ) )
+      _Thread_Dispatch_necessary = true;
+
+  _ISR_Enable( level );
+}
</font>
<font color='#006600'>diff -u rtems/cpukit/score/src/thread.c:1.64 rtems/cpukit/score/src/thread.c:1.65
--- rtems/cpukit/score/src/thread.c:1.64        Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/src/thread.c     Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -24,6 +24,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -45,7 +46,6 @@
</font> 
 void _Thread_Handler_initialization(void)
 {
<font color='#880000'>-  uint32_t     index;
</font>   uint32_t     ticks_per_timeslice;
   uint32_t     maximum_extensions;
   #if defined(RTEMS_MULTIPROCESSING)
<font color='#997700'>@@ -80,13 +80,6 @@
</font> 
   _Thread_Ticks_per_timeslice  = ticks_per_timeslice;
 
<font color='#880000'>-  _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error(
-    (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control)
-  );
-
-  for ( index=0; index <= PRIORITY_MAXIMUM ; index++ )
-    _Chain_Initialize_empty( &_Thread_Ready_chain[ index ] );
-
</font> #if defined(RTEMS_MULTIPROCESSING)
   _Thread_MP_Handler_initialization( maximum_proxies );
 #endif

<font color='#006600'>diff -u rtems/cpukit/score/src/threadchangepriority.c:1.14 rtems/cpukit/score/src/threadchangepriority.c:1.15
--- rtems/cpukit/score/src/threadchangepriority.c:1.14  Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/src/threadchangepriority.c       Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,8 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -117,14 +119,16 @@
</font>      *  We now know the thread will be in the READY state when we remove
      *  the TRANSIENT state.  So we have to place it on the appropriate
      *  Ready Queue with interrupts off.
<font color='#000088'>+     *
+     *  FIXME: hard-coded for priority scheduling. Might be ok since this<span style="background-color: #FF0000"> </span>
+     *  function is specific to priority scheduling?
</font>      */
     the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
 
<font color='#880000'>-    _Priority_bit_map_Add( &the_thread->Priority_map );
</font>     if ( prepend_it )
<font color='#880000'>-      _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node );
</font><font color='#000088'>+      _Scheduler_priority_Ready_queue_enqueue_first( the_thread );
</font>     else
<font color='#880000'>-      _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
</font><font color='#000088'>+      _Scheduler_priority_Ready_queue_enqueue( the_thread );
</font>   }
 
   _ISR_Flash( level );
<font color='#997700'>@@ -133,7 +137,7 @@
</font>    *  We altered the set of thread priorities.  So let's figure out
    *  who is the heir and if we need to switch to them.
    */
<font color='#880000'>-  _Thread_Calculate_heir();
</font><font color='#000088'>+  _Scheduler_Schedule(&_Scheduler);
</font> 
   if ( !_Thread_Is_executing_also_the_heir() &&
        _Thread_Executing->is_preemptible )

<font color='#006600'>diff -u rtems/cpukit/score/src/threadclearstate.c:1.12 rtems/cpukit/score/src/threadclearstate.c:1.13
--- rtems/cpukit/score/src/threadclearstate.c:1.12      Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/src/threadclearstate.c   Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -66,31 +67,7 @@
</font>       the_thread->current_state = _States_Clear( state, current_state );
 
       if ( _States_Is_ready( current_state ) ) {
<font color='#880000'>-
-        _Priority_bit_map_Add( &the_thread->Priority_map );
-
-        _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
-
-        _ISR_Flash( level );
-
-        /*
-         *  If the thread that was unblocked is more important than the heir,
-         *  then we have a new heir.  This may or may not result in a
-         *  context switch.
-         *
-         *  Normal case:
-         *    If the current thread is preemptible, then we need to do
-         *    a context switch.
-         *  Pseudo-ISR case:
-         *    Even if the thread isn't preemptible, if the new heir is
-         *    a pseudo-ISR system task, we need to do a context switch.
-         */
-        if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
-          _Thread_Heir = the_thread;
-          if ( _Thread_Executing->is_preemptible ||
-               the_thread->current_priority == 0 )
-            _Thread_Dispatch_necessary = true;
-        }
</font><font color='#000088'>+        _Scheduler_Unblock( &_Scheduler, the_thread);
</font>       }
   }
   _ISR_Enable( level );

<font color='#006600'>diff -u rtems/cpukit/score/src/threadclose.c:1.12 rtems/cpukit/score/src/threadclose.c:1.13
--- rtems/cpukit/score/src/threadclose.c:1.12   Thu May 22 15:38:03 2008
+++ rtems/cpukit/score/src/threadclose.c        Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -86,6 +87,11 @@
</font>   }
 
   /*
<font color='#000088'>+   * Free the per-thread scheduling information.
+   */
+  _Scheduler_Thread_scheduler_free( &_Scheduler, the_thread );
+
+  /*
</font>    *  The thread might have been FP.  So deal with that.
    */
 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )

<font color='#006600'>diff -u rtems/cpukit/score/src/threadinitialize.c:1.39 rtems/cpukit/score/src/threadinitialize.c:1.40
--- rtems/cpukit/score/src/threadinitialize.c:1.39      Thu Jun 17 21:56:26 2010
+++ rtems/cpukit/score/src/threadinitialize.c   Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -60,6 +61,7 @@
</font>   #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
     void              *fp_area;
   #endif
<font color='#000088'>+  void                *sched = NULL;
</font>   void                *extensions_area;
   bool                 extension_status;
   int                  i;
<font color='#997700'>@@ -192,6 +194,9 @@
</font>   the_thread->resource_count          = 0;
   the_thread->real_priority           = priority;
   the_thread->Start.initial_priority  = priority;
<font color='#000088'>+  sched =_Scheduler_Thread_scheduler_allocate( &_Scheduler, the_thread );
+  if ( !sched )
+    goto failed;
</font>   _Thread_Set_priority( the_thread, priority );
 
   /*
<font color='#997700'>@@ -235,6 +240,9 @@
</font>       (void) _Workspace_Free( fp_area );
   #endif
 
<font color='#000088'>+  if ( sched )
+    (void) _Workspace_Free( sched );
+
</font>    _Thread_Stack_Free( the_thread );
   return false;
 

<font color='#006600'>diff -u rtems/cpukit/score/src/threadready.c:1.9 rtems/cpukit/score/src/threadready.c:1.10
--- rtems/cpukit/score/src/threadready.c:1.9    Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/src/threadready.c        Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -55,24 +56,12 @@
</font> )
 {
   ISR_Level              level;
<font color='#880000'>-  Thread_Control *heir;
</font> 
   _ISR_Disable( level );
 
   the_thread->current_state = STATES_READY;
 
<font color='#880000'>-  _Priority_bit_map_Add( &the_thread->Priority_map );
-
-  _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
-
-  _ISR_Flash( level );
-
-  _Thread_Calculate_heir();
-
-  heir = _Thread_Heir;
-
-  if ( !_Thread_Is_executing( heir ) && _Thread_Executing->is_preemptible )
-    _Thread_Dispatch_necessary = true;
</font><font color='#000088'>+  _Scheduler_Unblock( &_Scheduler, the_thread );
</font> 
   _ISR_Enable( level );
 }

<font color='#006600'>diff -u rtems/cpukit/score/src/threadresume.c:1.12 rtems/cpukit/score/src/threadresume.c:1.13
--- rtems/cpukit/score/src/threadresume.c:1.12  Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/src/threadresume.c       Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -68,19 +69,7 @@
</font>     the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state);
 
     if ( _States_Is_ready( current_state ) ) {
<font color='#880000'>-
-      _Priority_bit_map_Add( &the_thread->Priority_map );
-
-      _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
-
-      _ISR_Flash( level );
-
-      if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
-        _Thread_Heir = the_thread;
-        if ( _Thread_Executing->is_preemptible ||
-             the_thread->current_priority == 0 )
-          _Thread_Dispatch_necessary = true;
-      }
</font><font color='#000088'>+      _Scheduler_Unblock( &_Scheduler, the_thread );
</font>     }
   }
 

<font color='#006600'>diff -u rtems/cpukit/score/src/threadsetpriority.c:1.5 rtems/cpukit/score/src/threadsetpriority.c:1.6
--- rtems/cpukit/score/src/threadsetpriority.c:1.5      Thu Jul 29 12:52:10 2010
+++ rtems/cpukit/score/src/threadsetpriority.c  Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -50,10 +51,6 @@
</font> )
 {
   the_thread->current_priority = new_priority;
<font color='#880000'>-  the_thread->ready            = &_Thread_Ready_chain[ new_priority ];
</font> 
<font color='#880000'>-  _Priority_bit_map_Initialize_information(<span style="background-color: #FF0000"> </span>
-      &the_thread->Priority_map,<span style="background-color: #FF0000"> </span>
-      new_priority<span style="background-color: #FF0000"> </span>
-  );
</font><font color='#000088'>+  _Scheduler_Thread_scheduler_update(&_Scheduler, the_thread);
</font> }

<font color='#006600'>diff -u rtems/cpukit/score/src/threadsetstate.c:1.8 rtems/cpukit/score/src/threadsetstate.c:1.9
--- rtems/cpukit/score/src/threadsetstate.c:1.8 Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/src/threadsetstate.c     Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -54,9 +55,7 @@
</font> )
 {
   ISR_Level      level;
<font color='#880000'>-  Chain_Control *ready;
-
-  ready = the_thread->ready;
</font><font color='#000088'>+<span style="background-color: #FF0000">  </span>
</font>   _ISR_Disable( level );
   if ( !_States_Is_ready( the_thread->current_state ) ) {
     the_thread->current_state =
<font color='#997700'>@@ -67,21 +66,7 @@
</font> 
   the_thread->current_state = state;
 
<font color='#880000'>-  if ( _Chain_Has_only_one_node( ready ) ) {
-
-    _Chain_Initialize_empty( ready );
-    _Priority_bit_map_Remove( &the_thread->Priority_map );
-
-  } else
-    _Chain_Extract_unprotected( &the_thread->Object.Node );
-
-  _ISR_Flash( level );
-
-  if ( _Thread_Is_heir( the_thread ) )
-     _Thread_Calculate_heir();
-
-  if ( _Thread_Is_executing( the_thread ) )
-    _Thread_Dispatch_necessary = true;
</font><font color='#000088'>+  _Scheduler_Block( &_Scheduler, the_thread);
</font> 
   _ISR_Enable( level );
 }

<font color='#006600'>diff -u rtems/cpukit/score/src/threadsettransient.c:1.6 rtems/cpukit/score/src/threadsettransient.c:1.7
--- rtems/cpukit/score/src/threadsettransient.c:1.6     Thu Jul 29 12:52:10 2010
+++ rtems/cpukit/score/src/threadsettransient.c Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,8 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
+#include <rtems/score/schedulerpriority.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -54,22 +56,15 @@
</font> {
   ISR_Level             level;
   uint32_t              old_state;
<font color='#880000'>-  Chain_Control *ready;
-
-  ready = the_thread->ready;
</font><font color='#000088'>+<span style="background-color: #FF0000">  </span>
</font>   _ISR_Disable( level );
 
   old_state = the_thread->current_state;
   the_thread->current_state = _States_Set( STATES_TRANSIENT, old_state );
 
<font color='#000088'>+  /* FIXME: need to check which scheduler to use? */
</font>   if ( _States_Is_ready( old_state ) ) {
<font color='#880000'>-    if ( _Chain_Has_only_one_node( ready ) ) {
-
-      _Chain_Initialize_empty( ready );
-      _Priority_bit_map_Remove( &the_thread->Priority_map );
-
-    } else
-      _Chain_Extract_unprotected( &the_thread->Object.Node );
</font><font color='#000088'>+    _Scheduler_priority_Ready_queue_extract( the_thread);
</font>   }
 
   _ISR_Enable( level );

<font color='#006600'>diff -u rtems/cpukit/score/src/threadsuspend.c:1.9 rtems/cpukit/score/src/threadsuspend.c:1.10
--- rtems/cpukit/score/src/threadsuspend.c:1.9  Fri Jul 30 13:53:06 2010
+++ rtems/cpukit/score/src/threadsuspend.c      Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -52,9 +53,7 @@
</font> )
 {
   ISR_Level      level;
<font color='#880000'>-  Chain_Control *ready;
-
-  ready = the_thread->ready;
</font><font color='#000088'>+<span style="background-color: #FF0000">  </span>
</font>   _ISR_Disable( level );
   if ( !_States_Is_ready( the_thread->current_state ) ) {
     the_thread->current_state =
<font color='#997700'>@@ -65,21 +64,7 @@
</font> 
   the_thread->current_state = STATES_SUSPENDED;
 
<font color='#880000'>-  if ( _Chain_Has_only_one_node( ready ) ) {
-
-    _Chain_Initialize_empty( ready );
-    _Priority_bit_map_Remove( &the_thread->Priority_map );
-
-  } else
-    _Chain_Extract_unprotected( &the_thread->Object.Node );
-
-  _ISR_Flash( level );
-
-  if ( _Thread_Is_heir( the_thread ) )
-     _Thread_Calculate_heir();
-
-  if ( _Thread_Is_executing( the_thread ) )
-    _Thread_Dispatch_necessary = true;
</font><font color='#000088'>+  _Scheduler_Block(&_Scheduler, the_thread);
</font> 
   _ISR_Enable( level );
 }

<font color='#006600'>diff -u rtems/cpukit/score/src/threadtickletimeslice.c:1.12 rtems/cpukit/score/src/threadtickletimeslice.c:1.13
--- rtems/cpukit/score/src/threadtickletimeslice.c:1.12 Thu Jun 24 16:27:30 2010
+++ rtems/cpukit/score/src/threadtickletimeslice.c      Wed Nov 24 09:51:28 2010
</font><font color='#997700'>@@ -23,6 +23,7 @@
</font> #include <rtems/score/isr.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/states.h>
 #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
<font color='#997700'>@@ -89,7 +90,7 @@
</font>          *  currently executing thread is placed at the rear of the
          *  FIFO for this priority and a new heir is selected.
          */
<font color='#880000'>-        _Thread_Yield_processor();
</font><font color='#000088'>+        _Scheduler_Yield( );
</font>         executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
       }
       break;
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-11-24 Gedare Bloom <giddyup44@yahoo.com>

        PR 1647/cpukit
        * user/conf.t, user/schedule.t: Update documentation to reflect
        refactoring of SuperCore to add Scheduler and ability for user to
        configure a scheduler.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/doc/ChangeLog.diff?r1=text&tr1=1.290&r2=text&tr2=1.291&diff_format=h">M</a></td><td width='1%'>1.291</td><td width='100%'>doc/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/doc/user/conf.t.diff?r1=text&tr1=1.65&r2=text&tr2=1.66&diff_format=h">M</a></td><td width='1%'>1.66</td><td width='100%'>doc/user/conf.t</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/doc/user/schedule.t.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>doc/user/schedule.t</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/doc/ChangeLog:1.290 rtems/doc/ChangeLog:1.291
--- rtems/doc/ChangeLog:1.290   Thu Nov 11 08:01:32 2010
+++ rtems/doc/ChangeLog Wed Nov 24 09:52:21 2010
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2010-11-24    Gedare Bloom <giddyup44@yahoo.com>
+
+       PR 1647/cpukit
+       * user/conf.t, user/schedule.t: Update documentation to reflect
+       refactoring of SuperCore to add Scheduler and ability for user to
+       configure a scheduler.
+
</font> 2010-11-11        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
        PR 1716/doc

<font color='#006600'>diff -u rtems/doc/user/conf.t:1.65 rtems/doc/user/conf.t:1.66
--- rtems/doc/user/conf.t:1.65  Thu Jun 17 13:45:36 2010
+++ rtems/doc/user/conf.t       Wed Nov 24 09:52:21 2010
</font><font color='#997700'>@@ -24,6 +24,7 @@
</font> information encompasses a variety of information including<span style="background-color: #FF0000"> </span>
 the length of each clock tick, the maximum number of each RTEMS
 object that can be created, the application initialization tasks,
<font color='#000088'>+the task scheduling algorithm to be used,<span style="background-color: #FF0000"> </span>
</font> and the device drivers in the application.  This information
 is placed in data structures that are given to RTEMS at
 system initialization time.  This chapter details the<span style="background-color: #FF0000"> </span>
<font color='#997700'>@@ -392,6 +393,54 @@
</font> @c
 @c
 @c
<font color='#000088'>+@subsection Scheduler Algorithm Configuration
+This section defines the configuration parameters related to selecting<span style="background-color: #FF0000"> </span>
+a scheduling algorithm for an application.  Regardless of whether<span style="background-color: #FF0000"> </span>
+@code{CONFIGURE_SCHEDULER_POLICY} is defined, if none of the other<span style="background-color: #FF0000"> </span>
+configuration parameters are set, then @code{rtems/confdefs.h} will define<span style="background-color: #FF0000"> </span>
+@code{CONFIGURE_SCHEDULER_PRIORITY} and will (re)define<span style="background-color: #FF0000"> </span>
+@code{CONFIGURE_SCHEDULER_POLICY} as @code{_Scheduler_Priority}. That is,<span style="background-color: #FF0000"> </span>
+@code{CONFIGURE_SCHEDULER_PRIORITY} is the default scheduling algorithm.
+
+@itemize @bullet
+@findex CONFIGURE_SCHEDULER_POLICY
+@item @code{CONFIGURE_SCHEDULER_POLICY} is defined to specify which<span style="background-color: #FF0000"> </span>
+scheduling algorithm an application will use.  If it is undefined,<span style="background-color: #FF0000"> </span>
+then @code{rtems/confdefs.h} will define it based on the definition<span style="background-color: #FF0000"> </span>
+of the following configuration parameters.
+Valid values for this configuration parameter are:<span style="background-color: #FF0000"> </span>
+@code{_Scheduler_USER},
+@code{_Scheduler_Priority}.
+
+@findex CONFIGURE_SCHEDULER_USER
+@item @code{CONFIGURE_SCHEDULER_USER} is defined if the application<span style="background-color: #FF0000"> </span>
+provides its own scheduling algorithm. If @code{CONFIGURE_SCHEDULER_USER} is<span style="background-color: #FF0000"> </span>
+defined then @code{CONFIGURE_SCHEDULER_ENTRY_USER} must be defined with the<span style="background-color: #FF0000"> </span>
+name of the application's initialization function.  If both<span style="background-color: #FF0000"> </span>
+configuration parameters are defined and @code{CONFIGURE_SCHEDULER_POLICY}<span style="background-color: #FF0000"> </span>
+is undefined, then @code{CONFIGURE_SCHEDULER_POLICY} will be be defined as<span style="background-color: #FF0000"> </span>
+@code{_Scheduler_USER}.
+
+@findex CONFIGURE_SCHEDULER_ALL
+@item @code{CONFIGURE_SCHEDULER_ALL} is defined if the application<span style="background-color: #FF0000"> </span>
+chooses to include all of the RTEMS-provided schedulers.<span style="background-color: #FF0000">  </span>
+@code{CONFIGURE_SCHEDULER_ALL} will define all of the following configuration<span style="background-color: #FF0000"> </span>
+parameters and will use @code{CONFIGURE_SCHEDULER_POLICY} to select the<span style="background-color: #FF0000"> </span>
+algorithm to use. If @code{CONFIGURE_SCHEDULER_POLICY} is not defined, then<span style="background-color: #FF0000"> </span>
+@code{rtems/confdefs.h} will define it as @code{_Scheduler_Priority}.
+
+@findex CONFIGURE_SCHEDULER_PRIORITY
+@item @code{CONFIGURE_SCHEDULER_PRIORITY} is defined if the application<span style="background-color: #FF0000"> </span>
+will use the Priority Scheduling algorithm.
+If none of the previous configuration parameters are defined by the<span style="background-color: #FF0000"> </span>
+application, then @code{rtems/confdefs.h} will define<span style="background-color: #FF0000"> </span>
+@code{CONFIGURE_SCHEDULER_POLICY} as @code{_Scheduler_PRIORITY}.
+
+@end itemize
+
+@c
+@c
+@c
</font> @subsection Device Driver Table
 
 This section defines the configuration parameters related
<font color='#997700'>@@ -816,6 +865,7 @@
</font>   uint32_t                        maximum_extensions;
   uint32_t                        microseconds_per_tick;
   uint32_t                        ticks_per_timeslice;
<font color='#000088'>+  uint32_t                        scheduler_policy;
</font>   void                          (*idle_task)( void );
   uint32_t                        idle_task_stack_size;
   uint32_t                        interrupt_stack_size;
<font color='#997700'>@@ -875,6 +925,12 @@
</font> an RTEMS application, the value for this field corresponds
 to the setting of the macro @code{CONFIGURE_TICKS_PER_TIMESLICE}.
 
<font color='#000088'>+@item scheduler_policy
+is the algorithm to use for task scheduling.
+When using the @code{rtems/confdefs.h} mechanism for configuring
+an RTEMS application, the value for this field corresponds
+to the setting of the macro @code{CONFIGURE_SCHEDULER_POLICY}.
+
</font> @item idle_task
 is the address of the optional user
 provided routine which is used as the system's IDLE task.  If

<font color='#006600'>diff -u rtems/doc/user/schedule.t:1.14 rtems/doc/user/schedule.t:1.15
--- rtems/doc/user/schedule.t:1.14      Mon Nov  9 08:36:14 2009
+++ rtems/doc/user/schedule.t   Wed Nov 24 09:52:21 2010
</font><font color='#997700'>@@ -30,7 +30,30 @@
</font> capability is appropriately called the scheduler.  The
 scheduler's sole purpose is to allocate the all important
 resource of processor time to the various tasks competing for
<font color='#880000'>-attention.  The RTEMS scheduler allocates the processor using a
</font><font color='#000088'>+attention.<span style="background-color: #FF0000">  </span>
+
+@section Scheduling Algorithms
+
+@cindex scheduling algorithms
+
+RTEMS provides multiple possible scheduling algorithms, each<span style="background-color: #FF0000"> </span>
+of which are appropriate to different use case scenarios.<span style="background-color: #FF0000"> </span>
+The classic RTEMS scheduling algorithm -- the only<span style="background-color: #FF0000"> </span>
+algorithm available in RTEMS 4.10 and earlier -- is the priority
+scheduling algorithm.  When not specified, the priority scheduling
+algorithm can be assumed.
+
+RTEMS currently supports the following scheduling algorithms:
+
+@itemize @bullet
+@item Priority scheduling
+@end itemize
+
+@subsection Priority Scheduling
+
+@cindex priority scheduling
+
+The RTEMS scheduler allocates the processor using a
</font> priority-based, preemptive algorithm augmented to provide
 round-robin characteristics within individual priority groups.
 The goal of this algorithm is to guarantee that the task which
<font color='#997700'>@@ -50,6 +73,11 @@
</font> the second method to guarantee faster response times to external
 events.
 
<font color='#000088'>+Priority scheduling is the most commonly used scheduling algorithm.
+It should be used by applications in which multiple tasks contend for<span style="background-color: #FF0000"> </span>
+CPU time or other resources and there is a need to ensure certain tasks
+are given priority over other tasks.
+
</font> @section Scheduling Mechanisms
 
 @cindex scheduling mechanisms
<font color='#997700'>@@ -81,6 +109,11 @@
</font> 
 @cindex task priority
 
<font color='#000088'>+This mechanism affects the following scheduling algorithms:
+@itemize @bullet
+@item Priority scheduling
+@end itemize
+
</font> The most significant of these mechanisms is the
 ability for the user to assign a priority level to each
 individual task when it is created and to alter a task's
<font color='#997700'>@@ -104,6 +137,11 @@
</font> 
 @cindex preemption
 
<font color='#000088'>+This mechanism affects the following scheduling algorithms:
+@itemize @bullet
+@item Priority scheduling
+@end itemize
+
</font> Another way the user can alter the basic scheduling
 algorithm is by manipulating the preemption mode flag
 (@code{@value{RPREFIX}PREEMPT_MASK}) of individual tasks.  If preemption is disabled
<font color='#997700'>@@ -120,6 +158,11 @@
</font> @cindex timeslicing
 @cindex round robin scheduling
 
<font color='#000088'>+This mechanism affects the following scheduling algorithms:
+@itemize @bullet
+@item Priority scheduling
+@end itemize
+
</font> Timeslicing or round-robin scheduling is an
 additional method which can be used to alter the basic
 scheduling algorithm.  Like preemption, timeslicing is specified
<font color='#997700'>@@ -141,6 +184,11 @@
</font> 
 @cindex manual round robin
 
<font color='#000088'>+This mechanism affects the following scheduling algorithms:
+@itemize @bullet
+@item Priority scheduling
+@end itemize
+
</font> The final mechanism for altering the RTEMS scheduling
 algorithm is called manual round-robin.  Manual round-robin is
 invoked by using the @code{@value{DIRPREFIX}task_wake_after}
<font color='#997700'>@@ -151,7 +199,7 @@
</font> priority are ready to run, then the task does not lose control
 of the processor.
 
<font color='#880000'>-@subsection Dispatching Tasks
</font><font color='#000088'>+@section Dispatching Tasks
</font> 
 @cindex dispatching
 
</pre>
<p> </p>
<a name='cs3'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-11-24 Gedare Bloom <giddyup44@yahoo.com>

        PR 1647/cpukit
        * spsize/size.c: Update documentation to reflect refactoring of
        SuperCore to add Scheduler Handler.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/ChangeLog.diff?r1=text&tr1=1.424&r2=text&tr2=1.425&diff_format=h">M</a></td><td width='1%'>1.425</td><td width='100%'>testsuites/sptests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spsize/size.c.diff?r1=text&tr1=1.68&r2=text&tr2=1.69&diff_format=h">M</a></td><td width='1%'>1.69</td><td width='100%'>testsuites/sptests/spsize/size.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/sptests/ChangeLog:1.424 rtems/testsuites/sptests/ChangeLog:1.425
--- rtems/testsuites/sptests/ChangeLog:1.424    Tue Nov 16 13:01:29 2010
+++ rtems/testsuites/sptests/ChangeLog  Wed Nov 24 10:06:22 2010
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2010-11-24    Gedare Bloom <giddyup44@yahoo.com>
+
+       PR 1647/cpukit
+       * spsize/size.c: Update documentation to reflect refactoring of
+       SuperCore to add Scheduler Handler.
+
</font> 2010-11-16        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * sp70/init.c, sp70/sp70.scn: Fix bug in test which lead to random

<font color='#006600'>diff -u rtems/testsuites/sptests/spsize/size.c:1.68 rtems/testsuites/sptests/spsize/size.c:1.69
--- rtems/testsuites/sptests/spsize/size.c:1.68 Sun Oct  3 02:16:50 2010
+++ rtems/testsuites/sptests/spsize/size.c      Wed Nov 24 10:06:22 2010
</font><font color='#997700'>@@ -37,6 +37,7 @@
</font> #include <rtems/rtems/region.h>
 #include <rtems/rtems/sem.h>
 #include <rtems/rtems/signal.h>
<font color='#000088'>+#include <rtems/score/scheduler.h>
</font> #include <rtems/score/sysstate.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timer.h>
<font color='#997700'>@@ -49,6 +50,8 @@
</font> #include <unistd.h>
 #include <tmacros.h>
 
<font color='#000088'>+#include "system.h"
+
</font> /* external function prototypes */
 int getint( void );
 void size_rtems(int mode);
<font color='#997700'>@@ -64,12 +67,32 @@
</font>  */
 #define  HEAP_OVHD        16    /* wasted heap space per task stack */
 #define  NAME_PTR_SIZE     8    /* size of name and pointer table entries */
<font color='#880000'>-#define  READYCHAINS_SIZE  \
</font><font color='#000088'>+
+#if CONFIGURE_SCHEDULER_POLICY == _Scheduler_PRIORITY
+  #include <rtems/score/prioritybitmap.h>
+
+  /* Priority scheduling uninitialized (globals) consumption */
+  #define SCHEDULER_OVHD          ((sizeof _Scheduler)              + \
+                                   (sizeof _Priority_Major_bit_map) + \
+                                   (sizeof _Priority_Bit_map))
+
+  /* Priority scheduling per-thread consumption. Gets<span style="background-color: #FF0000"> </span>
+   * included in the PER_TASK consumption. */
+  #define SCHEDULER_TASK_WKSP     (sizeof(Scheduler_priority_Per_thread))
+
+  /* Priority scheduling workspace consumption<span style="background-color: #FF0000"> </span>
+   *
+   * Include allocation of ready queue.  Pointers are already counted by<span style="background-color: #FF0000"> </span>
+   * including _Scheduler in SCHEDULER_OVHD.
+   */
+  #define  SCHEDULER_WKSP_SIZE  \
</font>     ((RTEMS_MAXIMUM_PRIORITY + 1) * sizeof(Chain_Control ))
<font color='#000088'>+#endif
</font> 
 #define PER_TASK      \
      (long) (sizeof (Thread_Control) + \
<font color='#880000'>-      NAME_PTR_SIZE + HEAP_OVHD + sizeof( RTEMS_API_Control ))
</font><font color='#000088'>+      NAME_PTR_SIZE + HEAP_OVHD + sizeof( RTEMS_API_Control ) + \
+      SCHEDULER_TASK_WKSP )
</font> #define PER_SEMAPHORE \
      (long) (sizeof (Semaphore_Control) + NAME_PTR_SIZE)
 #define PER_TIMER     \
<font color='#997700'>@@ -159,10 +182,10 @@
</font>  *
  *    + Object MP
  *      - Global Object CB's
<font color='#880000'>- *    + Thread
- *      - Ready Chain
</font>  *    + Thread MP
  *      - Proxies Chain
<font color='#000088'>+ *    + Scheduler
+ *      - Ready queue
</font>  *    + Interrupt Manager
  *      - Interrupt Stack
  *    + Timer Manager
<font color='#997700'>@@ -195,18 +218,18 @@
</font>  *  The following calculates the overhead needed by RTEMS from the
  *  Workspace Area.
  */
<font color='#880000'>-sys_req = SYSTEM_TASKS     +     /* MPCI Receive Server and IDLE */
-          NAME_PTR_SIZE    +     /* Task Overhead */
-          READYCHAINS_SIZE +     /* Ready Chains */
-          NAME_PTR_SIZE    +     /* Timer Overhead */
-          NAME_PTR_SIZE    +     /* Semaphore Overhead */
-          NAME_PTR_SIZE    +     /* Message Queue Overhead */
-          NAME_PTR_SIZE    +     /* Region Overhead */
-          NAME_PTR_SIZE    +     /* Partition Overhead */
-          NAME_PTR_SIZE    +     /* Dual-Ported Memory Overhead */
-          NAME_PTR_SIZE    +     /* Rate Monotonic Overhead */
-          NAME_PTR_SIZE    +     /* Extension Overhead */
-          PER_NODE;              /* Extra Gobject Table */
</font><font color='#000088'>+sys_req = SYSTEM_TASKS        +     /* MPCI Receive Server and IDLE */
+          NAME_PTR_SIZE       +     /* Task Overhead */
+          SCHEDULER_WKSP_SIZE +     /* Scheduler Overhead */
+          NAME_PTR_SIZE       +     /* Timer Overhead */
+          NAME_PTR_SIZE       +     /* Semaphore Overhead */
+          NAME_PTR_SIZE       +     /* Message Queue Overhead */
+          NAME_PTR_SIZE       +     /* Region Overhead */
+          NAME_PTR_SIZE       +     /* Partition Overhead */
+          NAME_PTR_SIZE       +     /* Dual-Ported Memory Overhead */
+          NAME_PTR_SIZE       +     /* Rate Monotonic Overhead */
+          NAME_PTR_SIZE       +     /* Extension Overhead */
+          PER_NODE;                 /* Extra Gobject Table */
</font> 
 uninitialized =
 /*address.h*/   0                                         +
<font color='#997700'>@@ -311,9 +334,6 @@
</font> 
 /*percpu.h*/    (sizeof _Per_CPU_Information)             +
 
<font color='#880000'>-/*priority.h*/  (sizeof _Priority_Major_bit_map)          +
-                (sizeof _Priority_Bit_map)                +
-
</font> /*ratemon.h*/   (sizeof _Rate_monotonic_Information)      +
 
 /*region.h*/    (sizeof _Region_Information)              +
<font color='#997700'>@@ -324,6 +344,8 @@
</font> 
 /*rtems.h*/     /* Not applicable */
 
<font color='#000088'>+/*scheduler.h*/ SCHEDULER_OVHD                            +<span style="background-color: #FF0000"> </span>
+
</font> /*sem.h*/       (sizeof _Semaphore_Information)           +
 
 #if defined(RTEMS_MULTIPROCESSING)
<font color='#997700'>@@ -355,7 +377,6 @@
</font>                 (sizeof _Thread_Dispatch_disable_level)   +
                 (sizeof _Thread_Maximum_extensions)       +
                 (sizeof _Thread_Ticks_per_timeslice)      +
<font color='#880000'>-                (sizeof _Thread_Ready_chain)              +
</font>                 (sizeof _Thread_Executing)                +
                 (sizeof _Thread_Heir)                     +
 #if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1)
</pre>
<p> </p>
<a name='cs4'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-11-24 Gedare Bloom <giddyup44@yahoo.com>

        PR 1647/cpukit
        * tm26/task1.c, tm27/task1.c: Update documentation to reflect
        refactoring of SuperCore to add Scheduler Handler.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/tmtests/ChangeLog.diff?r1=text&tr1=1.90&r2=text&tr2=1.91&diff_format=h">M</a></td><td width='1%'>1.91</td><td width='100%'>testsuites/tmtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/tmtests/tm26/task1.c.diff?r1=text&tr1=1.32&r2=text&tr2=1.33&diff_format=h">M</a></td><td width='1%'>1.33</td><td width='100%'>testsuites/tmtests/tm26/task1.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/tmtests/tm27/task1.c.diff?r1=text&tr1=1.29&r2=text&tr2=1.30&diff_format=h">M</a></td><td width='1%'>1.30</td><td width='100%'>testsuites/tmtests/tm27/task1.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/tmtests/ChangeLog:1.90 rtems/testsuites/tmtests/ChangeLog:1.91
--- rtems/testsuites/tmtests/ChangeLog:1.90     Mon Oct 25 02:27:51 2010
+++ rtems/testsuites/tmtests/ChangeLog  Wed Nov 24 10:06:37 2010
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2010-11-24    Gedare Bloom <giddyup44@yahoo.com>
+
+       PR 1647/cpukit
+       * tm26/task1.c, tm27/task1.c: Update documentation to reflect
+       refactoring of SuperCore to add Scheduler Handler.
+
</font> 2010-10-25        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
        * tm26/task1.c, tm27/task1.c: Do not violate chain API.

<font color='#006600'>diff -u rtems/testsuites/tmtests/tm26/task1.c:1.32 rtems/testsuites/tmtests/tm26/task1.c:1.33
--- rtems/testsuites/tmtests/tm26/task1.c:1.32  Mon Oct 25 02:27:51 2010
+++ rtems/testsuites/tmtests/tm26/task1.c       Wed Nov 24 10:06:37 2010
</font><font color='#997700'>@@ -242,7 +242,8 @@
</font>   Middle_tcb   = _Thread_Executing;
 
   _Thread_Executing =
<font color='#880000'>-        (Thread_Control *) _Chain_First(&_Thread_Ready_chain[LOW_PRIORITY]);
</font><font color='#000088'>+        (Thread_Control *)<span style="background-color: #FF0000"> </span>
+        _Chain_First(&_Scheduler.ready_queues.Priority[LOW_PRIORITY]);
</font> 
   /* do not force context switch */
 
<font color='#997700'>@@ -279,7 +280,8 @@
</font>   context_switch_another_task_time = benchmark_timer_read();
 
   _Thread_Executing =
<font color='#880000'>-        (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP1_PRIORITY]);
</font><font color='#000088'>+        (Thread_Control *)<span style="background-color: #FF0000"> </span>
+        _Chain_First(&_Scheduler.ready_queues.Priority[FP1_PRIORITY]);
</font> 
   /* do not force context switch */
 
<font color='#997700'>@@ -306,7 +308,8 @@
</font>   executing = _Thread_Executing;
 
   _Thread_Executing =
<font color='#880000'>-        (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP2_PRIORITY]);
</font><font color='#000088'>+        (Thread_Control *)<span style="background-color: #FF0000"> </span>
+        _Chain_First(&_Scheduler.ready_queues.Priority[FP2_PRIORITY]);
</font> 
   /* do not force context switch */
 
<font color='#997700'>@@ -329,7 +332,8 @@
</font>   executing = _Thread_Executing;
 
   _Thread_Executing =
<font color='#880000'>-       (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP2_PRIORITY]);
</font><font color='#000088'>+       (Thread_Control *)
+       _Chain_First(&_Scheduler.ready_queues.Priority[FP2_PRIORITY]);
</font> 
   /* do not force context switch */
 
<font color='#997700'>@@ -358,7 +362,8 @@
</font>   executing = _Thread_Executing;
 
   _Thread_Executing =
<font color='#880000'>-       (Thread_Control *) _Chain_First(&_Thread_Ready_chain[FP1_PRIORITY]);
</font><font color='#000088'>+       (Thread_Control *)
+       _Chain_First(&_Scheduler.ready_queues.Priority[FP1_PRIORITY]);
</font> 
   FP_LOAD( 1.0 );
 

<font color='#006600'>diff -u rtems/testsuites/tmtests/tm27/task1.c:1.29 rtems/testsuites/tmtests/tm27/task1.c:1.30
--- rtems/testsuites/tmtests/tm27/task1.c:1.29  Mon Oct 25 02:27:51 2010
+++ rtems/testsuites/tmtests/tm27/task1.c       Wed Nov 24 10:06:37 2010
</font><font color='#997700'>@@ -170,7 +170,8 @@
</font> 
   _Thread_Dispatch_disable_level = 0;
 
<font color='#880000'>-  _Thread_Heir = (rtems_tcb *) _Chain_Last(&_Thread_Ready_chain[LOW_PRIORITY]);
</font><font color='#000088'>+  _Thread_Heir = (rtems_tcb *)<span style="background-color: #FF0000"> </span>
+        _Chain_Last(&_Scheduler.ready_queues.Priority[LOW_PRIORITY]);
</font> 
   _Thread_Dispatch_necessary = 1;
 
<font color='#997700'>@@ -227,7 +228,8 @@
</font> 
   _Thread_Dispatch_disable_level = 0;
 
<font color='#880000'>-  _Thread_Heir = (rtems_tcb *) _Chain_First(&_Thread_Ready_chain[LOW_PRIORITY]);
</font><font color='#000088'>+  _Thread_Heir = (rtems_tcb *)
+      _Chain_First(&_Scheduler.ready_queues.Priority[LOW_PRIORITY]);
</font> 
   _Thread_Dispatch_necessary = 1;
 
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>