Index: cpukit/ChangeLog
===================================================================
--- cpukit/ChangeLog	(revision db03612ee41f3a8e89265aed2b1908e788415b9c)
+++ cpukit/ChangeLog	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -1,2 +1,21 @@
+2011-03-16	Jennifer Averett <jennifer.averett@OARcorp.com>
+
+	PR 1743/cpu
+	* sapi/include/confdefs.h, score/Makefile.am, score/preinstall.am: Add
+	Simple Priority Scheduler as complement to existing Deterministic
+	Priority Scheduler. This scheduler serves both as an example and as a
+	lighter weight implementation for smaller systems.
+	* score/include/rtems/score/schedulersimple.h,
+	score/inline/rtems/score/schedulersimple.inl,
+	score/src/schedulersimple.c, score/src/schedulersimpleblock.c,
+	score/src/schedulersimpleenqueue.c,
+	score/src/schedulersimpleenqueuefirst.c,
+	score/src/schedulersimpleextract.c,
+	score/src/schedulersimplereadyqueueenqueue.c,
+	score/src/schedulersimplereadyqueueenqueuefirst.c,
+	score/src/schedulersimpleschedule.c,
+	score/src/schedulersimpleunblock.c, score/src/schedulersimpleyield.c:
+	New files.
+
 2011-03-16	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: cpukit/sapi/include/confdefs.h
===================================================================
--- cpukit/sapi/include/confdefs.h	(revision db03612ee41f3a8e89265aed2b1908e788415b9c)
+++ cpukit/sapi/include/confdefs.h	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -557,4 +557,5 @@
  *  CONFIGURE_SCHEDULER_USER     - user provided scheduler
  *  CONFIGURE_SCHEDULER_PRIORITY - Deterministic Priority Scheduler
+ *  CONFIGURE_SCHEDULER_SIMPLE   - Light-weight Priority Scheduler
  * 
  * If no configuration is specified by the application, then 
@@ -576,5 +577,6 @@
 /* If no scheduler is specified, the priority scheduler is default. */
 #if !defined(CONFIGURE_SCHEDULER_USER) && \
-    !defined(CONFIGURE_SCHEDULER_PRIORITY)
+    !defined(CONFIGURE_SCHEDULER_PRIORITY) && \
+    !defined(CONFIGURE_SCHEDULER_SIMPLE)
   #define CONFIGURE_SCHEDULER_PRIORITY
 #endif
@@ -596,4 +598,20 @@
   #define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER ( \
     _Configure_From_workspace(sizeof(Scheduler_priority_Per_thread)) )
+#endif
+
+/* 
+ * If the Simple Priority Scheduler is selected, then configure for it.
+ */
+#if defined(CONFIGURE_SCHEDULER_SIMPLE)
+  #include <rtems/score/schedulersimple.h>
+  #define SCHEDULER_ENTRY_POINTS SCHEDULER_SIMPLE_ENTRY_POINTS
+
+  /**
+   * define the memory used by the simple scheduler
+   */
+  #define CONFIGURE_MEMORY_FOR_SCHEDULER ( \
+    _Configure_From_workspace( sizeof(Chain_Control) ) \
+  )
+  #define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER (0)
 #endif
 
Index: cpukit/score/Makefile.am
===================================================================
--- cpukit/score/Makefile.am	(revision db03612ee41f3a8e89265aed2b1908e788415b9c)
+++ cpukit/score/Makefile.am	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -28,4 +28,5 @@
     include/rtems/score/priority.h include/rtems/score/prioritybitmap.h \
     include/rtems/score/scheduler.h include/rtems/score/schedulerpriority.h \
+    include/rtems/score/schedulersimple.h \
     include/rtems/score/stack.h include/rtems/score/states.h \
     include/rtems/score/sysstate.h include/rtems/score/thread.h \
@@ -57,4 +58,5 @@
     inline/rtems/score/priority.inl inline/rtems/score/prioritybitmap.inl \
     inline/rtems/score/scheduler.inl inline/rtems/score/schedulerpriority.inl \
+    inline/rtems/score/schedulersimple.inl \
     inline/rtems/score/stack.inl inline/rtems/score/states.inl \
     inline/rtems/score/sysstate.inl inline/rtems/score/thread.inl \
@@ -156,4 +158,16 @@
     src/schedulerpriorityyield.c
 
