summaryrefslogtreecommitdiffstats
path: root/c/src/tests/sptests/sp16
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/tests/sptests/sp16')
-rw-r--r--c/src/tests/sptests/sp16/init.c131
-rw-r--r--c/src/tests/sptests/sp16/sp16.doc24
-rw-r--r--c/src/tests/sptests/sp16/sp16.scn58
-rw-r--r--c/src/tests/sptests/sp16/system.h32
-rw-r--r--c/src/tests/sptests/sp16/task1.c282
-rw-r--r--c/src/tests/sptests/sp16/task2.c86
-rw-r--r--c/src/tests/sptests/sp16/task3.c57
-rw-r--r--c/src/tests/sptests/sp16/task4.c60
-rw-r--r--c/src/tests/sptests/sp16/task5.c73
9 files changed, 803 insertions, 0 deletions
diff --git a/c/src/tests/sptests/sp16/init.c b/c/src/tests/sptests/sp16/init.c
new file mode 100644
index 0000000000..a5b1163b13
--- /dev/null
+++ b/c/src/tests/sptests/sp16/init.c
@@ -0,0 +1,131 @@
+/* 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.
+ *
+ * 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"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 16 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+ Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' );
+ Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ BASE_PRIORITY,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ BASE_PRIORITY,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ BASE_PRIORITY,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ Region_name[ 1 ] = rtems_build_name( 'R', 'N', '1', ' ' );
+ Region_name[ 2 ] = rtems_build_name( 'R', 'N', '2', ' ' );
+ Region_name[ 3 ] = rtems_build_name( 'R', 'N', '3', ' ' );
+ Region_name[ 4 ] = rtems_build_name( 'R', 'N', '4', ' ' );
+
+ status = rtems_region_create(
+ Region_name[ 1 ],
+ Area_1,
+ 4096,
+ 128,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Region_id[ 1 ]
+ );
+ directive_failed( status, "rtems_region_create of RN1" );
+
+ status = rtems_region_create(
+ Region_name[ 2 ],
+ Area_2,
+ 4096,
+ 128,
+ RTEMS_PRIORITY,
+ &Region_id[ 2 ]
+ );
+ directive_failed( status, "rtems_region_create of RN2" );
+
+ status = rtems_region_create(
+ Region_name[ 3 ],
+ Area_3,
+ 4096,
+ 128,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Region_id[ 3 ]
+ );
+ directive_failed( status, "rtems_region_create of RN3" );
+
+ status = rtems_region_create(
+ Region_name[ 4 ],
+ Area_4,
+ 4096,
+ 128,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Region_id[ 4 ]
+ );
+ directive_failed( status, "rtems_region_create of RN4" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/c/src/tests/sptests/sp16/sp16.doc b/c/src/tests/sptests/sp16/sp16.doc
new file mode 100644
index 0000000000..c5512af051
--- /dev/null
+++ b/c/src/tests/sptests/sp16/sp16.doc
@@ -0,0 +1,24 @@
+#
+# $Id$
+#
+# 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.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test16
+
+directives:
+ ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return,
+ rn_create, rn_ident, rn_getbuf, rn_retbuf, rn_delete
+
+concepts:
+
+ a. This test checks out the region manager.
diff --git a/c/src/tests/sptests/sp16/sp16.scn b/c/src/tests/sptests/sp16/sp16.scn
new file mode 100644
index 0000000000..a1a27cb9ad
--- /dev/null
+++ b/c/src/tests/sptests/sp16/sp16.scn
@@ -0,0 +1,58 @@
+*** TEST 16 ***
+TA1 - rtems_region_ident - rnid => 00010002
+TA1 - rtems_region_get_segment - wait on 100 byte segment from region 2
+TA1 - got segment from region 2 - 0x00000f78
+TA1 - rtems_region_get_segment - wait on 3K segment from region 3
+TA1 - got segment from region 3 - 0x000003f8
+TA1 - rtems_region_get_segment - get 3080 byte segment from region 1 - NO_WAIT
+TA1 - got segment from region 1 - 0x00000378
+TA1 - rtems_task_wake_after - yield processor
+TA2 - rtems_region_get_segment - wait on 2K segment from region 1
+TA3 - rtems_region_get_segment - wait on 3968 byte segment from region 2
+<pause>
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x00000378
+TA1 - rtems_region_get_segment - wait 10 seconds for 3K segment from region 1
+TA2 - got segment from region 1 - 0x000007f8
+TA2 - rtems_region_return_segment - return segment to region 1 - 0x000007f8
+TA2 - rtems_task_set_priority - make self highest priority task
+TA2 - rtems_region_get_segment - wait on 3968 byte segment
+TA1 - got segment from region 1 - 0x000003f8
+TA1 - rtems_region_return_segment - return segment to region 2 - 0x00000f78
+TA2 - got segment from region 2 - 0x00000008
+TA2 - rtems_region_return_segment - return segment to region 2 - 0x00000008
+TA2 - rtems_task_delete - delete self
+TA1 - rtems_task_wake_after - yield processor
+TA3 - got segment from region 2 - 0x00000008
+TA3 - rtems_region_get_segment - wait on 2K segment from region 3
+TA1 - rtems_task_delete - delete TA3
+<pause>
+TA1 - rtems_task_wake_after - yield processor
+TA4 - rtems_region_get_segment - wait on 1.5K segment from region 1
+TA5 - rtems_region_get_segment - wait on 1.5K segment from region 1
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x000003f8
+TA1 - rtems_task_wake_after - yield processor
+TA4 - got and returned 0x000009f8
+TA5 - got and returned 0x000003f0
+TA1 - rtems_region_get_segment - wait 10 seconds for 3K segment from region 1
+TA1 - got segment from region 1 - 0x000003f8
+TA1 - rtems_task_wake_after - yield processor
+TA4 - rtems_region_get_segment - wait on 3K segment from region 1
+TA5 - rtems_region_get_segment - wait on 3K segment from region 1
+TA1 - rtems_task_delete - delete TA4
+TA1 - rtems_region_return_segment - return segment to region 1 - 0x000003f8
+TA1 - rtems_task_wake_after - yield processor
+TA5 - got segment from region 1 - 0x000003f8
+TA5 - rtems_region_return_segment - return segment to region 1 - 0x000003f8
+TA5 - rtems_task_delete - delete self
+TA1 - rtems_region_delete - delete region 1
+TA1 - rtems_region_get_segment - get 3K segment from region 4
+TA1 - got segment from region 4 - 0x000003f8
+TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4
+TA1 - rtems_task_get_note - RTEMS_UNSATISFIED
+TA1 - rtems_region_extend - extend region 4 by 4K
+TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4
+TA1 - got 3K segment from region 4 - 0x00001400
+TA1 - rtems_region_return_segment - return segment to region 4 - 0x000003f8
+TA1 - rtems_region_return_segment - return segment to region 4 - 0x00001400
+TA1 - rtems_region_delete - delete region 4
+*** END OF TEST 16 ***
diff --git a/c/src/tests/sptests/sp16/system.h b/c/src/tests/sptests/sp16/system.h
new file mode 100644
index 0000000000..9e2b748a85
--- /dev/null
+++ b/c/src/tests/sptests/sp16/system.h
@@ -0,0 +1,32 @@
+/* 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 */
+
+#define BASE_PRIORITY 140 /* all tasks priority */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/c/src/tests/sptests/sp16/task1.c b/c/src/tests/sptests/sp16/task1.c
new file mode 100644
index 0000000000..25f90aca00
--- /dev/null
+++ b/c/src/tests/sptests/sp16/task1.c
@@ -0,0 +1,282 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It tests the region manager.
+ *
+ * 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_id rnid;
+ void *segment_address_1;
+ void *segment_address_2;
+ void *segment_address_3;
+ void *segment_address_4;
+ rtems_status_code status;
+
+ status = rtems_region_ident( Region_name[ 1 ], &rnid );
+ printf( "TA1 - rtems_region_ident - rnid => %08x\n", rnid );
+ directive_failed( status, "rtems_region_ident of RN1" );
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait on 100 byte segment from region 2"
+ );
+ status = rtems_region_get_segment(
+ Region_id[ 2 ],
+ 100,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 2 - " );
+ Put_address_from_area_2( segment_address_1 );
+ new_line;
+
+ puts( "TA1 - rtems_region_get_segment - wait on 3K segment from region 3" );
+ status = rtems_region_get_segment(
+ Region_id[ 3 ],
+ 3072,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_2
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 3 - " );
+ Put_address_from_area_3( segment_address_2 );
+ new_line;
+
+ puts_nocr( "TA1 - rtems_region_get_segment - get 3080 byte segment " );
+ puts ( "from region 1 - NO_WAIT" );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 3080,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_3
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( segment_address_3 );
+ new_line;
+
+ puts( "TA1 - rtems_task_wake_after - yield processor" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after" );
+
+pause();
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( segment_address_3 );
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_3 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - wait 10 seconds for 3K "
+ "segment from region 1"
+ );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 3072,
+ RTEMS_DEFAULT_OPTIONS,
+ 10 * TICKS_PER_SECOND,
+ &segment_address_4
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( segment_address_4 );
+ new_line;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 2 - "
+ );
+ Put_address_from_area_2( segment_address_1 );
+ new_line;
+ status = rtems_region_return_segment( Region_id[ 2 ], segment_address_1 );
+ directive_failed( status, "rtems_region_return_segment" );
+
+ puts( "TA1 - rtems_task_wake_after - yield processor" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "TA1 - rtems_task_delete - delete TA3" );
+ status = rtems_task_delete( Task_id[ 3 ] );
+ directive_failed( status, "rtems_task_delete of TA3" );
+
+pause();
+
+ status = rtems_task_create(
+ Task_name[ 4 ],
+ BASE_PRIORITY,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 4 ]
+ );
+ directive_failed( status, "rtems_task_create of TA4" );
+
+ status = rtems_task_create(
+ Task_name[ 5 ],
+ BASE_PRIORITY,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 5 ]
+ );
+ directive_failed( status, "rtems_task_create of TA5" );
+
+ status = rtems_task_start( Task_id[ 4 ], Task_4, 0 );
+ directive_failed( status, "rtems_task_start of TA4" );
+
+ status = rtems_task_start( Task_id[ 5 ], Task5, 0 );
+ directive_failed( status, "rtems_task_start of TA5" );
+
+ puts( "TA1 - rtems_task_wake_after - yield processor" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( segment_address_4 );
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_4 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+
+ puts( "TA1 - rtems_task_wake_after - yield processor" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts_nocr( "TA1 - rtems_region_get_segment - wait 10 seconds for 3K " );
+ puts ( "segment from region 1");
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 3072,
+ RTEMS_DEFAULT_OPTIONS,
+ 10 * TICKS_PER_SECOND,
+ &segment_address_4
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 1 - " );
+ Put_address_from_area_1( segment_address_4 );
+ new_line;
+
+ puts( "TA1 - rtems_task_wake_after - yield processor" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "TA1 - rtems_task_delete - delete TA4" );
+ status = rtems_task_delete( Task_id[ 4 ] );
+ directive_failed( status, "rtems_task_delete of TA4" );
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( segment_address_4 );
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_4 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+
+ puts( "TA1 - rtems_task_wake_after - yield processor" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+
+ puts( "TA1 - rtems_region_delete - delete region 1" );
+ status = rtems_region_delete( Region_id[ 1 ] );
+ directive_failed( status, "rtems_region_delete" );
+
+ puts( "TA1 - rtems_region_get_segment - get 3K segment from region 4" );
+ status = rtems_region_get_segment(
+ Region_id[ 4 ],
+ 3072,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got segment from region 4 - " );
+ Put_address_from_area_4( segment_address_1 );
+ new_line;
+
+ puts(
+ "TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4"
+ );
+ status = rtems_region_get_segment(
+ Region_id[ 4 ],
+ 3072,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_2
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_task_get_segment with no memory left"
+ );
+ puts( "TA1 - rtems_task_get_note - RTEMS_UNSATISFIED" );
+
+ puts( "TA1 - rtems_region_extend - extend region 4 by 4K" );
+ status = rtems_region_extend(
+ Region_id[ 4 ],
+ &Area_4[4096],
+ 4096
+ );
+ directive_failed( status, "rtems_region_extend" );
+
+ puts(
+ "TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4"
+ );
+ status = rtems_region_get_segment(
+ Region_id[ 4 ],
+ 3072,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_3
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA1 - got 3K segment from region 4 - " );
+ Put_address_from_area_4( segment_address_3 );
+ new_line;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 4 - "
+ );
+ Put_address_from_area_4( segment_address_1 );
+ status = rtems_region_return_segment( Region_id[ 4 ], segment_address_1 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+
+ puts_nocr(
+ "TA1 - rtems_region_return_segment - return segment to region 4 - "
+ );
+ Put_address_from_area_4( segment_address_3 );
+ status = rtems_region_return_segment( Region_id[ 4 ], segment_address_3 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+
+ puts( "TA1 - rtems_region_delete - delete region 4" );
+ status = rtems_region_delete( Region_id[ 4 ] );
+ directive_failed( status, "rtems_region_delete" );
+
+ puts( "*** END OF TEST 16 ***" );
+ exit( 0 );
+}
diff --git a/c/src/tests/sptests/sp16/task2.c b/c/src/tests/sptests/sp16/task2.c
new file mode 100644
index 0000000000..d5bc312b27
--- /dev/null
+++ b/c/src/tests/sptests/sp16/task2.c
@@ -0,0 +1,86 @@
+/* Task_2
+ *
+ * This routine serves as a test task. It competes with the other tasks
+ * for region resources.
+ *
+ * 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_2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_task_priority previous_priority;
+ void *segment_address_1;
+ void *segment_address_2;
+
+ puts( "TA2 - rtems_region_get_segment - wait on 2K segment from region 1" );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 2048,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA2 - got segment from region 1 - " );
+ Put_address_from_area_1( segment_address_1 );
+ new_line;
+
+ puts_nocr(
+ "TA2 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( segment_address_1 );
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+
+ puts( "TA2 - rtems_task_set_priority - make self highest priority task" );
+ status = rtems_task_set_priority(
+ RTEMS_SELF,
+ BASE_PRIORITY-1,
+ &previous_priority
+ );
+ directive_failed( status, "rtems_task_set_priority" );
+
+ puts("TA2 - rtems_region_get_segment - wait on 3968 byte segment");
+ status = rtems_region_get_segment(
+ Region_id[ 2 ],
+ 3968,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_2
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA2 - got segment from region 2 - ");
+ Put_address_from_area_2( segment_address_2 );
+ new_line;
+
+ puts_nocr(
+ "TA2 - rtems_region_return_segment - return segment to region 2 - "
+ );
+ Put_address_from_area_2( segment_address_2 );
+ status = rtems_region_return_segment( Region_id[ 2 ], segment_address_2 );
+ directive_failed( status, "rtems_region_return_segment" );
+ new_line;
+
+ puts( "TA2 - rtems_task_delete - delete self" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/c/src/tests/sptests/sp16/task3.c b/c/src/tests/sptests/sp16/task3.c
new file mode 100644
index 0000000000..292e5824f6
--- /dev/null
+++ b/c/src/tests/sptests/sp16/task3.c
@@ -0,0 +1,57 @@
+/* Task_3
+ *
+ * This routine serves as a test task. It competes with the other tasks
+ * for region resources.
+ *
+ * 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_3(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ void *segment_address_1;
+ void *segment_address_2;
+
+ puts(
+ "TA3 - rtems_region_get_segment - wait on 3968 byte segment from region 2"
+ );
+ status = rtems_region_get_segment(
+ Region_id[ 2 ],
+ 3968,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts_nocr( "TA3 - got segment from region 2 - " );
+ Put_address_from_area_2( segment_address_1 );
+ new_line;
+ directive_failed( status, "rtems_region_return_segment" );
+
+ puts( "TA3 - rtems_region_get_segment - wait on 2K segment from region 3" );
+ status = rtems_region_get_segment(
+ Region_id[ 3 ],
+ 2048,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_2
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+}
diff --git a/c/src/tests/sptests/sp16/task4.c b/c/src/tests/sptests/sp16/task4.c
new file mode 100644
index 0000000000..f3da89b72e
--- /dev/null
+++ b/c/src/tests/sptests/sp16/task4.c
@@ -0,0 +1,60 @@
+/* Task_4
+ *
+ * This routine serves as a test task. It competes with the other tasks
+ * for region resources.
+ *
+ * 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_4(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ void *segment_address_1;
+ void *segment_address_2;
+
+ puts( "TA4 - rtems_region_get_segment - wait on 1.5K segment from region 1" );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 1536,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 );
+ directive_failed( status, "rtems_region_return_segment" );
+ puts_nocr( "TA4 - got and returned " );
+ Put_address_from_area_1( segment_address_1 );
+ new_line;
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "TA4 - rtems_region_get_segment - wait on 3K segment from region 1" );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 3072,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_2
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+}
diff --git a/c/src/tests/sptests/sp16/task5.c b/c/src/tests/sptests/sp16/task5.c
new file mode 100644
index 0000000000..5defa75f9c
--- /dev/null
+++ b/c/src/tests/sptests/sp16/task5.c
@@ -0,0 +1,73 @@
+/* Task5
+ *
+ * This routine serves as a test task. It competes with the other tasks
+ * for region resources.
+ *
+ * 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 Task5(
+ rtems_task_argument argument
+)
+{
+ void *segment_address_1;
+ void *segment_address_2;
+ rtems_status_code status;
+
+ puts( "TA5 - rtems_region_get_segment - wait on 1.5K segment from region 1" );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 1536,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 );
+ directive_failed( status, "rtems_region_return_segment" );
+ puts_nocr( "TA5 - got and returned " );
+ Put_address_from_area_1( segment_address_1 );
+ new_line;
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "TA5 - rtems_region_get_segment - wait on 3K segment from region 1" );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 3072,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_2
+ );
+ puts_nocr( "TA5 - got segment from region 1 - " );
+ Put_address_from_area_1( segment_address_2 );
+ new_line;
+
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );
+ puts_nocr(
+ "TA5 - rtems_region_return_segment - return segment to region 1 - "
+ );
+ Put_address_from_area_1( segment_address_2 );
+ new_line;
+
+ puts( "TA5 - rtems_task_delete - delete self" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}