Index: testsuites/smptests/ChangeLog
===================================================================
--- testsuites/smptests/ChangeLog	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/ChangeLog	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -1,2 +1,10 @@
+2011-07-29	Jennifer Averett <Jennifer.Averett@OARcorp.com>
+
+	* smp01/init.c, smp02/init.c, smp02/tasks.c, smp03/init.c,
+	smp03/tasks.c, smp04/Makefile.am, smp04/init.c, smp05/init.c,
+	smp06/init.c, smp07/init.c, smp08/init.c: Cleaned up tests and fixed
+	some print statement problems.
+	* smp04/tasks.c: Removed.
+
 2011-06-29	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: testsuites/smptests/smp01/init.c
===================================================================
--- testsuites/smptests/smp01/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp01/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -64,5 +64,5 @@
 
     cpu_num = bsp_smp_processor_id();
-    (" CPU %d start task TA%c\n", cpu_num, ch);
+    locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
     status = rtems_task_start( id, Test_task, i+1 );
     directive_failed( status, "task start" );
@@ -79,6 +79,5 @@
     }
     if (allDone) {
-      Loop();
-      locked_printf( "*** END OF TEST SMP01 ***" );
+      locked_printf( "*** END OF TEST SMP01 ***\n" );
       rtems_test_exit( 0 );
     }
Index: testsuites/smptests/smp02/init.c
===================================================================
--- testsuites/smptests/smp02/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp02/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -48,5 +48,5 @@
   directive_failed( status,"rtems_semaphore_obtain of SEM1\n");
 
-  for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
+  for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){
 
     /* Create and start tasks for each CPU */
@@ -65,5 +65,4 @@
     locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
     status = rtems_task_start( id, Test_task, i+1 );
-    locked_printf(str, "rtems_task_start TA%d", i+1);
     directive_failed( status, str );
   }
Index: testsuites/smptests/smp02/tasks.c
===================================================================
--- testsuites/smptests/smp02/tasks.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp02/tasks.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -16,5 +16,5 @@
 #include "system.h"
 
-void Loop() {
+void Loop(void) {
   volatile int i;
 
@@ -27,6 +27,4 @@
   uint32_t  task_index
 ){
-  int i;
-
   if (Log_index < LOG_SIZE) { 
     /* Log the information */
@@ -58,6 +56,4 @@
   
     rtems_semaphore_release( Semaphore );
-  }
-
-  while(1);
+  } while(1);
 }
Index: testsuites/smptests/smp03/init.c
===================================================================
--- testsuites/smptests/smp03/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp03/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -30,5 +30,4 @@
 {
   int               cpu_num;
-  rtems_status_code sc;
 
   cpu_num = bsp_smp_processor_id();
@@ -42,5 +41,5 @@
 {
   int               i;
-  char              ch;
+  char              ch = '0';
   rtems_id          id;
   rtems_status_code status;
@@ -49,5 +48,5 @@
   locked_print_initialize();
 
-  locked_printf( "\n\n***  SMP03 TEST ***" );
+  locked_printf( "\n\n***  SMP03 TEST ***\n" );
 
 
@@ -56,5 +55,5 @@
 
   /* for each remaining cpu create and start a task */
-  for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
+  for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){
 
     ch = '0' + i;
@@ -83,5 +82,5 @@
   );
   TestFinished = false;
-  status = rtems_task_start( id, Test_task, CONFIGURE_SMP_MAXIMUM_PROCESSORS );
+  status = rtems_task_start(id,Test_task,rtems_smp_get_number_of_processors());
 
   /* Wait on the last task to run */
@@ -90,5 +89,7 @@
 
   /* End the test */
-  locked_printf( "*** END OF TEST SMP03 ***" );
+  Loop();
+  locked_printf( "*** END OF TEST SMP03 ***\n" );
+  Loop();
   rtems_test_exit( 0 );    
 }
Index: testsuites/smptests/smp03/tasks.c
===================================================================
--- testsuites/smptests/smp03/tasks.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp03/tasks.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -29,5 +29,5 @@
    * test to end.
    */
-  if ( task_index  == CONFIGURE_SMP_MAXIMUM_PROCESSORS ) {
+  if ( task_index  == rtems_smp_get_number_of_processors() ) {
     TestFinished = true;
   }
Index: testsuites/smptests/smp04/Makefile.am
===================================================================
--- testsuites/smptests/smp04/Makefile.am	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp04/Makefile.am	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -6,5 +6,5 @@
 
 rtems_tests_PROGRAMS = smp04
-smp04_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
+smp04_SOURCES = init.c system.h ../../support/src/locked_print.c
 
 dist_rtems_tests_DATA = smp04.scn
Index: testsuites/smptests/smp04/init.c
===================================================================
--- testsuites/smptests/smp04/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp04/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -26,6 +26,6 @@
 }
 
-void PrintTaskInfo(
-  const char *task_name
+rtems_task Test_task(
+  rtems_task_argument task_index
 )
 {
@@ -33,6 +33,9 @@
 
   cpu_num = bsp_smp_processor_id();
+  locked_printf("  CPU %d running task TA%" PRIu32 "\n", cpu_num, task_index );
+  Loop();
+  TaskRan[task_index] = true;
 
-  locked_printf("  CPU %d running task %s\n", cpu_num, task_name );
+  while(1);
 }
 
@@ -46,4 +49,5 @@
   rtems_status_code status;
   bool              allDone;
+  int               cpu_num;
 
   Loop();
@@ -51,10 +55,18 @@
   locked_printf( "\n\n***  SMP04 TEST ***\n" );
 
-  PrintTaskInfo( "Init" );
+  /* Display which cpu is running this init thread. */
+  cpu_num = bsp_smp_processor_id();
+  locked_printf("  CPU %d running task Init\n", cpu_num );
 
+  /* Set all Tasks to not ran except for the init task */
   TaskRan[0] = true;
   for ( i=1; i <= rtems_smp_get_number_of_processors() ; i++ )
     TaskRan[i] = false;
   
+
+  /*
+   * For each processor create and start a task alternating 
+   * between  RTEMS_PREEMPT and RTEMS_NO_PREEMPT.
+   */
   for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
 
@@ -76,10 +88,14 @@
       &id
     );
