Index: testsuites/sptests/sp08/init.c
===================================================================
--- testsuites/sptests/sp08/init.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ testsuites/sptests/sp08/init.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,47 +1,31 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  COPYRIGHT (c) 1989-2012.
+/*  Init
+ *
+ *  This routine is the initialization task for this test program.
+ *  It is a user initialization task and has the responsibility for creating
+ *  and starting the tasks that make up the test.  If the time of day
+ *  clock is required for the test, it should also be set to a known
+ *  value by this function.
+ *
+ *  Input parameters:
+ *    argument - task argument
+ *
+ *  Output parameters:  NONE
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ *  $Id$
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <tmacros.h>
-
-#include <rtems/score/sysstate.h>
-
-const char rtems_test_name[] = "SP 8";
-
-/* forward declarations to avoid warnings */
-rtems_task Init(rtems_task_argument argument);
-
-#define PRIxrtems_mode 	PRIx32
-
-#define put_mode( _comment, _output_mode ) \
-   printf( "%s %08" PRIxrtems_mode "\n", _comment, _output_mode );
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
 
 rtems_task Init(
@@ -49,292 +33,24 @@
 )
 {
-  rtems_mode        previous_mode;
   rtems_status_code status;
 
-  TEST_BEGIN();
+  puts( "\n\n*** TEST 8 ***" );
 
-/* BEGINNING OF RTEMS_ASR */
+  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
 
-  status = rtems_task_mode( RTEMS_ASR, RTEMS_ASR_MASK, &previous_mode );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode: ",
-    previous_mode
+  status = rtems_task_create(
+    Task_name[ 1 ],
+    1,
+    2048,
+    RTEMS_DEFAULT_MODES,
+    RTEMS_DEFAULT_ATTRIBUTES,
+    &Task_id[ 1 ]
   );
+  directive_failed( status, "rtems_task_create of TA1" );
 
-  status = rtems_task_mode(
-    RTEMS_NO_ASR,
-    RTEMS_ASR_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode: ",
-    previous_mode
-  );
+  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+  directive_failed( status, "rtems_task_start of TA1" );
 
-  status = rtems_task_mode(
-    RTEMS_NO_ASR,
-    RTEMS_ASR_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_ASR,
-    RTEMS_ASR_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode: ",
-    previous_mode
-  );
-
-/* END OF RTEMS_ASR */
-
-/* BEGINNING OF RTEMS_TIMESLICE */
-
-  status = rtems_task_mode(
-    RTEMS_NO_TIMESLICE,
-    RTEMS_TIMESLICE_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_TIMESLICE,
-    RTEMS_TIMESLICE_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_TIMESLICE,
-    RTEMS_TIMESLICE_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_NO_TIMESLICE,
-    RTEMS_TIMESLICE_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode: ",
-    previous_mode
-  );
-
-/* END OF RTEMS_TIMESLICE */
-
-/* BEGINNING OF RTEMS_PREEMPT */
-
-  status = rtems_task_mode(
-    RTEMS_PREEMPT,
-    RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_NO_PREEMPT,
-    RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_NO_PREEMPT,
-    RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_PREEMPT,
-    RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
-    previous_mode
-  );
-
-/* END OF RTEMS_PREEMPT */
-
-/* BEGINNING OF RTEMS_INTERRUPT_LEVEL */
-#if CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE
-  status = rtems_task_mode(
-    RTEMS_INTERRUPT_LEVEL(3),
-    RTEMS_INTERRUPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 3 ) - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_INTERRUPT_LEVEL(5),
-    RTEMS_INTERRUPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode: ",
-    previous_mode
-  );
-#else
-  status = rtems_task_mode(
-    RTEMS_INTERRUPT_LEVEL( 1 ),
-    RTEMS_INTERRUPT_MASK,
-    &previous_mode
-  );
-  fatal_directive_status( status, RTEMS_NOT_IMPLEMENTED, "rtems_task_mode" );
-#endif
-/* END OF RTEMS_INTERRUPT_LEVEL */
-
-/* BEGINNING OF COMBINATIONS */
-
-  status = rtems_task_mode(
-#if CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE
-    RTEMS_INTERRUPT_LEVEL(0) |
-#else
-    RTEMS_INTERRUPT_LEVEL(3) |
-#endif
-      RTEMS_NO_ASR |
-      RTEMS_TIMESLICE | RTEMS_NO_PREEMPT,
-    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
-      RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - set all modes        - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-#if CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE
-    RTEMS_INTERRUPT_LEVEL(0) |
-#else
-    RTEMS_INTERRUPT_LEVEL(3) |
-#endif
-      RTEMS_NO_ASR |
-      RTEMS_TIMESLICE | RTEMS_NO_PREEMPT,
-    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
-      RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - set all modes        - previous mode: ",
-    previous_mode
-  );
-
-  status = rtems_task_mode(
-    RTEMS_INTERRUPT_LEVEL(0) | RTEMS_ASR | RTEMS_NO_TIMESLICE | RTEMS_PREEMPT,
-    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
-    RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - clear all modes      - previous mode: ",
-    previous_mode
-  );
-
-/* END OF COMBINATIONS */
-
-/* BEGINNING OF CURRENT MODE */
-
-  status = rtems_task_mode(
-    RTEMS_CURRENT_MODE,
-    RTEMS_CURRENT_MODE,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - get current mode     - previous mode: ",
-    previous_mode
-  );
-
-/* END OF CURRENT MODE */
-
-/* TEST BEING IN A SYSTEM STATE OTHER THAN UP */
-  puts( "TA1 - FORCE system state to before multitasking" );
-  _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
-
-  puts( "TA1 - enable preemption mode" );
-  status = rtems_task_mode(
-    RTEMS_PREEMPT,
-    RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-  put_mode(
-    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
-    previous_mode
-  );
-
-  puts( "TA1 - disable preemption mode" );
-  status = rtems_task_mode(
-    RTEMS_NO_PREEMPT,
-    RTEMS_PREEMPT_MASK,
-    &previous_mode
-  );
-  directive_failed( status, "rtems_task_mode" );
-
-  puts( "TA1 - Restore system state" );
-  _System_state_Set( SYSTEM_STATE_UP );
-
-/* END OF TEST BEING IN A SYSTEM STATE OTHER THAN UP */
-
-  TEST_END();
-  rtems_test_exit( 0 );
+  status = rtems_task_delete( RTEMS_SELF );
+  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
 }
