summaryrefslogtreecommitdiffstats
path: root/c/src/tests/libtests/cpuuse
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/tests/libtests/cpuuse/.cvsignore2
-rw-r--r--c/src/tests/libtests/cpuuse/Makefile.am42
-rw-r--r--c/src/tests/libtests/cpuuse/cpuuse.scn34
-rw-r--r--c/src/tests/libtests/cpuuse/init.c105
-rw-r--r--c/src/tests/libtests/cpuuse/system.h81
-rw-r--r--c/src/tests/libtests/cpuuse/task1.c102
-rw-r--r--c/src/tests/libtests/cpuuse/task2.c47
-rw-r--r--c/src/tests/libtests/cpuuse/task3.c28
-rw-r--r--c/src/tests/libtests/cpuuse/tswitch.c65
9 files changed, 0 insertions, 506 deletions
diff --git a/c/src/tests/libtests/cpuuse/.cvsignore b/c/src/tests/libtests/cpuuse/.cvsignore
deleted file mode 100644
index 282522db03..0000000000
--- a/c/src/tests/libtests/cpuuse/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/c/src/tests/libtests/cpuuse/Makefile.am b/c/src/tests/libtests/cpuuse/Makefile.am
deleted file mode 100644
index c07192445e..0000000000
--- a/c/src/tests/libtests/cpuuse/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-##
-## $Id$
-##
-
-
-TEST = cpuuse
-
-MANAGERS = io rate_monotonic
-
-C_FILES = init.c task1.c task2.c task3.c tswitch.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
-
-H_FILES = system.h
-noinst_HEADERS = $(H_FILES)
-
-DOCTYPES = scn
-DOCS = $(DOCTYPES:%=$(TEST).%)
-
-SRCS = $(DOCS) $(C_FILES) $(H_FILES)
-OBJS = $(C_O_FILES)
-
-PRINT_SRCS = $(DOCS)
-
-PGM = ${ARCH}/$(TEST).exe
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
-include $(top_srcdir)/../automake/compile.am
-include $(top_srcdir)/../automake/leaf.am
-include $(top_srcdir)/libtests.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/libtests/cpuuse/cpuuse.scn b/c/src/tests/libtests/cpuuse/cpuuse.scn
deleted file mode 100644
index b45cf91136..0000000000
--- a/c/src/tests/libtests/cpuuse/cpuuse.scn
+++ /dev/null
@@ -1,34 +0,0 @@
-*** CPU USAGE LIBRARY TEST ***
-TA1 - rtems_task_suspend - on Task 2
-TA1 - rtems_task_suspend - on Task 3
-TA1 - killing time
-TA1 - rtems_task_resume - on Task 2
-TA1 - rtems_task_resume - on Task 3
-TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT
-TA1 - 09:15:10 12/31/1988
-TA1 - 09:15:11 12/31/1988
-TA1 - 09:15:12 12/31/1988
-TA1 - 09:15:13 12/31/1988
-TA1 - 09:15:14 12/31/1988
-TA1 - 09:15:15 12/31/1988
-TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT
-TA1 - 09:15:00 12/31/1988
-TA2 - 09:15:04 12/31/1988
-TA3 - 09:15:05 12/31/1988
-TA1 - 09:15:06 12/31/1988
-TA2 - 09:15:07 12/31/1988
-TA3 - 09:15:08 12/31/1988
-TA1 - 09:15:09 12/31/1988
-TA2 - 09:15:16 12/31/1988
-CPU Usage by thread
- ID NAME TICKS PERCENT
-0x04010001 IDLE 0 0.000
-0x08010002 TA1 1203 0.748
-0x08010003 TA2 204 0.127
-0x08010004 TA3 202 0.126
-
-Ticks since last reset = 1601
-
-Total Units = 1609
-*** END OF CPU USAGE LIBRARY TEST ***
-NOTE: Actual time per task will vary but there should be no IDLE time.
diff --git a/c/src/tests/libtests/cpuuse/init.c b/c/src/tests/libtests/cpuuse/init.c
deleted file mode 100644
index eeebe08586..0000000000
--- a/c/src/tests/libtests/cpuuse/init.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * This is a clone of sp04 which has been modified to use the cpu monitoring
- * library.
- *
- * 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$
- */
-
-#define TEST_INIT
-#include "system.h"
-
-rtems_extensions_table Extensions = {
- NULL, /* task create user extension */
- NULL, /* task start user extension */
- NULL, /* task restart user extension */
- NULL, /* task delete user extension */
- Task_switch, /* task switch user extension */
- NULL, /* task begin user extension */
- NULL, /* task exitted user extension */
- NULL /* fatal error user extension */
-};
-
-rtems_task Init(
- rtems_task_argument argument
-)
-{
- rtems_status_code status;
- rtems_time_of_day time;
-
- puts( "\n\n*** CPU USAGE LIBRARY TEST ***" );
- build_time( &time, 12, 31, 1988, 9, 15, 0, 0 );
-
- status = rtems_clock_set( &time );
- directive_failed( status, "rtems_clock_set" );
-
- Extension_name[ 1 ] = rtems_build_name( 'E', 'X', 'T', ' ' );
-
- status = rtems_extension_create(
- Extension_name[ 1 ],
- &Extensions,
- &Extension_id[ 1 ]
- );
- directive_failed( status, "rtems_extension_create" );
-
- 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', ' ' );
-
- Run_count[ 1 ] = 0;
- Run_count[ 2 ] = 0;
- Run_count[ 3 ] = 0;
-
- status = rtems_task_create(
- Task_name[ 1 ],
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_TIMESLICE,
- RTEMS_FLOATING_POINT,
- &Task_id[ 1 ]
- );
- directive_failed( status, "rtems_task_create of TA1" );
-
- status = rtems_task_create(
- Task_name[ 2 ],
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_TIMESLICE,
- RTEMS_FLOATING_POINT,
- &Task_id[ 2 ]
- );
- directive_failed( status, "rtems_task_create of TA2" );
-
- status = rtems_task_create(
- Task_name[ 3 ],
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_TIMESLICE,
- RTEMS_FLOATING_POINT,
- &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" );
-
- status = rtems_task_delete( RTEMS_SELF );
- directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
-}
diff --git a/c/src/tests/libtests/cpuuse/system.h b/c/src/tests/libtests/cpuuse/system.h
deleted file mode 100644
index f1bb23150c..0000000000
--- a/c/src/tests/libtests/cpuuse/system.h
+++ /dev/null
@@ -1,81 +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>
-
-/* functions */
-
-rtems_task Init(
- rtems_task_argument argument
-);
-
-rtems_task Task_1(
- rtems_task_argument argument
-);
-
-rtems_task Task_2(
- rtems_task_argument argument
-);
-
-rtems_task Task_3(
- rtems_task_argument argument
-);
-
-void Task_switch(
- rtems_tcb *unused,
- rtems_tcb *heir
-);
-
-/* configuration information */
-
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
-#define CONFIGURE_MAXIMUM_TASKS 4
-#define CONFIGURE_TICKS_PER_TIMESLICE 100
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_EXTRA_TASK_STACKS (6 * RTEMS_MINIMUM_STACK_SIZE)
-
-#include <confdefs.h>
-
-/* global variables */
-
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
-TEST_EXTERN rtems_id Extension_id[ 4 ];
-TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */
-
-/* array of task run counts */
-TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ];
-
-/*
- * Keep track of task switches
- */
-
-struct taskSwitchLog {
- int taskIndex;
- rtems_time_of_day when;
-};
-
-extern struct taskSwitchLog taskSwitchLog[];
-extern int taskSwitchLogIndex;
-volatile extern int testsFinished;
-
-
-/* end of include file */
diff --git a/c/src/tests/libtests/cpuuse/task1.c b/c/src/tests/libtests/cpuuse/task1.c
deleted file mode 100644
index 525a9db06c..0000000000
--- a/c/src/tests/libtests/cpuuse/task1.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Task_1
- *
- * This test serves as a test task. It verifies timeslicing activities
- * and tswitch extension processing.
- *
- * 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"
-
-rtems_task Task_1(
- rtems_task_argument argument
-)
-{
- rtems_unsigned32 seconds;
- rtems_unsigned32 old_seconds;
- rtems_mode previous_mode;
- rtems_time_of_day time;
- rtems_status_code status;
- rtems_unsigned32 start_time;
- rtems_unsigned32 end_time;
-
- puts( "TA1 - rtems_task_suspend - on Task 2" );
- status = rtems_task_suspend( Task_id[ 2 ] );
- directive_failed( status, "rtems_task_suspend of TA2" );
-
- puts( "TA1 - rtems_task_suspend - on Task 3" );
- status = rtems_task_suspend( Task_id[ 3 ] );
- directive_failed( status, "rtems_task_suspend of TA3" );
-
- status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &start_time );
- directive_failed( status, "rtems_clock_get" );
-
- puts( "TA1 - killing time" );
-
- for ( ; ; ) {
- status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &end_time );
- directive_failed( status, "rtems_clock_get" );
-
- if ( end_time > (start_time + 2) )
- break;
- }
-
- puts( "TA1 - rtems_task_resume - on Task 2" );
- status = rtems_task_resume( Task_id[ 2 ] );
- directive_failed( status, "rtems_task_resume of TA2" );
-
- puts( "TA1 - rtems_task_resume - on Task 3" );
- status = rtems_task_resume( Task_id[ 3 ] );
- directive_failed( status, "rtems_task_resume of TA3" );
-
- while ( FOREVER ) {
- if ( Run_count[ 1 ] == 3 ) {
- puts( "TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT" );
-
- status = rtems_task_mode(
- RTEMS_NO_PREEMPT,
- RTEMS_PREEMPT_MASK,
- &previous_mode
- );
- directive_failed( status, "rtems_task_mode" );
-
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- directive_failed( status, "rtems_clock_get" );
-
- old_seconds = time.second;
-
- for ( seconds = 0 ; seconds < 6 ; ) {
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- directive_failed( status, "rtems_clock_get" );
-
- if ( time.second != old_seconds ) {
- old_seconds = time.second;
- seconds++;
- print_time( "TA1 - ", &time, "\n" );
- }
- }
-
- puts( "TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT" );
- status = rtems_task_mode(
- RTEMS_PREEMPT,
- RTEMS_PREEMPT_MASK,
- &previous_mode
- );
- directive_failed( status, "rtems_task_mode" );
-
- while ( FOREVER );
- }
- }
-}
diff --git a/c/src/tests/libtests/cpuuse/task2.c b/c/src/tests/libtests/cpuuse/task2.c
deleted file mode 100644
index 7eb477d8c9..0000000000
--- a/c/src/tests/libtests/cpuuse/task2.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Task_2
- *
- * This routine serves as a test task. It is just a CPU bound task
- * requiring timesliced operation.
- *
- * 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"
-
-#include <rtems/cpuuse.h>
-
-static void
-showTaskSwitches (void)
-{
- int i;
- int switches = taskSwitchLogIndex;
-
- for (i = 0 ; i < switches ; i++) {
- put_name( Task_name[taskSwitchLog[i].taskIndex], FALSE );
- print_time( "- ", &taskSwitchLog[i].when, "\n" );
- }
-}
-
-rtems_task Task_2(
- rtems_task_argument argument
-)
-{
- while ( !testsFinished );
-
- showTaskSwitches ();
- CPU_usage_Dump();
- puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
- rtems_test_exit( 0 );
-}
diff --git a/c/src/tests/libtests/cpuuse/task3.c b/c/src/tests/libtests/cpuuse/task3.c
deleted file mode 100644
index faefb4b40b..0000000000
--- a/c/src/tests/libtests/cpuuse/task3.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Task_3
- *
- * This routine serves as a test task. It is just a CPU bound task
- * requiring timesliced operation.
- *
- * 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"
-
-rtems_task Task_3(
- rtems_task_argument argument
-)
-{
- while( FOREVER );
-}
diff --git a/c/src/tests/libtests/cpuuse/tswitch.c b/c/src/tests/libtests/cpuuse/tswitch.c
deleted file mode 100644
index 1339194684..0000000000
--- a/c/src/tests/libtests/cpuuse/tswitch.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Task_switch
- *
- * This routine is the tswitch user extension. It determines which
- * task is being switched to and displays a message indicating the
- * time and date that it gained control.
- *
- * Input parameters:
- * unused - pointer to currently running TCB
- * heir - pointer to heir TCB
- *
- * 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"
-
-struct taskSwitchLog taskSwitchLog[1000];
-int taskSwitchLogIndex;
-volatile int testsFinished;;
-
-rtems_extension Task_switch(
- rtems_tcb *unused,
- rtems_tcb *heir
-)
-{
- rtems_unsigned32 index;
- rtems_time_of_day time;
- rtems_status_code status;
-
- index = task_number( heir->Object.id );
-
- switch( index ) {
- case 1:
- case 2:
- case 3:
- Run_count[ index ] += 1;
-
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- fatal_directive_status_with_level( status, RTEMS_SUCCESSFUL,
- "rtems_clock_get", 1 );
-
- if (taskSwitchLogIndex <
- (sizeof taskSwitchLog / sizeof taskSwitchLog[0])) {
- taskSwitchLog[taskSwitchLogIndex].taskIndex = index;
- taskSwitchLog[taskSwitchLogIndex].when = time;
- taskSwitchLogIndex++;
- }
- if ( time.second >= 16 )
- testsFinished = 1;
-
- break;
-
- case 0:
- default:
- break;
- }
-}