diff options
Diffstat (limited to 'c/src/tests/samples/ticker')
-rw-r--r-- | c/src/tests/samples/ticker/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/tests/samples/ticker/Makefile.am | 41 | ||||
-rw-r--r-- | c/src/tests/samples/ticker/init.c | 75 | ||||
-rw-r--r-- | c/src/tests/samples/ticker/system.h | 115 | ||||
-rw-r--r-- | c/src/tests/samples/ticker/tasks.c | 45 | ||||
-rw-r--r-- | c/src/tests/samples/ticker/ticker.doc | 12 | ||||
-rw-r--r-- | c/src/tests/samples/ticker/ticker.scn | 16 |
7 files changed, 0 insertions, 306 deletions
diff --git a/c/src/tests/samples/ticker/.cvsignore b/c/src/tests/samples/ticker/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/tests/samples/ticker/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/tests/samples/ticker/Makefile.am b/c/src/tests/samples/ticker/Makefile.am deleted file mode 100644 index 7d5d0a4b21..0000000000 --- a/c/src/tests/samples/ticker/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = ticker -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io - -C_FILES = init.c tasks.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -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)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - -all-local: ${ARCH} $(TMPINSTALL_FILES) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../automake/local.am diff --git a/c/src/tests/samples/ticker/init.c b/c/src/tests/samples/ticker/init.c deleted file mode 100644 index e71c05140f..0000000000 --- a/c/src/tests/samples/ticker/init.c +++ /dev/null @@ -1,75 +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 CONFIGURE_INIT -#include "system.h" -#include <stdio.h> - -/* - * Keep the names and IDs in global variables so another task can use them. - */ - -rtems_id Task_id[ 4 ]; /* array of task ids */ -rtems_name Task_name[ 4 ]; /* array of task names */ - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_time_of_day time; - - puts( "\n\n*** CLOCK TICK TEST ***" ); - - time.year = 1988; - time.month = 12; - time.day = 31; - time.hour = 9; - time.minute = 0; - time.second = 0; - time.ticks = 0; - - status = rtems_clock_set( &time ); - - 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', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ] - ); - status = rtems_task_create( - Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ] - ); - status = rtems_task_create( - Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ] - ); - - status = rtems_task_start( Task_id[ 1 ], Test_task, 1 ); - status = rtems_task_start( Task_id[ 2 ], Test_task, 2 ); - status = rtems_task_start( Task_id[ 3 ], Test_task, 3 ); - - status = rtems_task_delete( RTEMS_SELF ); -} diff --git a/c/src/tests/samples/ticker/system.h b/c/src/tests/samples/ticker/system.h deleted file mode 100644 index 2139bc1403..0000000000 --- a/c/src/tests/samples/ticker/system.h +++ /dev/null @@ -1,115 +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 <rtems.h> - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* global variables */ - -/* - * Keep the names and IDs in global variables so another task can use them. - */ - -extern rtems_id Task_id[ 4 ]; /* array of task ids */ -extern rtems_name Task_name[ 4 ]; /* array of task names */ - - -/* configuration information */ - -#include <bsp.h> /* for device driver prototypes */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) - -#include <confdefs.h> - -/* - * Handy macros and static inline functions - */ - -/* - * Macro to hide the ugliness of printing the time. - */ - -#define print_time(_s1, _tb, _s2) \ - do { \ - printf( "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ - _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ - (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ - fflush(stdout); \ - } while ( 0 ) - -/* - * Macro to print an task name that is composed of ASCII characters. - * - */ - -#define put_name( _name, _crlf ) \ - do { \ - rtems_unsigned32 c0, c1, c2, c3; \ - \ - c0 = ((_name) >> 24) & 0xff; \ - c1 = ((_name) >> 16) & 0xff; \ - c2 = ((_name) >> 8) & 0xff; \ - c3 = (_name) & 0xff; \ - putchar( (char)c0 ); \ - if ( c1 ) putchar( (char)c1 ); \ - if ( c2 ) putchar( (char)c2 ); \ - if ( c3 ) putchar( (char)c3 ); \ - if ( (_crlf) ) \ - putchar( '\n' ); \ - } while (0) - -/* - * static inline routine to make obtaining ticks per second easier. - */ - -static inline rtems_unsigned32 get_ticks_per_second( void ) -{ - rtems_interval ticks_per_second; - (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); return ticks_per_second; -} - - -/* - * This allows us to view the "Test_task" instantiations as a set - * of numbered tasks by eliminating the number of application - * tasks created. - * - * In reality, this is too complex for the purposes of this - * example. It would have been easier to pass a task argument. :) - * But it shows how rtems_id's can sometimes be used. - */ - -#define task_number( tid ) \ - ( rtems_get_index( tid ) - \ - rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks ) - -/* end of include file */ diff --git a/c/src/tests/samples/ticker/tasks.c b/c/src/tests/samples/ticker/tasks.c deleted file mode 100644 index 4ba35f61c1..0000000000 --- a/c/src/tests/samples/ticker/tasks.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Test_task - * - * This routine serves as a test task. It verifies the basic task - * switching capabilities of the executive. - * - * 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$ - */ - -#include "system.h" -#include <stdio.h> -#include <stdlib.h> - -rtems_task Test_task( - rtems_task_argument unused -) -{ - rtems_id tid; - rtems_time_of_day time; - rtems_unsigned32 task_index; - rtems_status_code status; - - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); - task_index = task_number( tid ); - for ( ; ; ) { - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - if ( time.second >= 35 ) { - puts( "*** END OF CLOCK TICK TEST ***" ); - exit( 0 ); - } - put_name( Task_name[ task_index ], FALSE ); - print_time( " - rtems_clock_get - ", &time, "\n" ); - status = rtems_task_wake_after( task_index * 5 * get_ticks_per_second() ); - } -} diff --git a/c/src/tests/samples/ticker/ticker.doc b/c/src/tests/samples/ticker/ticker.doc deleted file mode 100644 index 5c0baceb8d..0000000000 --- a/c/src/tests/samples/ticker/ticker.doc +++ /dev/null @@ -1,12 +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. -# - - diff --git a/c/src/tests/samples/ticker/ticker.scn b/c/src/tests/samples/ticker/ticker.scn deleted file mode 100644 index 35952e6170..0000000000 --- a/c/src/tests/samples/ticker/ticker.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** CLOCK TICK TEST *** -TA1 - tm_get - 09:00:00 12/31/1988 -TA2 - tm_get - 09:00:00 12/31/1988 -TA3 - tm_get - 09:00:00 12/31/1988 -TA1 - tm_get - 09:00:05 12/31/1988 -TA1 - tm_get - 09:00:10 12/31/1988 -TA2 - tm_get - 09:00:10 12/31/1988 -TA1 - tm_get - 09:00:15 12/31/1988 -TA3 - tm_get - 09:00:15 12/31/1988 -TA1 - tm_get - 09:00:20 12/31/1988 -TA2 - tm_get - 09:00:20 12/31/1988 -TA1 - tm_get - 09:00:25 12/31/1988 -TA1 - tm_get - 09:00:30 12/31/1988 -TA2 - tm_get - 09:00:30 12/31/1988 -TA3 - tm_get - 09:00:30 12/31/1988 -*** END OF CLOCK TICK TEST *** |