diff options
Diffstat (limited to 'testsuites/sptests/sp17')
-rw-r--r-- | testsuites/sptests/sp17/asr.c | 32 | ||||
-rw-r--r-- | testsuites/sptests/sp17/init.c | 72 | ||||
-rw-r--r-- | testsuites/sptests/sp17/sp17.doc | 35 | ||||
-rw-r--r-- | testsuites/sptests/sp17/sp17.scn | 8 | ||||
-rw-r--r-- | testsuites/sptests/sp17/system.h | 30 | ||||
-rw-r--r-- | testsuites/sptests/sp17/task1.c | 48 | ||||
-rw-r--r-- | testsuites/sptests/sp17/task2.c | 45 |
7 files changed, 270 insertions, 0 deletions
diff --git a/testsuites/sptests/sp17/asr.c b/testsuites/sptests/sp17/asr.c new file mode 100644 index 0000000000..1795bbd522 --- /dev/null +++ b/testsuites/sptests/sp17/asr.c @@ -0,0 +1,32 @@ +/* Process_asr + * + * This routine performs the processing for task 1's RTEMS_ASR. It is called + * by an assembly routine which saves the necessary registers. + * + * Input parameters: + * signal - signal set + * + * 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_asr Process_asr( + rtems_signal_set signal_set +) +{ + rtems_status_code status; + + status = rtems_task_resume( Task_id[ 2 ] ); + directive_failed( status, "RTEMS_ASR - rtems_task_resume of TA2" ); +} diff --git a/testsuites/sptests/sp17/init.c b/testsuites/sptests/sp17/init.c new file mode 100644 index 0000000000..5527e80c9c --- /dev/null +++ b/testsuites/sptests/sp17/init.c @@ -0,0 +1,72 @@ +/* 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 17 ***" ); + + Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); + + Task_2_preempted = FALSE; + + status = rtems_task_create( + Task_name[ 1 ], + 2, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create of TA1" ); + + status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); + directive_failed( status, "rtems_task_start of TA1" ); + + status = rtems_task_create( + Task_name[ 2 ], + 1, + 2048, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ 2 ] + ); + directive_failed( status, "rtems_task_create of TA2" ); + + status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); + directive_failed( status, "rtems_task_start of TA2" ); + + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); +} diff --git a/testsuites/sptests/sp17/sp17.doc b/testsuites/sptests/sp17/sp17.doc new file mode 100644 index 0000000000..b4258461cf --- /dev/null +++ b/testsuites/sptests/sp17/sp17.doc @@ -0,0 +1,35 @@ +# +# $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: test17 + +directives: + ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, + as_catch, as_return + +concepts: + + a. Verifies system can create and start both the executive's system + initialization and idle task. + + b. Verifies can print strings to the CRT on port 2 of the mvme136 board + using Print and Println in the board support package. + + c. Verifies executive initialization performed correctly. + + d. Verifies that a task can get the task identification number + of another task. + + e. Verifies that a signal can be sent to a remote task. diff --git a/testsuites/sptests/sp17/sp17.scn b/testsuites/sptests/sp17/sp17.scn new file mode 100644 index 0000000000..47fd140e2a --- /dev/null +++ b/testsuites/sptests/sp17/sp17.scn @@ -0,0 +1,8 @@ +*** TEST 17 *** +TA2 - Suspending self +TA1 - rtems_signal_catch: initializing signal catcher +TA1 - Sending signal to self +TA2 - signal_return preempted correctly +TA1 - TA2 correctly preempted me +TA1 - Got Back!!! +*** END OF TEST 17 *** diff --git a/testsuites/sptests/sp17/system.h b/testsuites/sptests/sp17/system.h new file mode 100644 index 0000000000..aa2c6d17e4 --- /dev/null +++ b/testsuites/sptests/sp17/system.h @@ -0,0 +1,30 @@ +/* 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 */ + +/* structures */ + +#include "gvar.h" + +/* end of include file */ diff --git a/testsuites/sptests/sp17/task1.c b/testsuites/sptests/sp17/task1.c new file mode 100644 index 0000000000..282c161a39 --- /dev/null +++ b/testsuites/sptests/sp17/task1.c @@ -0,0 +1,48 @@ +/* Task_1 + * + * This task initializes the signal catcher, sends the first signal + * if running on the first node, and loops while waiting for signals. + * + * NOTE: The signal catcher is not reentrant and hence RTEMS_NO_ASR must + * be a part of its execution mode. + * + * 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_status_code status; + + puts( "TA1 - rtems_signal_catch: initializing signal catcher" ); + status = rtems_signal_catch( Process_asr, RTEMS_NO_ASR | RTEMS_NO_PREEMPT ); + directive_failed( status, "rtems_signal_catch" ); + + puts( "TA1 - Sending signal to self" ); + status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_16 ); + directive_failed( status, "rtems_signal_send" ); + + if ( Task_2_preempted == TRUE ) + puts( "TA1 - TA2 correctly preempted me" ); + + puts("TA1 - Got Back!!!"); + + puts( "*** END OF TEST 17 ***" ); + exit( 0 ); +} diff --git a/testsuites/sptests/sp17/task2.c b/testsuites/sptests/sp17/task2.c new file mode 100644 index 0000000000..cd3e16c7c0 --- /dev/null +++ b/testsuites/sptests/sp17/task2.c @@ -0,0 +1,45 @@ +/* Task_2 + * + * This task initializes the signal catcher, sends the first signal + * if running on the first node, and loops while waiting for signals. + * + * NOTE: The signal catcher is not reentrant and hence RTEMS_NO_ASR must + * be a part of its execution mode. + * + * 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; + + Task_2_preempted = FALSE; + + puts( "TA2 - Suspending self" ); + status = rtems_task_suspend( RTEMS_SELF ); + directive_failed( status, "rtems_task_suspend of TA2" ); + + puts( "TA2 - signal_return preempted correctly" ); + + Task_2_preempted = TRUE; + + status = rtems_task_suspend( RTEMS_SELF ); + directive_failed( status, "rtems_task_suspend of TA2" ); +} |