-
-/* configuration information */
-#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
-#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS             1
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_INIT
-#include <rtems/confdefs.h>
-/* end of file */
Index: testsuites/sptests/sp08/sp08.scn
===================================================================
--- testsuites/sptests/sp08/sp08.scn	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ testsuites/sptests/sp08/sp08.scn	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,34 +1,22 @@
 *** TEST 8 ***
-TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000100
-TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000100
-TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000500
-TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000500
-TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000100
-TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000100
-TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000300
-TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000300
-TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000100
+TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000000
+TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000000
+TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000400
+TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000400
+TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000000
+TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000000
+TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000200
+TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000200
+TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000000
 TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode:  00000000
 TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode:  00000100
 TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000100
 TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 3 ) - previous mode:  00000000
-TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode:  00000000
-TA1 - rtems_task_mode - set all modes        - previous mode:  00000000
-TA1 - rtems_task_mode - set all modes        - previous mode:  00000700
-TA1 - rtems_task_mode - clear all modes      - previous mode:  00000700
+TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode:  00000003
+TA1 - rtems_task_mode - set all modes        - previous mode:  00000005
+TA1 - rtems_task_mode - set all modes        - previous mode:  00000703
+TA1 - rtems_task_mode - clear all modes      - previous mode:  00000703
 TA1 - rtems_task_mode - get current mode     - previous mode:  00000000
-TA1 - FORCE system state to before multitasking
-TA1 - enable preemption mode
-TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000000
-TA1 - disable preemption mode
-TA1 - Restore system state
 *** END OF TEST 8 ***
