diff options
Diffstat (limited to 'c/src/tests/itrontests/itrontask03')
-rw-r--r-- | c/src/tests/itrontests/itrontask03/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/Makefile.am | 41 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/init.c | 144 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/itrontask03.doc | 54 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/itrontask03.scn | 21 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/preempt.c | 54 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/system.h | 49 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/task1.c | 57 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/task2.c | 31 | ||||
-rw-r--r-- | c/src/tests/itrontests/itrontask03/task3.c | 39 |
10 files changed, 0 insertions, 492 deletions
diff --git a/c/src/tests/itrontests/itrontask03/.cvsignore b/c/src/tests/itrontests/itrontask03/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/tests/itrontests/itrontask03/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/tests/itrontests/itrontask03/Makefile.am b/c/src/tests/itrontests/itrontask03/Makefile.am deleted file mode 100644 index 0118f38e8c..0000000000 --- a/c/src/tests/itrontests/itrontask03/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itrontask03 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c preempt.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../automake/compile.am -include $(top_srcdir)/../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../automake/local.am diff --git a/c/src/tests/itrontests/itrontask03/init.c b/c/src/tests/itrontests/itrontask03/init.c deleted file mode 100644 index 687518deaa..0000000000 --- a/c/src/tests/itrontests/itrontask03/init.c +++ /dev/null @@ -1,144 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec 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: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * 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$ - */ - -#define TEST_INIT -#include "system.h" -#include <stdio.h> -#include <assert.h> - -void ITRON_Init( void ) -{ - ER status; - T_CTSK pk_ctsk; - T_RTSK pk_rtsk; - - pk_ctsk.exinf = NULL; - pk_ctsk.tskatr = TA_HLNG; - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; - pk_ctsk.itskpri = PREEMPT_PRIORITY; - pk_ctsk.task = Preempt_task; - - puts( "\n\n*** ITRON TASK TEST 3 ***" ); - - /* - * Create and start the Preempt task the first time. - * Verify that it is dormant when it comes back. - */ - - puts( "INIT - Create and Start PREEMPT" ); - status = chg_pri( TSK_SELF, (PREEMPT_PRIORITY+2) ); - directive_failed( status, "chg_pri of SELF" ); - - status = cre_tsk( PREEMPT_TASK_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of RTEMS_PREEMPT" ); - - status = sta_tsk( PREEMPT_TASK_ID, 0 ); - directive_failed( status, "sta_tsk of RTEMS_PREEMPT" ); - puts( "INIT - rot_rdq - no tasks at this priority" ); - status = rot_rdq( 1 ); - directive_failed( status, "rot_rdq" ); - - puts( "INIT - ref_tsk PREEMPT - Validate DORMANT STATE" ); - status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); - directive_failed( status, "INIT - ref_tsk of RTEMS_PREEMPT"); - fatal_directive_status(pk_rtsk.tskstat,TTS_DMT,"tskstat of PREEMPT"); - - /* - * Restart the Preempt Task. - */ - - status = sta_tsk( PREEMPT_TASK_ID, 0 ); - directive_failed( status, "sta_tsk of RTEMS_PREEMPT" ); - puts( "INIT - rot_rdq - yielding processor" ); - status = rot_rdq( 1 ); - directive_failed( status, "rot_rdq" ); - puts( "INIT - ref_tsk PREEMPT - Validate no longer exists" ); - status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); - fatal_directive_status( status, E_NOEXS, "tskstat of PREEMPT"); - status = chg_pri( TSK_SELF, PREEMPT_PRIORITY ); - directive_failed( status, "chg_pri of SELF" ); - - /* - * XXX - */ - - pk_ctsk.itskpri = 3; - pk_ctsk.task = Task_1; - status = cre_tsk( TA1_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA1" ); - - pk_ctsk.task = Task_2; - status = cre_tsk( TA2_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA2" ); - - pk_ctsk.task = Task_3; - status = cre_tsk( TA3_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA3" ); - - status = sta_tsk( TA1_ID, 0 ); - directive_failed( status, "sta_tsk of TA1" ); - status = sta_tsk( TA2_ID, 0 ); - directive_failed( status, "sta_tsk of TA2" ); - status = sta_tsk( TA3_ID, 0 ); - directive_failed( status, "sta_tsk of TA3" ); - - status = ref_tsk( &pk_rtsk, TA1_ID); - directive_failed( status, "INIT - ref_tsk of TA1"); - fatal_directive_status( pk_rtsk.tskstat, TTS_RDY , "tskstat of TA1"); - - puts( "INIT - suspending TA2 while middle task on a ready chain" ); - status = sus_tsk( TA2_ID ); - directive_failed( status, "sus_tsk of TA2" ); - status = ref_tsk( &pk_rtsk, TA2_ID); - directive_failed( status, "INIT - ref_tsk of TA2"); - fatal_directive_status( pk_rtsk.tskstat, TTS_SUS, "tskstat of TA2"); - - status = ter_tsk( TA1_ID ); - directive_failed( status, "ter_tsk of TA1" ); - status = del_tsk( TA1_ID ); - directive_failed( status, "del_tsk of TA1" ); - status = ter_tsk( TA2_ID ); - directive_failed( status, "ter_tsk of TA2" ); - status = ter_tsk( TA3_ID ); - directive_failed( status, "ter_tsk of TA3" ); - - pk_ctsk.itskpri = 1; - pk_ctsk.task = Task_1; - status = cre_tsk( TA1_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA1 at priority 1" ); - - status = sta_tsk( TA1_ID, 0 ); - directive_failed( status, "sta_tsk of TA1" ); - status = sta_tsk( TA2_ID, 0 ); - directive_failed( status, "sta_tsk of TA2" ); - status = sta_tsk( TA3_ID, 0 ); - directive_failed( status, "sta_tsk of TA3" ); - - exd_tsk(); - assert(0); -} - - - - - - diff --git a/c/src/tests/itrontests/itrontask03/itrontask03.doc b/c/src/tests/itrontests/itrontask03/itrontask03.doc deleted file mode 100644 index 35cf95f975..0000000000 --- a/c/src/tests/itrontests/itrontask03/itrontask03.doc +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# 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. -# - -This file describes the directives and concepts tested by this test set. -This test is based upon the test in sp0. - -test set name: itrontask03 - -directives: - chg_pri cre_tsk del_tsk exd_tsk rot_rdq sta_tsk sus_tsk ter_tsk - -concepts: XXX - Verify - - a. verifies rot_rdq can be used by equal priority tasks to correctly yeild the processor - - b. Verifies sus_tsk suspends another task. - - c. Verifies rot_rdq with a yeild process response. - - a. Verifies that a task can delete another task and also delete itself. - - b. Verifies that memory is freed back to the heap correctly. - - c. Verifies that TCBs are freed back to the inactive chain correctly. - - d. Verifies that a task can get the task identification number of - another task. - - e. Verifies the _Set_state routine where the task is not READY. - - f. Verifies the break statement in the _Block_activate routine. - - g. Verifies the while loop in the _Prev_tcb routine. - -notes: - - rtems_wake_after calls should be replaced with itron calls when - the time functionality is added. - -output: - - - - - - diff --git a/c/src/tests/itrontests/itrontask03/itrontask03.scn b/c/src/tests/itrontests/itrontask03/itrontask03.scn deleted file mode 100644 index f933bf7161..0000000000 --- a/c/src/tests/itrontests/itrontask03/itrontask03.scn +++ /dev/null @@ -1,21 +0,0 @@ -*** ITRON TASK TEST 3 *** -INIT - Create and Start PREEMPT -PREEMPT - ref_tsk validation -PREEMPT - chg_pri increment priority -PREEMPT - ext_tsk - going to DORMANT state -INIT - rot_rdq - no tasks at this priority -INIT - ref_tsk PREEMPT - Validate DORMANT STATE -PREEMPT - ref_tsk validation -PREEMPT - exd_tsk - Exit and Delete task -INIT - rot_rdq - yielding processor -INIT - ref_tsk PREEMPT - Validate no longer exists -INIT - suspending TA2 while middle task on a ready chain -TA1 - rtems_task_wake_after - sleep 1 second -TA2 - rtems_task_wake_after - sleep 1 minute -TA3 - rtems_task_wake_after - sleep 5 seconds -TA1 - chg_pri - set TA3's priority to 2 -TA1 - sus_tsk - suspend TA2 -TA1 - - delete TA2 -TA1 - rtems_task_wake_after - sleep for 5 seconds -TA3 - exd_tsk - exit and delete self -*** ITRON TASK TEST 3 *** diff --git a/c/src/tests/itrontests/itrontask03/preempt.c b/c/src/tests/itrontests/itrontask03/preempt.c deleted file mode 100644 index d74c0a925e..0000000000 --- a/c/src/tests/itrontests/itrontask03/preempt.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Preempt_task - * - * This routine serves as a test task. It verifies the task manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * 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$ - */ - -#include <assert.h> -#include "system.h" - -int Preempt_task_Count; - -void Preempt_task() -{ - ER status; - T_RTSK pk_rtsk; - - puts( "PREEMPT - ref_tsk validation" ); - status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); - fatal_directive_status( status, E_OK , "ref_tsk of PREEMPT"); - assert( pk_rtsk.tskpri == PREEMPT_PRIORITY ); - assert( pk_rtsk.itskpri == PREEMPT_PRIORITY ); - assert( pk_rtsk.task == Preempt_task ); - assert( pk_rtsk.stksz >= RTEMS_MINIMUM_STACK_SIZE ); - assert( pk_rtsk.tskstat == (TTS_RUN | TTS_RDY) ); - - if ( Preempt_task_Count == 0 ) { - Preempt_task_Count ++; - puts( "PREEMPT - chg_pri increment priority "); - status = chg_pri( PREEMPT_TASK_ID, (PREEMPT_PRIORITY+1) ); - directive_failed( status, "chg_pri" ); - puts( "PREEMPT - ext_tsk - going to DORMANT state" ); - ext_tsk( ); - assert( 0 ); - } else { - Preempt_task_Count ++; - puts( "PREEMPT - exd_tsk - Exit and Delete task" ); - exd_tsk( ); - assert( 0 ); - } -} - diff --git a/c/src/tests/itrontests/itrontask03/system.h b/c/src/tests/itrontests/itrontask03/system.h deleted file mode 100644 index f24355ea11..0000000000 --- a/c/src/tests/itrontests/itrontask03/system.h +++ /dev/null @@ -1,49 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * 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$ - */ - -#include <tmacros.h> -#include <itron.h> - -/* functions */ - -void ITRON_Init( void ); -void Preempt_task(); -void Task_1(); -void Task_2(); -void Task_3(); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 6 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include <confdefs.h> - -/* global variables */ - -#define PREEMPT_TASK_ID 2 -#define TA1_ID 3 -#define TA2_ID 4 -#define TA3_ID 5 - - -#define PREEMPT_PRIORITY 1 -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/c/src/tests/itrontests/itrontask03/task1.c b/c/src/tests/itrontests/itrontask03/task1.c deleted file mode 100644 index c771578972..0000000000 --- a/c/src/tests/itrontests/itrontask03/task1.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the task manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * 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$ - */ - -#include "system.h" - -void Task_1() -{ - ER status; - - /* - * XXX - Change to itron routine. - */ - - puts( "TA1 - rtems_task_wake_after - sleep 1 second" ); - status = rtems_task_wake_after( 1*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - status = chg_pri( TA3_ID , 2 ); - directive_failed( status, "chg_pri" ); - - puts( "TA1 - chg_pri - set TA3's priority to 2" ); - - puts( "TA1 - sus_tsk - suspend TA2" ); - status = sus_tsk( TA2_ID ); - directive_failed( status, "sus_tsk of TA2" ); - - puts( "TA1 - - delete TA2" ); - status = ter_tsk( TA2_ID ); - directive_failed( status, "ter_tsk of TA2" ); - - /* - * XXX - Change to itron routine. - */ - - puts( "TA1 - rtems_task_wake_after - sleep for 5 seconds" ); - status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "*** ITRON TASK TEST 3 ***" ); - rtems_test_exit( 0 ); -} diff --git a/c/src/tests/itrontests/itrontask03/task2.c b/c/src/tests/itrontests/itrontask03/task2.c deleted file mode 100644 index ea5384da3a..0000000000 --- a/c/src/tests/itrontests/itrontask03/task2.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. It sleeps for 1 minute but - * does not expect to wake up. Task 1 should suspend then delete it - * so that it appears to never wake up. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * 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$ - */ - -#include "system.h" - -void Task_2() -{ - rtems_status_code status; - - puts( "TA2 - rtems_task_wake_after - sleep 1 minute" ); - status = rtems_task_wake_after( 60*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after in TA2" ); -} diff --git a/c/src/tests/itrontests/itrontask03/task3.c b/c/src/tests/itrontests/itrontask03/task3.c deleted file mode 100644 index f2c1ca0a03..0000000000 --- a/c/src/tests/itrontests/itrontask03/task3.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. It simply sleeps for 5 seconds - * and then deletes itself. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * 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$ - */ - -#include "system.h" - -void Task_3() -{ - rtems_status_code status; - - /* - * XXX - Convert Later. - */ - - puts( "TA3 - rtems_task_wake_after - sleep 5 seconds" ); - status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after in TA3" ); - - - puts( "TA3 - exd_tsk - exit and delete self" ); - exd_tsk(); - directive_failed( 0, "exd_tsk" ); -} |