+## SCHEDULERSIMPLE_C_FILES
+libscore_a_SOURCES += src/schedulersimple.c \
+    src/schedulersimpleblock.c \
+    src/schedulersimpleenqueue.c \
+    src/schedulersimpleenqueuefirst.c \
+    src/schedulersimpleextract.c \
+    src/schedulersimplereadyqueueenqueue.c \
+    src/schedulersimplereadyqueueenqueuefirst.c \
+    src/schedulersimpleschedule.c \
+    src/schedulersimpleunblock.c \
+    src/schedulersimpleyield.c 
+
 ## PROTECTED_HEAP_C_FILES
 libscore_a_SOURCES += src/pheapallocate.c \
Index: cpukit/score/include/rtems/score/schedulersimple.h
===================================================================
--- cpukit/score/include/rtems/score/schedulersimple.h	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/include/rtems/score/schedulersimple.h	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,199 @@
+/**
+ *  @file  rtems/score/schedulersimple.h
+ *
+ *  This include file contains all the constants and structures associated
+ *  with the manipulation of threads on a simple-priority-based ready queue.
+ *
+ *
+ *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
+ *
+ *  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_SCHEDULERSIMPLE_H
+#define _RTEMS_SCORE_SCHEDULERSIMPLE_H
+
+/**
+ *  @addtogroup ScoreScheduler
+ *
+ */
+/**@{*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rtems/score/scheduler.h>
+
+/**
+ *  Entry points for Scheduler Simple
+ */
+#define SCHEDULER_SIMPLE_ENTRY_POINTS \
+  { \
+    _Scheduler_simple_Initialize,    /* initialize entry point */ \
+    _Scheduler_simple_Schedule,      /* schedule entry point */ \
+    _Scheduler_simple_Yield,         /* yield entry point */ \
+    _Scheduler_simple_Block,         /* block entry point */ \
+    _Scheduler_simple_Unblock,       /* unblock entry point */ \
+    _Scheduler_simple_Allocate,      /* allocate entry point */ \
+    _Scheduler_simple_Free,          /* free entry point */ \
+    _Scheduler_simple_Update,        /* update entry point */ \
+    _Scheduler_simple_Enqueue,       /* enqueue entry point */ \
+    _Scheduler_simple_Enqueue_first, /* enqueue_first entry point */ \
+    _Scheduler_simple_Extract        /* extract entry point */ \
+  }
+
+/**
+ * This routine initializes the simple scheduler.
+ */
+void _Scheduler_simple_Initialize( void );
+
+/**
+ *  This routine sets the heir thread to be the next ready thread 
+ *  on the ready queue by getting the first node in the scheduler
+ *  information.
+ */
+void _Scheduler_simple_Schedule( void );
+
+/**
+ *  This routine is invoked when a thread wishes to voluntarily
+ *  transfer control of the processor to another thread in the queue.
+ *  It will remove the running THREAD from the scheduler.informaiton 
+ *  (where the ready queue is stored) and place it immediately at the 
+ *  between the last entry of its priority and the next priority thread.  
+ *  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.
+*/
+void _Scheduler_simple_Yield( void );
+
+/**
+ *  This routine removes @a the_thread from the scheduling decision, 
+ *  that is, removes it from the ready queue.  It performs
+ *  any necessary scheduling operations including the selection of
+ *  a new heir thread.
+ *
+ *  @param[in] the_thread is the thread that is to be blocked
+ */
+void _Scheduler_simple_Block( 
+  Thread_Control *the_thread 
+);
+
+/**
+ *  This routine adds @a the_thread to the scheduling decision, 
+ *  that is, adds it to the ready queue and 
+ *  updates any appropriate scheduling variables, for example the heir thread.
+ *
+ *  @param[in] the_thread is the thread that is to be unblocked
+ */
+void _Scheduler_simple_Unblock(
+  Thread_Control *the_thread 
+);
+
+/**
+ *  This routine removes a specific thread from the specified 
+ *  simple-based ready queue.
+ *
+ *  @param[in] the_thread is the thread to be blocked
+ */
+void _Scheduler_simple_Extract(
+  Thread_Control *the_thread
+);
+
+/**
+ *  This routine puts @a the_thread on to the ready queue.
+ *
+ *  @param[in] the_thread is the thread to be blocked
+ */
+void _Scheduler_simple_Enqueue(
+  Thread_Control *the_thread
+);
+
+/**
+ *  This routine puts @a the_thread to the head of the ready queue. 
+ *  The thread will be the first thread at its priority level.
+ *
+ *  @param[in] the_thread is the thread to be blocked
+ */
+void _Scheduler_simple_Enqueue_first(
+  Thread_Control *the_thread
+);
+
+/**
+ *  This routine is a place holder for any memeory allocation needed
+ *  by the scheduler.  For the simple scheduler the routine is an empty
+ *  place holder.
+ *
+ *  @param[in] the_thread is the thread the scheduler is allocating
+ *             management memory for
+ *
+ *  @return this routine returns -1 since this is just an empty placeholder
+ *  and the return value may be defined differently by each scheduler.
+ */
+void *_Scheduler_simple_Allocate( 
+  Thread_Control *the_thread
+);
+
+/**
+ * This routine does nothing, and is used as a stub for Schedule update
+ *
+ * The overhead of a function call will still be imposed.
+ *
+ *  @param[in] the_thread is the thread to be blocked
+ */
+void _Scheduler_simple_Update( 
+  Thread_Control *the_thread
+);
+
+/**
+ * This routine does nothing, and is used as a stub for Schedule free
+ *
+ * The overhead of a function call will still be imposed.
+ *
+ *  @param[in] the_thread is the thread to be blocked
+ */
+void _Scheduler_simple_Free( 
+  Thread_Control *the_thread
+);
+
+/**
+ *  _Scheduler_simple_Ready_queue_Enqueue
+ *
+ *  This routine puts @a the_thread on the ready queue
+ *  at the end of its priority group.
+ *  
+ *  @param[in] the_thread - pointer to a thread control block
+ */
+void _Scheduler_simple_Ready_queue_Enqueue(
+  Thread_Control    *the_thread
+);
+
+/**
+ *  _Scheduler_simple_Ready_queue_Enqueue_first
+ *
+ *  This routine puts @a the_thread on to the ready queue
+ *  at the beginning of its priority group.
+ *  
+ *  @param[in] the_thread - pointer to a thread control block
+ */
+void _Scheduler_simple_Ready_queue_Enqueue_first(
+  Thread_Control    *the_thread
+);
+
+#ifndef __RTEMS_APPLICATION__
+#include <rtems/score/schedulersimple.inl>
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+
+#endif
+/* end of include file */
Index: cpukit/score/inline/rtems/score/schedulersimple.inl
===================================================================
--- cpukit/score/inline/rtems/score/schedulersimple.inl	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/inline/rtems/score/schedulersimple.inl	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,53 @@
+/** 
+ *  @file  rtems/score/schedulersimple.inl
+ *
+ *  This inline file contains all of the inlined routines associated with
+ *  the manipulation of the priority-based scheduling structures.
+ */
+
+/*
+ *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
+ *
+ *  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_SCHEDULERSIMPLE_H
+# error "Never use <rtems/score/schedulersimple.inl> directly; include <rtems/score/schedulersimple.h> instead."
+#endif
+
+#ifndef _RTEMS_SCORE_SCHEDULERSIMPLE_INL
+#define _RTEMS_SCORE_SCHEDULERSIMPLE_INL
+
+#include <rtems/score/thread.h>
+
+/**
+ *  @addtogroup ScoreScheduler
+ * @{
+ */
+
+/**
+ *  This routine puts @a the_thread on to the ready queue.
+ *
+ *  @param[in] the_ready_queue is a pointer to the ready queue head
+ *  @param[in] the_thread is the thread to be blocked
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_simple_Ready_queue_Requeue(
+  Scheduler_Control *the_ready_queue,
+  Thread_Control    *the_thread
+)
+{
+  /* extract */
+  _Chain_Extract_unprotected( &the_thread->Object.Node );
+
+  /* enqueue */
+  _Scheduler_simple_Ready_queue_Enqueue( the_thread );
+}
+
+/**@}*/
+
+#endif
+/* end of include file */
Index: cpukit/score/preinstall.am
===================================================================
--- cpukit/score/preinstall.am	(revision db03612ee41f3a8e89265aed2b1908e788415b9c)
+++ cpukit/score/preinstall.am	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -120,4 +120,8 @@
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
 