-0  size = 0x000404f6 .
-not load section .debug_frame: addr = 0x00000000  size = 0x00004820 .
-not load section .debug_str: addr = 0x00000000  size = 0x0000f673 .
-not load section .debug_loc: addr = 0x00000000  size = 0x0001c59c .
-not load section .debug_pubtypes: addr = 0x00000000  size = 0x0005eac5 .
-not load section .debug_ranges: addr = 0x00000000  size = 0x000015e0 .
-not load section .ARM.attributes: addr = 0x00000000  size = 0x00000010 .
-call ARMul_InitSymTable,kernel filename is sp08.ralf. 
-start addr is set to 0x00000058 by exec file.
+
+NOTE: The interrupt level lines will be different on CPUs with few levels.
Index: testsuites/sptests/sp08/system.h
===================================================================
--- testsuites/sptests/sp08/system.h	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ testsuites/sptests/sp08/system.h	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,33 @@
+/*  system.h
+ *
+ *  This include file contains information that is included in every
+ *  function in the test set.
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN  extern             /* external definition */
+
+/* macros */
+
+#define put_mode( _comment, _output_mode ) \
+   printf( "%s %08x\n", _comment, _output_mode );
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
Index: testsuites/sptests/sp08/task1.c
===================================================================
--- testsuites/sptests/sp08/task1.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ testsuites/sptests/sp08/task1.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,256 @@
+/*  Task_1
+ *
+ *  This routine serves as a test task.  It verifies all combinations of
+ *  task mode changes.
+ *
+ *  Input parameters:
+ *    argument - task argument
+ *
+ *  Output parameters:  NONE
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1(
+  rtems_task_argument argument
+)
+{
+  rtems_mode        previous_mode;
+  rtems_status_code status;
+
+/* BEGINNING OF RTEMS_ASR */
+
+  status = rtems_task_mode( RTEMS_ASR, RTEMS_ASR_MASK, &previous_mode );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_NO_ASR,
+    RTEMS_ASR_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_NO_ASR,
+    RTEMS_ASR_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_ASR,
+    RTEMS_ASR_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode: ",
+    previous_mode
+  );
+
+/* END OF RTEMS_ASR */
+
+/* BEGINNING OF RTEMS_TIMESLICE */
+
+  status = rtems_task_mode(
+    RTEMS_NO_TIMESLICE,
+    RTEMS_TIMESLICE_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_TIMESLICE,
+    RTEMS_TIMESLICE_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_TIMESLICE,
+    RTEMS_TIMESLICE_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_NO_TIMESLICE,
+    RTEMS_TIMESLICE_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode: ",
+    previous_mode
+  );
+
+/* END OF RTEMS_TIMESLICE */
+
+/* BEGINNING OF RTEMS_PREEMPT */
+
+  status = rtems_task_mode(
+    RTEMS_PREEMPT,
+    RTEMS_PREEMPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_NO_PREEMPT,
+    RTEMS_PREEMPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_NO_PREEMPT,
+    RTEMS_PREEMPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_PREEMPT,
+    RTEMS_PREEMPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
+    previous_mode
+  );
+
+/* END OF RTEMS_PREEMPT */
+
+/* BEGINNING OF RTEMS_INTERRUPT_LEVEL */
+
+  status = rtems_task_mode(
+    RTEMS_INTERRUPT_LEVEL(3),
+    RTEMS_INTERRUPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 3 ) - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_INTERRUPT_LEVEL(5),
+    RTEMS_INTERRUPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode: ",
+    previous_mode
+  );
+
+/* END OF RTEMS_INTERRUPT_LEVEL */
+
+/* BEGINNING OF COMBINATIONS */
+
+  status = rtems_task_mode(
+    RTEMS_INTERRUPT_LEVEL(3) | RTEMS_NO_ASR |
+      RTEMS_TIMESLICE | RTEMS_NO_PREEMPT,
+    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
+      RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - set all modes        - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_INTERRUPT_LEVEL(3) | RTEMS_NO_ASR |
+      RTEMS_TIMESLICE | RTEMS_NO_PREEMPT,
+    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
+      RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - set all modes        - previous mode: ",
+    previous_mode
+  );
+
+  status = rtems_task_mode(
+    RTEMS_INTERRUPT_LEVEL(0) | RTEMS_ASR | RTEMS_NO_TIMESLICE | RTEMS_PREEMPT,
+    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
+    RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - clear all modes      - previous mode: ",
+    previous_mode
+  );
+
+/* END OF COMBINATIONS */
+
+/* BEGINNING OF CURRENT MODE */
+
+  status = rtems_task_mode(
+    RTEMS_CURRENT_MODE,
+    RTEMS_CURRENT_MODE,
+    &previous_mode
+  );
+  directive_failed( status, "rtems_task_mode" );
+  put_mode(
+    "TA1 - rtems_task_mode - get current mode     - previous mode: ",
+    previous_mode
+  );
+
+/* END OF CURRENT MODE */
+
+  puts( "*** END OF TEST 8 ***" );
+  exit( 0 );
+}