-  }
 
-  for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
+    locked_printf(
+      "Start TA%c a %s task\n",
+      ch, 
+      ((i%2) ? "RTEMS_PREEMPT" : "RTEMS_NO_PREEMPT" ) 
+    );
     status = rtems_task_start( id, Test_task, i );
 
-    /* Force a wait on the task to run in order to synchronize on
+    /*
+     * Force a wait on the task to run in order to synchronize on
      * simulated systems.
      */   
@@ -88,6 +104,15 @@
   }
 
+  /*
+   * Create and start one more task.  This task
+   * should preempt the longest running PREEMPTABLE
+   * task and run on that cpu.
+   */
   ch = '0' + rtems_smp_get_number_of_processors() ;
-
+  locked_printf(
+    "Create a TA%c a %s task\n",
+    ch, 
+    "RTEMS_PREEMPT"  
+  );
   status = rtems_task_create(
     rtems_build_name( 'T', 'A', ch, ' ' ),
@@ -98,4 +123,9 @@
     &id
   );
+  locked_printf(
+    "Start TA%c a %s task\n",
+    ch, 
+    "RTEMS_PREEMPT" 
+  );
   status = rtems_task_start(
     id,
@@ -104,5 +134,7 @@
   );
   
-  /* Wait on the all tasks to run */
+  /* 
+   * Wait on the all tasks to run 
+   */
   while (1) {
     allDone = true;
@@ -113,5 +145,5 @@
     if (allDone) {
       Loop();
-      locked_printf( "*** END OF TEST SMP04 ***" );
+      locked_printf( "*** END OF TEST SMP04 ***\n" );
       rtems_test_exit( 0 );
     }
Index: stsuites/smptests/smp04/tasks.c
===================================================================
--- testsuites/smptests/smp04/tasks.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
- *  COPYRIGHT (c) 1989-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$
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "system.h"
-
-rtems_task Test_task(
-  rtems_task_argument task_index
-)
-{
-  char              task_name[5];
-
-  sprintf(task_name, "TA%" PRIu32, task_index );
-  PrintTaskInfo( task_name );
-
-  Loop();
-  TaskRan[task_index] = true;
-
-  while(1);
-}
Index: testsuites/smptests/smp05/init.c
===================================================================
--- testsuites/smptests/smp05/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp05/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -18,5 +18,5 @@
 {
   locked_printf( "Shut down from CPU %d\n", bsp_smp_processor_id() );
-  locked_printf( "*** END OF TEST SMP05 ***" );
+  locked_printf( "*** END OF TEST SMP05 ***\n" );
   rtems_test_exit(0);
 }
Index: testsuites/smptests/smp06/init.c
===================================================================
--- testsuites/smptests/smp06/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp06/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -32,5 +32,5 @@
 
   if ( do_exit ) {
-    locked_printf( "*** END OF TEST SMP06 ***" );
+    locked_printf( "*** END OF TEST SMP06 ***\n" );
     rtems_test_exit(0);
   }
@@ -43,6 +43,4 @@
 )
 {
-  int                i;
-  char               ch;
   int                cpu_num;
   rtems_id           id;
@@ -116,5 +114,5 @@
 
 #define CONFIGURE_INIT_TASK_PRIORITY      2
-#define CONFIGURE_INIT_TASK_MODES         RTEMS_PREEMPT
+#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_PREEMPT
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
Index: testsuites/smptests/smp07/init.c
===================================================================
--- testsuites/smptests/smp07/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp07/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -45,5 +45,9 @@
 
   /* Print that the task is up and running. */
-  locked_printf(" CPU %d running Task %s after semaphore release\n", cpu_num, name);
+  locked_printf(
+    " CPU %d running Task %s after semaphore release\n", 
+    cpu_num, 
+    name
+  );
 
   (void) rtems_task_delete( RTEMS_SELF );
Index: testsuites/smptests/smp08/init.c
===================================================================
--- testsuites/smptests/smp08/init.c	(revision 602b1f61b6414e032dcf126497fde625bd3aca58)
+++ testsuites/smptests/smp08/init.c	(revision cf288c3898a5d7db53af312a67da4dca9f2e6045)
@@ -23,5 +23,4 @@
 {
   int               cpu_num;
-  rtems_status_code sc;
 
   cpu_num = bsp_smp_processor_id();
@@ -46,5 +45,5 @@
   rtems_time_of_day time;
   int               i;
-  char              ch;
+  char              ch[4];
   rtems_id          id;
  
@@ -78,8 +77,8 @@
 
   for ( i=1; i <= rtems_smp_get_number_of_processors() *3; i++ ) {
-    ch = '0' + i;
 
+    sprintf(ch, "%02" PRId32, i );
     status = rtems_task_create(
-      rtems_build_name( 'T', 'A', ch, ' ' ),
+      rtems_build_name( 'T', 'A', ch[0], ch[1] ),
       1,
       RTEMS_MINIMUM_STACK_SIZE,