+$(PROJECT_INCLUDE)/rtems/score/schedulersimple.h: include/rtems/score/schedulersimple.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimple.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimple.h
+
 $(PROJECT_INCLUDE)/rtems/score/stack.h: include/rtems/score/stack.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.h
@@ -262,4 +266,8 @@
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl
 
+$(PROJECT_INCLUDE)/rtems/score/schedulersimple.inl: inline/rtems/score/schedulersimple.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimple.inl
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimple.inl
+
 $(PROJECT_INCLUDE)/rtems/score/stack.inl: inline/rtems/score/stack.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.inl
Index: cpukit/score/src/schedulersimple.c
===================================================================
--- cpukit/score/src/schedulersimple.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimple.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,84 @@
+/*
+ *  Scheduler Simple Handler / Initialize
+ *  Scheduler Simple Handler / Allocate (Empty Routine)
+ *  Scheduler Simple Handler / Update (Empty Routine)
+ *  Scheduler Simple Handler / Free (Empty Routine)
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/scheduler.h>
+#include <rtems/score/schedulersimple.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/wkspace.h>
+
+/**
+ * This routine does nothing, and is used as a stub for Schedule allocate
+ *
+ * Note: returns a non-zero value, or else thread initialize thinks the 
+ * allocation failed.
+ *
+ * The overhead of a function call will still be imposed.
+ */
+void * _Scheduler_simple_Allocate( 
+  Thread_Control *the_thread
+)
+{
+  return (void*)-1; /* maybe pick an appropriate poison value */
+}
+
+
+/**
+ * This routine does nothing, and is used as a stub for Schedule update
+ *
+ * The overhead of a function call will still be imposed.
+ */
+void _Scheduler_simple_Update( 
+  Thread_Control *the_thread
+)
+{
+}
+
+/**
+ * This routine does nothing, and is used as a stub for Schedule free
+ *
+ * The overhead of a function call will still be imposed.
+ */
+void _Scheduler_simple_Free( 
+  Thread_Control *the_thread
+)
+{
+}
+
+/**
+ * This routine initializes the simple scheduler.
+ */
+void _Scheduler_simple_Initialize ( void )
+{
+  void *f;
+
+  /* 
+   * Initialize Ready Queue
+   */
+
+  /* allocate ready queue structures */
+  f = _Workspace_Allocate_or_fatal_error( sizeof(Chain_Control) );
+  _Scheduler.information = f;
+
+  /* initialize ready queue structure */
+  _Chain_Initialize_empty( (Chain_Control *)f );
+}
Index: cpukit/score/src/schedulersimpleblock.c
===================================================================
--- cpukit/score/src/schedulersimpleblock.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimpleblock.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,39 @@
+/*
+ *  Scheduler Simple Handler / Block
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Block(
+  Thread_Control   *the_thread
+)
+{
+  _Scheduler_simple_Extract(the_thread);
+
+  if ( _Thread_Is_heir( the_thread ) )
+    _Scheduler_simple_Schedule();
+
+  if ( _Thread_Is_executing( the_thread ) )
+    _Thread_Dispatch_necessary = true;
+}
Index: cpukit/score/src/schedulersimpleenqueue.c
===================================================================
--- cpukit/score/src/schedulersimpleenqueue.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimpleenqueue.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,29 @@
+/*
+ *  Schedule Simple Handler / Enqueue
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/score/chain.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Enqueue(
+  Thread_Control            *the_thread
+)
+{
+  _Scheduler_simple_Ready_queue_Enqueue( the_thread );
+}
Index: cpukit/score/src/schedulersimpleenqueuefirst.c
===================================================================
--- cpukit/score/src/schedulersimpleenqueuefirst.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimpleenqueuefirst.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,28 @@
+/*
+ *  Schedule Simple Handler / Enqueue First
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/score/chain.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Enqueue_first(
+  Thread_Control            *the_thread
+)
+{
+  _Scheduler_simple_Ready_queue_Enqueue_first( the_thread );
+}
Index: cpukit/score/src/schedulersimpleextract.c
===================================================================
--- cpukit/score/src/schedulersimpleextract.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimpleextract.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,28 @@
+/*
+ *  Schedule Simple Handler / Extract 
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/score/chain.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Extract(
+  Thread_Control    *the_thread
+)
+{
+  _Chain_Extract_unprotected( &the_thread->Object.Node );
+}
Index: cpukit/score/src/schedulersimplereadyqueueenqueue.c
===================================================================
--- cpukit/score/src/schedulersimplereadyqueueenqueue.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimplereadyqueueenqueue.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,48 @@
+/*
+ *  Schedule Simple Handler / Ready Queue Enqueue
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/score/chain.h>
+#include <rtems/score/isr.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Ready_queue_Enqueue(
+  Thread_Control    *the_thread
+)
+{
+  Chain_Control    *ready;
+  Chain_Node       *the_node;
+  Thread_Control   *current;
+
+  ready    = (Chain_Control *)_Scheduler.information;
+  the_node = _Chain_First( ready );
+  current  = (Thread_Control *)ready;
+
+  for ( ; !_Chain_Is_tail( ready, the_node ) ; the_node = the_node->next ) {
+    current = (Thread_Control *) the_node;
+
+    /* break when AT END OR PAST our priority */
+    if ( the_thread->current_priority < current->current_priority ) {
+      current = (Thread_Control *)current->Object.Node.previous;
+      break;
+    }
+  }
+
+  /* enqueue */
+  _Chain_Insert_unprotected( (Chain_Node *)current, &the_thread->Object.Node );
+}
Index: cpukit/score/src/schedulersimplereadyqueueenqueuefirst.c
===================================================================
--- cpukit/score/src/schedulersimplereadyqueueenqueuefirst.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimplereadyqueueenqueuefirst.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,52 @@
+/*
+ *  Schedule Simple Handler / Ready Queue Enqueue First
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/score/chain.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Ready_queue_Enqueue_first(
+  Thread_Control    *the_thread
+)
+{
+  Chain_Control    *ready;
+  Chain_Node       *the_node;
+  Thread_Control   *current;
+
+  ready    = (Chain_Control *)_Scheduler.information;
+  current  = (Thread_Control *)ready;
+
+  /*
+   * Do NOT need to check for end of chain because there is always
+   * at least one task on the ready chain -- the IDLE task.  It can
+   * never block, should never attempt to obtain a semaphore or mutex,
+   * and thus will always be there.
+   */
+  for ( the_node = _Chain_First(ready) ; ; the_node = the_node->next ) {
+    current = (Thread_Control *) the_node;
+
+    /* break when AT HEAD OF (or PAST) our priority */
+    if ( the_thread->current_priority <= current->current_priority ) {
+      current = (Thread_Control *)current->Object.Node.previous;
+      break;
+    }
+  }
+
+  /* enqueue */
+  _Chain_Insert_unprotected( (Chain_Node *)current, &the_thread->Object.Node );
+}
Index: cpukit/score/src/schedulersimpleschedule.c
===================================================================
--- cpukit/score/src/schedulersimpleschedule.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimpleschedule.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,34 @@
+/*
+ *  Scheduler Simple Handler / Schedule
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Schedule(void)
+{
+  _Thread_Heir = (Thread_Control *) _Chain_First( 
+    (Chain_Control *) _Scheduler.information 
+  );
+}
Index: cpukit/score/src/schedulersimpleunblock.c
===================================================================
--- cpukit/score/src/schedulersimpleunblock.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimpleunblock.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,47 @@
+/*
+ *  Scheduler Simple Handler / Unblock
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/isr.h>
+#include <rtems/score/schedulersimple.h>
+#include <rtems/score/thread.h>
+
+void _Scheduler_simple_Unblock(
+  Thread_Control    *the_thread
+)
+{
+  _Scheduler_simple_Ready_queue_Enqueue(the_thread);
+
+  /*
+   *  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;
+  }
+}
Index: cpukit/score/src/schedulersimpleyield.c
===================================================================
--- cpukit/score/src/schedulersimpleyield.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
+++ cpukit/score/src/schedulersimpleyield.c	(revision 0118ed65ea96db1032771620fc5fb1c1290f9d47)
@@ -0,0 +1,42 @@
+/*
+ *  Scheduler Simple Handler / Yield
+ *
+ *  COPYRIGHT (c) 2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  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/isr.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/schedulersimple.h>
+
+void _Scheduler_simple_Yield( void )
+{
+  ISR_Level       level;
+  Thread_Control *executing;
+
+  executing = _Thread_Executing;
+  _ISR_Disable( level );
+      
+    _Scheduler_simple_Ready_queue_Requeue(&_Scheduler, executing);
+
+    _ISR_Flash( level );
+
+    _Scheduler_simple_Schedule();
+    
+    if ( !_Thread_Is_heir( executing ) )
+      _Thread_Dispatch_necessary = true;
+
+  _ISR_Enable( level );
+}
